+++ /dev/null
-
-#include "sourceTransformer.h"
-#include "vtkMatrix4x4.h"
-
-/*
- CONSTRUCTOR: Initializes the two points with empty vectors, the angle in 0.
-*/
-Transformer::Transformer()
-{
- std::vector<int> empty (3,0);
- _angle= 0;
- _centerPoint=empty;
- _scaleX=1;
- _scaleY=1;
- //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->Identity();
- _transform->SetMatrix(_matrix);
-
-}
-
-/*
- DESTRUCTOR
-*/
-Transformer::~Transformer()
-{
- //We delete the existing transform
- if (_transform != NULL ) { _transform->Delete(); }
-}
-
-/*
- SETS A NEW TRANSFORM
-*/
-void Transformer::SetTransform(vtkTransform *transform)
-{
- _transform=transform;
-}
-
-/*
- SETS CENTER POINT
-*/
-void Transformer::SetCenterPoint(std::vector<int> point)
-{
- _centerPoint=point;
-}
-
-/*
- SETS THE ANGLE
-*/
-void Transformer::SetAngle(double angle)
-{
- _angle=angle;
-}
-
-/*
- SETS THE X SCALE
-*/
-void Transformer::SetScaleX(double scaleX)
-{
- _scaleX=scaleX/100.0;
-}
-
-/*
- SETS THE Y SCALE
-*/
-void Transformer::SetScaleY(double scaleY)
-{
- _scaleY=scaleY/100.0;
-}
-
-/*
- SETS THE Y SCALE
- */
-void Transformer::SetScaleZ(double scaleZ)
-{
- _scaleZ=scaleZ/100.0;
-}
-
-
-
-/*
- GETS THE RESULTANT TRANSFORM
-*/
-vtkTransform *Transformer::GetResult()
-{
- return _transform;
-}
-
-/*
- MAKES THE TRANSFORMATIONS
-*/
-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->Update();
-}
+++ /dev/null
-
-#ifndef _$PROJECT_NAME$SOURCE01_H_
-#define _$PROJECT_NAME$SOURCE01_H_
-
-#include "vtkTransform.h"
-#include <vector>
-
-class Transformer{
-public:
- Transformer();
- ~Transformer();
- void SetTransform(vtkTransform *transform);
- void SetCenterPoint(std::vector<int> point);
- void SetAngle(double angle);
- void SetScaleX(double scaleX);
- void SetScaleY(double scaleY);
- void SetScaleZ(double scaleZ);
- void Run();
- vtkTransform *GetResult();
-private:
- std::vector<int> _centerPoint;
- double _angle;
- double _scaleX;
- double _scaleY;
- double _scaleZ;
- //vtkImageData *_image;
- vtkTransform *_transform;
-};
-
-#endif