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

Method CopyAndRotate

Filters/General/vtkAxisAlignedTransformFilter.cxx:458–493  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

456
457//------------------------------------------------------------------------------
458void vtkAxisAlignedTransformFilter::CopyAndRotate(vtkHyperTree* input, vtkHyperTree* output,
459 vtkIdType inputIndex, vtkIdType outputIndex, const std::vector<unsigned int>& permutation,
460 unsigned int depth, vtkHyperTreeGridNonOrientedCursor* cursor)
461{
462 if (cursor->IsLeaf() || cursor->IsMasked())
463 {
464 if (!cursor->IsRoot())
465 {
466 cursor->ToParent();
467 }
468 return;
469 }
470
471 output->SubdivideLeaf(outputIndex, depth);
472
473 vtkIdType inputBase = input->GetElderChildIndex(inputIndex);
474 vtkIdType outputBase = output->GetElderChildIndex(outputIndex);
475
476 size_t nChildren = permutation.size();
477
478 // For each child index in the output, determine the corresponding
479 // child in the input using the permutation vector
480 for (size_t i = 0; i < nChildren; ++i)
481 {
482 vtkIdType inputChildIndex = inputBase + permutation[i];
483 vtkIdType outputChildIndex = outputBase + i;
484
485 cursor->ToChild(permutation[i]);
486 this->CopyAndRotate(
487 input, output, inputChildIndex, outputChildIndex, permutation, depth + 1, cursor);
488 }
489 if (!cursor->IsRoot())
490 {
491 cursor->ToParent();
492 }
493}
494
495//------------------------------------------------------------------------------
496void ApplyMask(vtkHyperTree* input, vtkHyperTree* output, vtkIdType inputIndex,

Callers 1

Calls 8

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

Tested by

no test coverage detected