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

Method AddDataSetIndices

Common/DataModel/vtkDataAssembly.cxx:787–813  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

785
786//------------------------------------------------------------------------------
787bool 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//------------------------------------------------------------------------------
816bool vtkDataAssembly::AddDataSetIndexRange(int id, unsigned int index_start, int count)

Callers 4

AddDataSetIndexRangeMethod · 0.95
TestDataAssemblyFunction · 0.80
TestPDCFunction · 0.80

Calls 9

GetDataSetIndicesMethod · 0.95
FindNodeMethod · 0.80
append_childMethod · 0.80
append_attributeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
insertMethod · 0.45
ModifiedMethod · 0.45

Tested by 2

TestDataAssemblyFunction · 0.64
TestPDCFunction · 0.64