MCPcopy Create free account
hub / github.com/Kitware/VTK / RemapDataSetIndices

Method RemapDataSetIndices

Common/DataModel/vtkDataAssembly.cxx:1292–1321  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1290
1291//------------------------------------------------------------------------------
1292bool vtkDataAssembly::RemapDataSetIndices(
1293 const std::map<unsigned int, unsigned int>& mapping, bool remove_unmapped)
1294{
1295 bool modified = false;
1296 auto& internals = (*this->Internals);
1297 for (const auto& xpath_node : internals.Document.select_nodes("//dataset"))
1298 {
1299 const auto id = xpath_node.node().attribute("id").as_uint();
1300 auto iter = mapping.find(id);
1301 if (iter != mapping.end())
1302 {
1303 if (iter->second != id)
1304 {
1305 xpath_node.node().attribute("id").set_value(iter->second);
1306 modified = true;
1307 }
1308 }
1309 else if (remove_unmapped)
1310 {
1311 xpath_node.node().parent().remove_child(xpath_node.node());
1312 modified = true;
1313 }
1314 }
1315
1316 if (modified)
1317 {
1318 this->Modified();
1319 }
1320 return modified;
1321}
1322
1323//------------------------------------------------------------------------------
1324void vtkDataAssembly::SubsetCopy(vtkDataAssembly* other, const std::vector<int>& selected_branches)

Callers 2

TestDataAssemblyFunction · 0.80
ExecuteMethod · 0.80

Calls 10

select_nodesMethod · 0.80
as_uintMethod · 0.80
attributeMethod · 0.80
nodeMethod · 0.80
set_valueMethod · 0.80
remove_childMethod · 0.80
findMethod · 0.45
endMethod · 0.45
parentMethod · 0.45
ModifiedMethod · 0.45

Tested by 1

TestDataAssemblyFunction · 0.64