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

Method Initialize

Common/DataModel/vtkTreeDFSIterator.cxx:64–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void vtkTreeDFSIterator::Initialize()
65{
66 if (this->Tree == nullptr)
67 {
68 return;
69 }
70 // Set all colors to white
71 this->Color->SetNumberOfValues(this->Tree->GetNumberOfVertices());
72 for (vtkIdType i = 0; i < this->Tree->GetNumberOfVertices(); i++)
73 {
74 this->Color->SetValue(i, this->WHITE);
75 }
76 if (this->StartVertex < 0)
77 {
78 this->StartVertex = this->Tree->GetRoot();
79 }
80 this->CurRoot = this->StartVertex;
81 while (!this->Internals->Stack.empty())
82 {
83 this->Internals->Stack.pop();
84 }
85
86 // Find the first item
87 if (this->Tree->GetNumberOfVertices() > 0)
88 {
89 this->NextId = this->NextInternal();
90 }
91 else
92 {
93 this->NextId = -1;
94 }
95}
96
97void vtkTreeDFSIterator::SetMode(int mode)
98{

Callers 1

SetModeMethod · 0.95

Calls 7

NextInternalMethod · 0.95
GetNumberOfVerticesMethod · 0.80
popMethod · 0.80
SetNumberOfValuesMethod · 0.45
SetValueMethod · 0.45
GetRootMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected