camitk.Transformation¶
- class camitk.Transformation¶
Transformation represents a geometrical transformation between two FrameOfReferences
It supports linear and non-linear transforms stored in a vtkTransform (linear) or any vtkAbstractTransform (non-linear)
It has a direction (from a FrameOfReference to another FrameOfReference)
Its constructor is private as Transformation objects must only be created through TransformationManager::getTransformationManager() (although it is possible to instantiate your own TransformationManager if you know what you’re doing!)
Transformation are instantiated/stored/managed/destroyed by TransformationManager::getTransformationManager(), therefore you should not keep a pointer to any Transformation, just call TransformationManager::getTransformationOwnership(..) when you need to access it. This guarantees the coherence of the complete reference system and avoid dangling pointers and memory leaks.
{.cpp} ... FrameOfReference* from = TransformationManager::addFrameOfReference("Source Frame"); FrameOfReference* to = TransformationManager::addFrameOfReference("Destination Frame"); Transformation* t = TransformationManager::addTransformation(from, to); ... t->setMatrix(...); note: t MUST not be a member call TransformationManager::getTransformationOwnership(from, to) to access it later on
See also
TransformationManager
- __init__(*args, **kwargs)¶
Methods
__init__(*args, **kwargs)getFrom(self)Get the FrameOfReference the Transformation starts from (origin)
getName(self)Get the name of the Transformation
getTo(self)Get the FrameOfReference that the Transformation goes to (destination)
getTransform(self)Get the internal vtkTransform (linear transformation) or a nullptr