]> Creatis software - creaRigidRegistration.git/blobdiff - lib/Transformer.cxx
Added template methods
[creaRigidRegistration.git] / lib / Transformer.cxx
index de53958696118363be844d93da39017921e52f88..e6e6c8b5ce8091c40d034173498d26ec8165a762 100644 (file)
@@ -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(); }
 }
 
 /*
@@ -95,7 +95,9 @@ 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();
 }