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

Method CopySubTree

Filters/Extraction/vtkExtractBlock.cxx:69–95  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

67
68//------------------------------------------------------------------------------
69void vtkExtractBlock::CopySubTree(vtkDataObjectTreeIterator* loc, vtkDataObjectTree* output,
70 vtkDataObjectTree* input, vtkSet& activeIndices)
71{
72 vtkDataObject* inputNode = input->GetDataSet(loc);
73 if (auto cinput = vtkDataObjectTree::SafeDownCast(inputNode))
74 {
75 auto coutput = vtkDataObjectTree::SafeDownCast(output->GetDataSet(loc));
76 auto iter = cinput->NewIterator();
77 for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
78 {
79 auto curNode = iter->GetCurrentDataObject();
80 auto clone = curNode->NewInstance();
81 clone->ShallowCopy(curNode);
82 coutput->SetDataSet(iter, clone);
83 clone->FastDelete();
84 activeIndices.erase(loc->GetCurrentFlatIndex() + iter->GetCurrentFlatIndex());
85 }
86 iter->Delete();
87 }
88 else if (inputNode)
89 {
90 vtkDataObject* clone = inputNode->NewInstance();
91 clone->ShallowCopy(inputNode);
92 output->SetDataSet(loc, clone);
93 clone->FastDelete();
94 }
95}
96
97//------------------------------------------------------------------------------
98int vtkExtractBlock::RequestData(vtkInformation* vtkNotUsed(request),

Callers 1

RequestDataMethod · 0.95

Calls 13

FastDeleteMethod · 0.80
GetCurrentFlatIndexMethod · 0.80
DeleteMethod · 0.65
GetDataSetMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetCurrentDataObjectMethod · 0.45
NewInstanceMethod · 0.45
ShallowCopyMethod · 0.45
SetDataSetMethod · 0.45

Tested by

no test coverage detected