X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FTransformer.cxx;h=e6e6c8b5ce8091c40d034173498d26ec8165a762;hb=bb6bffc75df349b5f74f4197206718a87b42e4a7;hp=8c34e09933102e2fc91fe74560ab54d84326fd10;hpb=ee36cca663d9492ba5582b3621c696db9fb2d803;p=creaRigidRegistration.git diff --git a/lib/Transformer.cxx b/lib/Transformer.cxx index 8c34e09..e6e6c8b 100644 --- a/lib/Transformer.cxx +++ b/lib/Transformer.cxx @@ -15,10 +15,9 @@ Transformer::Transformer() //If the transform already exists, we delete it before we create a new transform //and set the matrix with the identity matrix _transform= vtkTransform::New(); - vtkMatrix4x4 *_matrix = vtkMatrix4x4::New(); + _matrix = vtkMatrix4x4::New(); _matrix->Identity(); - _transform->SetMatrix(_matrix); - + _transform->SetMatrix(_matrix); } /* @@ -28,6 +27,7 @@ Transformer::~Transformer() { //We delete the existing transform if (_transform != NULL ) { _transform->Delete(); } + if (_matrix != NULL ) { _matrix->Delete(); } } /* @@ -96,8 +96,8 @@ void Transformer::Run() _transform->Identity(); _transform->Translate(_centerPoint[0], _centerPoint[1], _centerPoint[2]); - _transform->Scale(_scaleX, _scaleY,_scaleZ); _transform->RotateWXYZ(_angle, 0, 0, 1); - + _transform->Scale(_scaleX, _scaleY,_scaleZ); + _transform->Update(); }