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

Method GetTree

Common/DataModel/vtkUniformHyperTreeGrid.cxx:52–78  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

50
51//------------------------------------------------------------------------------
52vtkHyperTree* vtkUniformHyperTreeGrid::GetTree(vtkIdType index, bool create)
53{
54 // Wrap convenience macro for outside use
55 vtkHyperTree* tree = GetHyperTreeFromThisMacro(index);
56
57 // Create a new cursor if only required to do so
58 if (create && !tree)
59 {
60 tree = vtkHyperTree::New();
61 tree->Initialize(this->BranchFactor, this->Dimension);
62 tree->SetTreeIndex(index);
63 this->HyperTrees[index] = tree;
64 tree->Delete();
65
66 if (!tree->HasScales())
67 {
68 if (!this->Scales)
69 {
70 this->Scales =
71 std::make_shared<vtkHyperTreeGridScales>(this->BranchFactor, this->GridScale);
72 }
73 tree->SetScales(this->Scales);
74 }
75 }
76
77 return tree;
78}
79
80//------------------------------------------------------------------------------
81void vtkUniformHyperTreeGrid::PrintSelf(ostream& os, vtkIndent indent)

Callers

nothing calls this directly

Calls 3

DeleteMethod · 0.65
NewFunction · 0.50
InitializeMethod · 0.45

Tested by

no test coverage detected