X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaRigidRegistration.git;a=blobdiff_plain;f=lib%2FTransformer3D.cxx;h=f948f7ddf94392c185a2fa4b5170c4255ddeeca8;hp=b107bb39b1dd375d8b3f47fa5670cfca179c3fcc;hb=7051738fb1c92724bd6d15907edc4d517527a3b2;hpb=877893bd98980a3d730fd9a65f8c65a21f56c14a diff --git a/lib/Transformer3D.cxx b/lib/Transformer3D.cxx index b107bb3..f948f7d 100644 --- a/lib/Transformer3D.cxx +++ b/lib/Transformer3D.cxx @@ -121,6 +121,14 @@ void Transformer3D::SetSecondAngle(double angle) } +void Transformer3D::SetScale(double scale) +{ + _scale=scale; +} + + + + /* GETS THE RESULTANT TRANSFORM */ @@ -135,14 +143,9 @@ vtkTransform *Transformer3D::GetResult() vtkTransform *Transformer3D::GetFirstResult() { _transform->Identity(); - _transform->Translate(-_firstPoint[0], -_firstPoint[1], -_firstPoint[2]); - _transform->RotateWXYZ(_angle, _rotationAxis[0], _rotationAxis[1], _rotationAxis[2]); - _transform->Translate(_secondPoint[0], _secondPoint[1], _secondPoint[2]); - - _transform->Update(); return _transform; } @@ -154,20 +157,17 @@ void Transformer3D::Run() { //Cleans the transformation matrix _transform->Identity(); - //Make all transformations in postmultiply mode _transform->PostMultiply(); - //Acomodate in 0,0,0 according to the first point of the second vector _transform->Translate(-_secondPoint[0], -_secondPoint[1], -_secondPoint[2]); - _transform->RotateWXYZ(_angle, _rotationAxis[0], _rotationAxis[1], _rotationAxis[2]); - _transform->RotateWXYZ(_secondAngle, _secondRotationAxis[0], _secondRotationAxis[1], _secondRotationAxis[2]); - +printf("EED Transformer3D::Run %f %f\n", _angle, _secondAngle); + _transform->Scale(_scale,_scale,_scale); //Acommodate according to the first point of the first vector _transform->Translate(_firstPoint[0], _firstPoint[1], _firstPoint[2]); - _transform->Inverse(); _transform->Update(); } +