------------------------------------------------------------------------------
| 494 | |
| 495 | //------------------------------------------------------------------------------ |
| 496 | void 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 | //------------------------------------------------------------------------------ |
| 540 | void CopyRotatedDataHTG(vtkHyperTree* input, vtkHyperTree* output, vtkHyperTreeGrid* inputHTG, |
no test coverage detected