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

Method RecursivelyProcessTree

Filters/HyperTree/vtkHyperTreeGridAxisClip.cxx:440–493  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

438
439//------------------------------------------------------------------------------
440void vtkHyperTreeGridAxisClip::RecursivelyProcessTree(
441 vtkHyperTreeGridNonOrientedGeometryCursor* inCursor, vtkHyperTreeGridNonOrientedCursor* outCursor)
442{
443 // Retrieve global index of input cursor
444 vtkIdType inId = inCursor->GetGlobalNodeIndex();
445
446 // Increase index count on output: postfix is intended
447 vtkIdType outId = this->CurrentId++;
448
449 // Retrieve output tree and set global index of output cursor
450 outCursor->SetGlobalIndexFromLocal(outId);
451
452 // Copy output cell data from that of input cell
453 this->OutData->CopyData(this->InData, inId, outId);
454
455 // Flag to keep track of whether current input cell is clipped out
456 bool clipped = this->IsClipped(inCursor);
457
458 // Descend further into input trees only if cursor is neither a leaf, clipped out or masked
459 if (!inCursor->IsLeaf() && !clipped && !inCursor->IsMasked())
460 {
461 // Cursor is not at leaf, subdivide output tree one level further
462 outCursor->SubdivideLeaf();
463
464 // Initialize output children index
465 int outChild = 0;
466
467 // If cursor is not at leaf, recurse to all children
468 int numChildren = inCursor->GetNumberOfChildren();
469 for (int inChild = 0; inChild < numChildren; ++inChild, ++outChild)
470 {
471 if (this->CheckAbort())
472 {
473 break;
474 }
475 inCursor->ToChild(inChild);
476 // Child is not clipped out, descend into current child
477 outCursor->ToChild(outChild);
478 // Recurse
479 this->RecursivelyProcessTree(inCursor, outCursor);
480 // Return to parent
481 outCursor->ToParent();
482 inCursor->ToParent();
483 } // inChild
484 } // if (! cursor->IsLeaf() && ! clipped)
485 else if (!clipped && this->InMask && this->InMask->GetValue(inId))
486 {
487 // Handle case of not clipped but nonetheless masked leaf cells
488 clipped = true;
489 } // else
490
491 // Mask output cell if necessary
492 this->OutMask->InsertTuple1(outId, clipped);
493}
494VTK_ABI_NAMESPACE_END

Callers 1

ProcessTreesMethod · 0.95

Calls 13

IsClippedMethod · 0.95
CheckAbortMethod · 0.80
InsertTuple1Method · 0.80
GetGlobalNodeIndexMethod · 0.45
CopyDataMethod · 0.45
IsLeafMethod · 0.45
IsMaskedMethod · 0.45
SubdivideLeafMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected