------------------------------------------------------------------------------
| 785 | |
| 786 | //------------------------------------------------------------------------------ |
| 787 | bool vtkDataAssembly::AddDataSetIndices(int id, const std::vector<unsigned int>& dataset_indices) |
| 788 | { |
| 789 | auto& internals = (*this->Internals); |
| 790 | auto node = internals.FindNode(id); |
| 791 | if (!node) |
| 792 | { |
| 793 | return false; |
| 794 | } |
| 795 | auto current_datasets = this->GetDataSetIndices(id, /*traverse_subtree=*/false); |
| 796 | std::unordered_set<unsigned int> set(current_datasets.begin(), current_datasets.end()); |
| 797 | bool modified = false; |
| 798 | for (const auto& idx : dataset_indices) |
| 799 | { |
| 800 | if (set.find(idx) == set.end()) |
| 801 | { |
| 802 | set.insert(idx); |
| 803 | auto dsnode = node.append_child(DATASET_NODE_NAME); |
| 804 | dsnode.append_attribute("id") = idx; |
| 805 | modified = true; |
| 806 | } |
| 807 | } |
| 808 | if (modified) |
| 809 | { |
| 810 | this->Modified(); |
| 811 | } |
| 812 | return modified; |
| 813 | } |
| 814 | |
| 815 | //------------------------------------------------------------------------------ |
| 816 | bool vtkDataAssembly::AddDataSetIndexRange(int id, unsigned int index_start, int count) |