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

Method GetTree

Common/DataModel/vtkHyperTreeGrid.cxx:1013–1043  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1011
1012//------------------------------------------------------------------------------
1013vtkHyperTree* vtkHyperTreeGrid::GetTree(vtkIdType index, bool create)
1014{
1015 assert("pre: not_tree" && index < this->GetMaxNumberOfTrees());
1016
1017 // Wrap convenience macro for outside use
1018 vtkHyperTree* tree = GetHyperTreeFromThisMacro(index);
1019
1020 // Create a new cursor if only required to do so
1021 if (create && !tree)
1022 {
1023 tree = vtkHyperTree::New();
1024 if (!tree->Initialize(this->BranchFactor, this->Dimension))
1025 {
1026 vtkGenericWarningMacro("Failed to create hyper tree.");
1027 return nullptr;
1028 }
1029 tree->SetTreeIndex(index);
1030 this->HyperTrees[index] = tree;
1031 tree->Delete();
1032
1033 if (!tree->HasScales())
1034 {
1035 double origin[3];
1036 double scale[3];
1037 this->GetLevelZeroOriginAndSizeFromIndex(tree->GetTreeIndex(), origin, scale);
1038 tree->SetScales(std::make_shared<vtkHyperTreeGridScales>(this->BranchFactor, scale));
1039 }
1040 }
1041
1042 return tree;
1043}
1044
1045//------------------------------------------------------------------------------
1046void vtkHyperTreeGrid::SetTree(vtkIdType index, vtkHyperTree* tree)

Callers 15

InitializeMethod · 0.45
InitializeMethod · 0.45
GetCornerCursorsMethod · 0.45
SearchMethod · 0.45
InitializeMethod · 0.45
GetCornerCursorsMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
GetCornerCursorsMethod · 0.45

Calls 6

GetMaxNumberOfTreesMethod · 0.95
DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
InitializeMethod · 0.45

Tested by

no test coverage detected