X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FTransformer.cxx;h=ed1b25ba8021c4495a356b11295f03c941ccff9a;hb=86c3482ce714b8d4201c8d819a10b59e4e4440c4;hp=de53958696118363be844d93da39017921e52f88;hpb=caf70b171caba0cb8c1e4c00688b27844f93e31b;p=creaRigidRegistration.git diff --git a/lib/Transformer.cxx b/lib/Transformer.cxx index de53958..ed1b25b 100644 --- a/lib/Transformer.cxx +++ b/lib/Transformer.cxx @@ -46,6 +46,14 @@ void Transformer::SetCenterPoint(std::vector point) _centerPoint=point; } +/* + SETS AXIS POINT +*/ +void Transformer::SetAxis(std::vector axis) +{ + _transformAxis=axis; +} + /* SETS THE ANGLE */ @@ -91,11 +99,19 @@ vtkTransform *Transformer::GetResult() /* MAKES THE TRANSFORMATIONS */ -void Transformer::Run() +void Transformer::Run(bool _3D) { _transform->Identity(); _transform->Translate(_centerPoint[0], _centerPoint[1], _centerPoint[2]); _transform->Scale(_scaleX, _scaleY,_scaleZ); - _transform->RotateWXYZ(_angle, 0, 0, 1); + if(_3D) + { + _transform->RotateWXYZ(_angle, _transformAxis[0], _transformAxis[1], _transformAxis[2]); + } + else + { + _transform->RotateWXYZ(_angle, 0, 0, 1); + } + _transform->Update(); }