2 #include "CutModelFigure.h"
4 //----------------------------------------------------------------------------
5 //----------------------------------------------------------------------------
6 //----------------------------------------------------------------------------
7 CutModelFigure::CutModelFigure()
9 _inversModel = vtkTransform::New();
10 _matrixModel = vtkTransform::New();
11 _matrixVisual = vtkTransform::New();
17 //----------------------------------------------------------------------------
18 CutModelFigure::~CutModelFigure() // virtual
20 _inversModel->Delete();
22 //----------------------------------------------------------------------------
23 void CutModelFigure::SetPosition(double x,double y, double z)
29 //----------------------------------------------------------------------------
30 void CutModelFigure::SetScale(double sx,double sy, double sz)
36 //----------------------------------------------------------------------------
37 void CutModelFigure::SetRotation(double alfa,double beta, double teta)
44 //----------------------------------------------------------------------------
45 void CutModelFigure::CalculeMatrix()
47 _matrixModel->Identity();
48 _matrixModel->Translate(_px,_py,_pz);
49 _matrixModel->RotateY(_beta);
50 _matrixModel->RotateX(_alfa);
51 _matrixModel->RotateY(_teta);
52 _matrixModel->Scale(_sx,_sy,_sz);
54 _matrixVisual->Identity();
55 _matrixVisual->Translate( _px*_spcX , _py*_spcY , _pz*_spcZ );
56 _matrixVisual->RotateY(_beta);
57 _matrixVisual->RotateX(_alfa);
58 _matrixVisual->RotateY(_teta);
59 _matrixVisual->Scale( _sx*_spcX , _sy*_spcY , _sz*_spcZ );
64 //----------------------------------------------------------------------------
65 void CutModelFigure::CalculeInversMatrix()
67 _inversModel->Identity ();
68 _inversModel->Concatenate ( _matrixModel );
69 _inversModel->Inverse();
71 //----------------------------------------------------------------------------
72 bool CutModelFigure::IfPointInside(double x, double y, double z) // virtual
77 //----------------------------------------------------------------------------
78 vtkTransform *CutModelFigure::GetVtkTransform()
83 //----------------------------------------------------------------------------
84 //void CutModelFigure::SetVtkTransform(vtkTransform *matrix)
86 // _matrixModel = matrix;
89 //----------------------------------------------------------------------------
90 double CutModelFigure::GetTheoricVolume() // virtual
95 //----------------------------------------------------------------------------
96 double CutModelFigure::GetPositionX()
100 //----------------------------------------------------------------------------
101 double CutModelFigure::GetPositionY()
105 //----------------------------------------------------------------------------
106 double CutModelFigure::GetPositionZ()
110 //----------------------------------------------------------------------------
111 double CutModelFigure::GetScaleX()
115 //----------------------------------------------------------------------------
116 double CutModelFigure::GetScaleY()
120 //----------------------------------------------------------------------------
121 double CutModelFigure::GetScaleZ()
125 //----------------------------------------------------------------------------
126 double CutModelFigure::GetAngleAlfa()
130 //----------------------------------------------------------------------------
131 double CutModelFigure::GetAngleBeta()
135 //----------------------------------------------------------------------------
136 double CutModelFigure::GetAngleTeta()
140 //----------------------------------------------------------------------------
141 char *CutModelFigure::GetName() // virtual
146 //----------------------------------------------------------------------------
147 void CutModelFigure::SetSpacing(double spcX,double spcY, double spcZ)