1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
27 #include "figureCuttingModel.h"
29 //----------------------------------------------------------------------------
30 //----------------------------------------------------------------------------
31 //----------------------------------------------------------------------------
32 figureCuttingModel::figureCuttingModel()
34 _inversModel = vtkTransform::New();
35 _matrixModel = vtkTransform::New();
36 _matrixVisual = vtkTransform::New();
42 //----------------------------------------------------------------------------
43 figureCuttingModel::~figureCuttingModel() // virtual
45 _inversModel->Delete();
47 //----------------------------------------------------------------------------
48 void figureCuttingModel::SetPosition(double x,double y, double z)
54 //----------------------------------------------------------------------------
55 void figureCuttingModel::SetScale(double sx,double sy, double sz)
61 //----------------------------------------------------------------------------
62 void figureCuttingModel::SetRotation(double alfa,double beta, double teta)
69 //----------------------------------------------------------------------------
70 void figureCuttingModel::CalculeMatrix()
72 _matrixModel->Identity();
73 _matrixModel->Translate(_px,_py,_pz);
74 _matrixModel->RotateY(_beta);
75 _matrixModel->RotateX(_alfa);
76 _matrixModel->RotateY(_teta);
77 _matrixModel->Scale(_sx,_sy,_sz);
79 _matrixVisual->Identity();
80 _matrixVisual->Translate( _px*_spcX , _py*_spcY , _pz*_spcZ );
81 _matrixVisual->RotateY(_beta);
82 _matrixVisual->RotateX(_alfa);
83 _matrixVisual->RotateY(_teta);
84 _matrixVisual->Scale( _sx*_spcX , _sy*_spcY , _sz*_spcZ );
89 //----------------------------------------------------------------------------
90 void figureCuttingModel::CalculeInversMatrix()
92 _inversModel->Identity ();
93 _inversModel->Concatenate ( _matrixModel );
94 _inversModel->Inverse();
96 //----------------------------------------------------------------------------
97 bool figureCuttingModel::IfPointInside(double x, double y, double z) // virtual
102 //----------------------------------------------------------------------------
103 vtkTransform *figureCuttingModel::GetVtkTransform()
105 return _matrixVisual;
108 //----------------------------------------------------------------------------
109 //void figureCuttingModel::SetVtkTransform(vtkTransform *matrix)
111 // _matrixModel = matrix;
114 //----------------------------------------------------------------------------
115 double figureCuttingModel::GetTheoricVolume() // virtual
120 //----------------------------------------------------------------------------
121 double figureCuttingModel::GetPositionX()
125 //----------------------------------------------------------------------------
126 double figureCuttingModel::GetPositionY()
130 //----------------------------------------------------------------------------
131 double figureCuttingModel::GetPositionZ()
135 //----------------------------------------------------------------------------
136 double figureCuttingModel::GetScaleX()
140 //----------------------------------------------------------------------------
141 double figureCuttingModel::GetScaleY()
145 //----------------------------------------------------------------------------
146 double figureCuttingModel::GetScaleZ()
150 //----------------------------------------------------------------------------
151 double figureCuttingModel::GetAngleAlfa()
155 //----------------------------------------------------------------------------
156 double figureCuttingModel::GetAngleBeta()
160 //----------------------------------------------------------------------------
161 double figureCuttingModel::GetAngleTeta()
165 //----------------------------------------------------------------------------
166 const char *figureCuttingModel::GetName() // virtual
171 //----------------------------------------------------------------------------
172 void figureCuttingModel::SetSpacing(double spcX,double spcY, double spcZ)