Computer Assited Medical Intervention Tool Kit  version 5.0
PlaneC.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 #ifndef PLANE_C_H
26 #define PLANE_C_H
27 
28 // -- VTK stuff
29 #include <vtkSmartPointer.h>
30 
31 // -- VTK stuff classes
32 class vtkPlaneSource;
33 class vtkPolyDataMapper;
34 class vtkActor;
35 class vtkProperty;
36 
37 
38 namespace camitk {
51 class PlaneC {
52 public:
54  enum PlaneCType {
62  };
64  PlaneC();
66  ~PlaneC();
67 
73  void init(PlaneCType type, double* bounds);
75  void setVisuPlane();
77  void setVisuActivePlane();
79  void setVisuActivePlaneOff();
81  void clear();
83  void translatePlaneX();
85  void translatePlaneY();
87  void translatePlaneZ();
89  void rotationAxe1();
91  void rotationAxe2();
93  vtkSmartPointer<vtkActor> getActor();
94 
96  void setTransfoPercentToRealValue(double* tab, double, double);
98  void setTranslationMaxInPercent(double);
100  void getTransformationInPercent(double*, double*, double*);
102  void setOrigin(double, double, double);
106  void setXAxisPoint(double, double, double);
110  void setYAxisPoint(double, double, double);
112  void getOrigin(double* tab);
114  void getNormal(double* tab);
115 
116 
117 
118 private:
119  vtkSmartPointer<vtkPlaneSource> plane;
120  vtkSmartPointer<vtkPolyDataMapper> planeMapper;
121  vtkSmartPointer<vtkActor> planeActor;
122  vtkSmartPointer<vtkProperty> aProp;
123 
125  double transformation[3];
127  double translation;
129  double angle1;
130  double angle2;
131  double translation1;
132 };
133 
134 }
135 
136 #endif
camitk::PlaneC::setVisuActivePlaneOff
void setVisuActivePlaneOff()
Visualization of the plane in blue tone.
Definition: PlaneC.cpp:123
camitk::PlaneC::Y_MIN
@ Y_MIN
the plane's normal is in Y direction, the plane is at the min y
Definition: PlaneC.h:56
camitk::PlaneC::planeActor
vtkSmartPointer< vtkActor > planeActor
Definition: PlaneC.h:121
camitk::PlaneC::translatePlaneX
void translatePlaneX()
Translate the plane on XAxis.
Definition: PlaneC.cpp:202
camitk::PlaneC::setVisuActivePlane
void setVisuActivePlane()
Visualization of the plane in red tone.
Definition: PlaneC.cpp:112
camitk::PlaneC::~PlaneC
~PlaneC()
Destructor.
Definition: PlaneC.cpp:93
camitk::PlaneC::getTransformationInPercent
void getTransformationInPercent(double *, double *, double *)
get the transformation (translation, rot1 and rot2) in percentage
Definition: PlaneC.cpp:358
camitk::PlaneC::clear
void clear()
Delete the plane from the View.
Definition: PlaneC.cpp:135
camitk::PlaneC::getNormal
void getNormal(double *tab)
get the normal of the plane
Definition: PlaneC.cpp:377
a
#define a
camitk::PlaneC::setOrigin
void setOrigin(double, double, double)
Initilize the origin of the plane.
Definition: PlaneC.cpp:382
camitk::PlaneC::angle2
double angle2
Definition: PlaneC.h:130
camitk::PlaneC::PlaneCType
PlaneCType
a planeC could represent a plane of a bounding box
Definition: PlaneC.h:54
camitk::PlaneC::getActor
vtkSmartPointer< vtkActor > getActor()
get the actor of the plane
Definition: PlaneC.cpp:151
camitk::PlaneC::setVisuPlane
void setVisuPlane()
Visualization of the plane in wireframe.
Definition: PlaneC.cpp:99
camitk::PlaneC::getOrigin
void getOrigin(double *tab)
get the origin of the plane
Definition: PlaneC.cpp:371
camitk::PlaneC::angle1
double angle1
difference between current and initial position
Definition: PlaneC.h:129
camitk::PlaneC::Z_MIN
@ Z_MIN
the plane's normal is in Z direction, the plane is at the min z
Definition: PlaneC.h:57
camitk::PlaneC::setTranslationMaxInPercent
void setTranslationMaxInPercent(double)
set the translation value of the plane max to 100%
Definition: PlaneC.cpp:365
camitk::PlaneC::X_MAX
@ X_MAX
the plane's normal is in X direction, the plane is at the max x
Definition: PlaneC.h:58
camitk::PlaneC::setYAxisPoint
void setYAxisPoint(double, double, double)
The local y-axis vector will be set to (PointY - Origin) .
Definition: PlaneC.cpp:394
camitk::PlaneC::plane
vtkSmartPointer< vtkPlaneSource > plane
Definition: PlaneC.h:119
camitk::PlaneC::rotationAxe1
void rotationAxe1()
Rotate the plane around Axe1.
Definition: PlaneC.cpp:257
camitk::PlaneC::X_MIN
@ X_MIN
the plane's normal is in X direction, the plane is at the min x
Definition: PlaneC.h:55
camitk::PlaneC::PlaneC
PlaneC()
Constructor by default.
Definition: PlaneC.cpp:71
camitk::PlaneC::Y_MAX
@ Y_MAX
the plane's normal is in Y direction, the plane is at the max y
Definition: PlaneC.h:59
camitk::PlaneC::translatePlaneY
void translatePlaneY()
Translate the plane on YAxis.
Definition: PlaneC.cpp:220
camitk::PlaneC::rotationAxe2
void rotationAxe2()
Rotate the plane around Axe2.
Definition: PlaneC.cpp:304
camitk::PlaneC::planeMapper
vtkSmartPointer< vtkPolyDataMapper > planeMapper
Definition: PlaneC.h:120
camitk::PlaneC::aProp
vtkSmartPointer< vtkProperty > aProp
Definition: PlaneC.h:122
camitk::PlaneC::setTransfoPercentToRealValue
void setTransfoPercentToRealValue(double *tab, double, double)
set the transformation (translation, rot1 and rot2)and convert percentage to real value
Definition: PlaneC.cpp:350
camitk::PlaneC::Z_MAX
@ Z_MAX
the plane's normal is in Z direction, the plane is at the max z
Definition: PlaneC.h:60
camitk::PlaneC::transformation
double transformation[3]
store the transformation
Definition: PlaneC.h:125
camitk::PlaneC::UNDEFINED
@ UNDEFINED
the plane's normal is not defined yet
Definition: PlaneC.h:61
camitk::PlaneC::translatePlaneZ
void translatePlaneZ()
Translate the plane on ZAxis.
Definition: PlaneC.cpp:238
camitk::PlaneC::init
void init(PlaneCType type, double *bounds)
Initialize the plane at a particular place of a bounding box.
Definition: PlaneC.cpp:156
camitk::PlaneC::translation1
double translation1
Definition: PlaneC.h:131
camitk::PlaneC::translation
double translation
store the translation in percentage
Definition: PlaneC.h:127
camitk::PlaneC
This class allows you to transform a plane(translation,rotation around an axis) and visualize it.
Definition: PlaneC.h:51
camitk::PlaneC::setXAxisPoint
void setXAxisPoint(double, double, double)
The local x-axis vector will be set to (PointX - Origin) .
Definition: PlaneC.cpp:388
camitk
Definition: Action.cpp:35
PlaneC.h