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

Method RecursivelyProcessTree

IO/XML/vtkXMLPHyperTreeGridReader.cxx:542–578  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

540
541//------------------------------------------------------------------------------
542void vtkXMLPHyperTreeGridReader::RecursivelyProcessTree(
543 vtkHyperTreeGridNonOrientedCursor* inCursor, vtkHyperTreeGridNonOrientedCursor* outCursor)
544{
545 // Retrieve input grid
546 vtkHyperTreeGrid* input = inCursor->GetGrid();
547
548 // Descend further into input trees only if cursor is not at leaf
549 if (!inCursor->IsLeaf())
550 {
551 // Cursor is not at leaf, subdivide output tree one level further
552 // PKF outTree->SubdivideLeaf( outCursor );
553 outCursor->SubdivideLeaf();
554
555 // If input cursor is neither at leaf nor at maximum depth, recurse to all children
556 int numChildren = input->GetNumberOfChildren();
557 for (int child = 0; child < numChildren; ++child)
558 {
559 // Create child cursor from parent in input grid
560 // PKF vtkHyperTreeGridCursor* childCursor = inCursor->Clone();
561 vtkHyperTreeGridNonOrientedCursor* childCursor = inCursor->Clone();
562 childCursor->ToChild(child);
563
564 // Descend into child in output grid as well
565 outCursor->ToChild(child);
566
567 // Recurse and keep track of whether some children are kept
568 this->RecursivelyProcessTree(childCursor, outCursor);
569
570 // Return to parent in output grid
571 outCursor->ToParent();
572
573 // Clean up
574 childCursor->Delete();
575 childCursor = nullptr;
576 }
577 }
578}
579VTK_ABI_NAMESPACE_END

Callers 1

ReadPieceDataMethod · 0.95

Calls 8

DeleteMethod · 0.65
GetGridMethod · 0.45
IsLeafMethod · 0.45
SubdivideLeafMethod · 0.45
GetNumberOfChildrenMethod · 0.45
CloneMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected