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

Method RecursivelyProcessTreeDual

Filters/HyperTree/vtkHyperTreeGridPlaneCutter.cxx:573–729  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

571
572//------------------------------------------------------------------------------
573void vtkHyperTreeGridPlaneCutter::RecursivelyProcessTreeDual(
574 vtkHyperTreeGridNonOrientedMooreSuperCursor* cursor)
575{
576 // If cursor is at a masked cell stop recursion
577 vtkIdType id = cursor->GetGlobalNodeIndex();
578 if (this->InMask && this->InMask->GetValue(id))
579 {
580 return;
581 }
582
583 // Descend further into input trees only if cursor is not a leaf
584 if (!cursor->IsLeaf())
585 {
586 // Check if cursor is at selected cell
587 if (!this->SelectedCells->GetTuple1(id))
588 {
589 // Cell is not selected until proven otherwise
590 bool selected = false;
591
592 // Iterate over all cursors of Von Neumann neighborhood around center
593 for (unsigned int neighbor = 0; neighbor < 26 && !selected; ++neighbor)
594 {
595 // Retrieve global index of neighbor
596 unsigned int indN = MooreCursors3D[neighbor];
597 if (cursor->HasTree(indN))
598 {
599 vtkIdType idN = cursor->GetGlobalNodeIndex(indN);
600
601 // Decide whether neighbor was selected
602 selected = (this->SelectedCells->GetTuple1(idN) != 0.0);
603 }
604 else
605 {
606 selected = false;
607 }
608 } // neighbor
609
610 // No dual cell with a corner at cursor center will be intersected
611 if (!selected)
612 {
613 return;
614 }
615 } // if ( this->SelectedCells->GetTuple1( id ) )
616
617 // Recurse to all children
618 int numChildren = cursor->GetNumberOfChildren();
619 for (int ichild = 0; ichild < numChildren; ++ichild)
620 {
621 if (this->CheckAbort())
622 {
623 break;
624 }
625 cursor->ToChild(ichild);
626 // Recurse
627 this->RecursivelyProcessTreeDual(cursor);
628 cursor->ToParent();
629 } // ichild
630 } // if ( ! cursor->IsLeaf() )

Callers 1

ProcessTreesMethod · 0.95

Calls 15

GetTuple1Method · 0.80
CheckAbortMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetGlobalNodeIndexMethod · 0.45
GetValueMethod · 0.45
IsLeafMethod · 0.45
HasTreeMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45
GetCornerCursorsMethod · 0.45

Tested by

no test coverage detected