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

Method AddDataSetIndex

Common/DataModel/vtkDataAssembly.cxx:764–784  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

762
763//------------------------------------------------------------------------------
764bool vtkDataAssembly::AddDataSetIndex(int id, unsigned int dataset_index)
765{
766 auto& internals = (*this->Internals);
767 auto node = internals.FindNode(id);
768 if (!node)
769 {
770 return false;
771 }
772 auto current_datasets = this->GetDataSetIndices(id, /*traverse_subtree=*/false);
773 if (std::find(current_datasets.begin(), current_datasets.end(), dataset_index) !=
774 current_datasets.end())
775 {
776 // already present, no need to add again.
777 return true;
778 }
779
780 auto dsnode = node.append_child(DATASET_NODE_NAME);
781 dsnode.append_attribute("id") = dataset_index;
782 this->Modified();
783 return true;
784}
785
786//------------------------------------------------------------------------------
787bool vtkDataAssembly::AddDataSetIndices(int id, const std::vector<unsigned int>& dataset_indices)

Callers 15

VisitMethod · 0.80
VisitMethod · 0.80
VisitMethod · 0.80
VisitMethod · 0.80
VisitMethod · 0.80
RequestDataMethod · 0.80
ProcessElementFunction · 0.80
BuildAssemblyMethod · 0.80
GenerateOutputMethod · 0.80
AppendMeshsMethod · 0.80
RequestDataMethod · 0.80

Calls 8

GetDataSetIndicesMethod · 0.95
FindNodeMethod · 0.80
append_childMethod · 0.80
append_attributeMethod · 0.80
findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
ModifiedMethod · 0.45

Tested by 5

TestAssemblyFunction · 0.64
VisitMethod · 0.64
VisitMethod · 0.64
RequestDataPDCMethod · 0.64