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

Function ApplyMask

Filters/General/vtkAxisAlignedTransformFilter.cxx:496–537  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

494
495//------------------------------------------------------------------------------
496void ApplyMask(vtkHyperTree* input, vtkHyperTree* output, vtkIdType inputIndex,
497 vtkIdType outputIndex, const std::vector<unsigned int>& permutation,
498 vtkHyperTreeGridNonOrientedCursor* cursorInput, vtkHyperTreeGridNonOrientedCursor* cursorOutput)
499{
500 auto returnRecursion = [cursorInput, cursorOutput]()
501 {
502 if (!cursorInput->IsRoot())
503 {
504 cursorInput->ToParent();
505 cursorOutput->ToParent();
506 }
507 };
508
509 if (cursorInput->IsMasked())
510 {
511 cursorOutput->SetMask(true);
512 returnRecursion();
513 return;
514 }
515
516 if (cursorInput->IsLeaf())
517 {
518 returnRecursion();
519 return;
520 }
521
522 vtkIdType inputBase = input->GetElderChildIndex(inputIndex);
523 vtkIdType outputBase = output->GetElderChildIndex(outputIndex);
524
525 size_t nChildren = permutation.size();
526 for (size_t i = 0; i < nChildren; ++i)
527 {
528 vtkIdType inputChildIndex = inputBase + permutation[i];
529 vtkIdType outputChildIndex = outputBase + i;
530 cursorInput->ToChild(permutation[i]);
531 cursorOutput->ToChild(static_cast<unsigned char>(i));
532
533 ApplyMask(
534 input, output, inputChildIndex, outputChildIndex, permutation, cursorInput, cursorOutput);
535 }
536 returnRecursion();
537}
538
539//------------------------------------------------------------------------------
540void CopyRotatedDataHTG(vtkHyperTree* input, vtkHyperTree* output, vtkHyperTreeGrid* inputHTG,

Callers 1

ProcessHTGMethod · 0.85

Calls 8

GetElderChildIndexMethod · 0.80
IsRootMethod · 0.45
ToParentMethod · 0.45
IsMaskedMethod · 0.45
SetMaskMethod · 0.45
IsLeafMethod · 0.45
sizeMethod · 0.45
ToChildMethod · 0.45

Tested by

no test coverage detected