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

Method CheckItemAndLoopIfNeeded

Common/DataModel/vtkUniformGridAMRIterator.cxx:127–158  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

125
126//----------------------------------------------------------------
127void vtkUniformGridAMRIterator::CheckItemAndLoopIfNeeded()
128{
129 // Nothing to do if this is the end
130 while (!this->IsDoneWithTraversal())
131 {
132 vtkDataObject* dObj = this->GetCurrentDataObject();
133 if (!dObj && this->GetSkipEmptyNodes())
134 {
135 // If we skip empty nodes, go to next
136 this->CurrentIndex++;
137 this->NextInternal();
138 }
139 else
140 {
141 if (vtkDataObjectTreeIterator::IsDataObjectTree(dObj))
142 {
143 // If we reach the child AMR, go up one level
144 this->CurrentLevel++;
145 this->CurrentIndex = 0;
146 this->NextInternal();
147
148 // This is important because we should not count the vtkPartitionedDataSet when iterating
149 this->CurrentFlatIndex--;
150 }
151 else
152 {
153 // We reached a valid item
154 break;
155 }
156 }
157 }
158}
159
160VTK_ABI_NAMESPACE_END

Callers 2

GoToFirstItemMethod · 0.95
GoToNextItemMethod · 0.95

Calls 3

IsDoneWithTraversalMethod · 0.45
GetCurrentDataObjectMethod · 0.45
NextInternalMethod · 0.45

Tested by

no test coverage detected