------------------------------------------------------------------------------
| 1290 | |
| 1291 | //------------------------------------------------------------------------------ |
| 1292 | bool 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 | //------------------------------------------------------------------------------ |
| 1324 | void vtkDataAssembly::SubsetCopy(vtkDataAssembly* other, const std::vector<int>& selected_branches) |