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

Method Inverse

Common/Transforms/vtkAbstractTransform.cxx:627–658  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

625
626//------------------------------------------------------------------------------
627void vtkTransformConcatenation::Inverse()
628{
629 // invert the matrices
630 if (this->PreMatrix)
631 {
632 this->PreMatrix->Invert();
633 this->PreMatrixTransform->Modified();
634 int i = (this->InverseFlag ? this->NumberOfTransforms - 1 : 0);
635 this->TransformList[i].SwapForwardInverse();
636 }
637
638 if (this->PostMatrix)
639 {
640 this->PostMatrix->Invert();
641 this->PostMatrixTransform->Modified();
642 int i = (this->InverseFlag ? 0 : this->NumberOfTransforms - 1);
643 this->TransformList[i].SwapForwardInverse();
644 }
645
646 // swap the pre- and post-matrices
647 vtkMatrix4x4* tmp = this->PreMatrix;
648 vtkAbstractTransform* tmp2 = this->PreMatrixTransform;
649 this->PreMatrix = this->PostMatrix;
650 this->PreMatrixTransform = this->PostMatrixTransform;
651 this->PostMatrix = tmp;
652 this->PostMatrixTransform = tmp2;
653
654 // what used to be pre-transforms are now post-transforms
655 this->NumberOfPreTransforms = this->NumberOfTransforms - this->NumberOfPreTransforms;
656
657 this->InverseFlag = !this->InverseFlag;
658}
659
660//------------------------------------------------------------------------------
661void vtkTransformConcatenation::Identity()

Callers 1

UpdateMethod · 0.45

Calls 3

SwapForwardInverseMethod · 0.80
InvertMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected