------------------------------------------------------------------------------
| 540 | |
| 541 | //------------------------------------------------------------------------------ |
| 542 | void 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 | } |
| 579 | VTK_ABI_NAMESPACE_END |
no test coverage detected