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

Method RecursivelyProcessTree3D

Filters/Hybrid/vtkAdaptiveDataSetSurfaceFilter.cxx:513–558  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

511
512//------------------------------------------------------------------------------
513void vtkAdaptiveDataSetSurfaceFilter::RecursivelyProcessTree3D(
514 vtkHyperTreeGridNonOrientedVonNeumannSuperCursorLight* cursor, int level)
515{
516 double* origin = cursor->GetOrigin();
517
518 std::array<std::array<double, 3>, 8> corners = { {
519 { { origin[0], origin[1], origin[2] } },
520 { { origin[0], origin[1], origin[2] + cursor->GetSize()[2] } },
521 { { origin[0] + cursor->GetSize()[0], origin[1], origin[2] } },
522 { { origin[0] + cursor->GetSize()[0], origin[1], origin[2] + cursor->GetSize()[2] } },
523 { { origin[0], origin[1] + cursor->GetSize()[1], origin[2] } },
524 { { origin[0], origin[1] + cursor->GetSize()[1], origin[2] + cursor->GetSize()[2] } },
525 { { origin[0] + cursor->GetSize()[0], origin[1] + cursor->GetSize()[1], origin[2] } },
526 { { origin[0] + cursor->GetSize()[0], origin[1] + cursor->GetSize()[1],
527 origin[2] + cursor->GetSize()[2] } },
528 } };
529
530 ShapeState shapeState = this->IsShapeVisible<8>(corners, level);
531 if (shapeState == ShapeState::OUT_OF_SCREEN)
532 {
533 return;
534 }
535
536 // Create geometry output if cursor is at leaf
537 if (cursor->IsLeaf() || shapeState == ShapeState::SUB_PIXEL ||
538 (this->Mask && this->Mask->GetValue(cursor->GetGlobalNodeIndex())) ||
539 (this->FixedLevelMax != -1 && level >= this->FixedLevelMax))
540 {
541 this->ProcessLeaf3D(cursor);
542 }
543 else
544 {
545 // Cursor is not at leaf, recurse to all children
546 int numChildren = cursor->GetNumberOfChildren();
547 for (int iChild = 0; iChild < numChildren; ++iChild)
548 {
549 if (this->CheckAbort())
550 {
551 break;
552 }
553 cursor->ToChild(iChild);
554 this->RecursivelyProcessTree3D(cursor, level + 1);
555 cursor->ToParent();
556 }
557 }
558}
559
560//------------------------------------------------------------------------------
561void vtkAdaptiveDataSetSurfaceFilter::ProcessLeaf3D(

Callers 1

ProcessTreesMethod · 0.95

Calls 10

ProcessLeaf3DMethod · 0.95
CheckAbortMethod · 0.80
GetOriginMethod · 0.45
GetSizeMethod · 0.45
IsLeafMethod · 0.45
GetValueMethod · 0.45
GetGlobalNodeIndexMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected