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

Method RecursivelyProcessTree

Filters/HyperTree/vtkHyperTreeGridCellCenters.cxx:207–254  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

205
206//------------------------------------------------------------------------------
207void vtkHyperTreeGridCellCenters::RecursivelyProcessTree(
208 vtkHyperTreeGridNonOrientedGeometryCursor* cursor)
209{
210 // Skip masked cells
211 if (cursor->IsMasked())
212 {
213 return;
214 }
215
216 // Create cell center if cursor is at leaf
217 if (cursor->IsLeaf())
218 {
219 // Cursor is at leaf, retrieve its global index
220 vtkIdType id = cursor->GetGlobalNodeIndex();
221
222 // If leaf is masked, skip it
223 if (this->InMask && this->InMask->GetValue(id))
224 {
225 return;
226 }
227
228 // Retrieve cell center coordinates
229 double pt[3];
230 cursor->GetPoint(pt);
231
232 // Insert next point
233 vtkIdType outId = this->Points->InsertNextPoint(pt);
234
235 // Copy cell center data from leaf data, when needed
236 this->OutData->CopyData(this->InData, id, outId);
237 }
238 else
239 {
240 // Cursor is not at leaf, recurse to all children
241 int numChildren = this->Input->GetNumberOfChildren();
242 for (int child = 0; child < numChildren; ++child)
243 {
244 if (this->CheckAbort())
245 {
246 break;
247 }
248 cursor->ToChild(child);
249 // Recurse
250 this->RecursivelyProcessTree(cursor);
251 cursor->ToParent();
252 } // child
253 } // else
254}
255VTK_ABI_NAMESPACE_END

Callers 1

ProcessTreesMethod · 0.95

Calls 11

CheckAbortMethod · 0.80
IsMaskedMethod · 0.45
IsLeafMethod · 0.45
GetGlobalNodeIndexMethod · 0.45
GetValueMethod · 0.45
GetPointMethod · 0.45
InsertNextPointMethod · 0.45
CopyDataMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected