Computer Assited Medical Intervention Tool Kit  version 5.0
GeometricObject.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 
26 
27 #ifndef GEOMETRIC_OBJECT_H
28 #define GEOMETRIC_OBJECT_H
29 
30 // -- Core stuff
31 #include "CamiTKAPI.h"
32 
33 // -- vtk stuff
34 #include <vtkSmartPointer.h>
35 
36 // -- vtk stuff Classes
37 class vtkPolyDataAlgorithm;
38 class vtkActor;
39 class vtkPolyDataMapper;
40 
41 namespace camitk {
55 public:
56 
58  enum Geometry {
60  SPHERE
61  };
62 
64  enum Direction {
65  X,
66  Y,
67  Z,
68  USER_DEFINED
69  };
70 
75 
80  GeometricObject(Geometry, const double, const double, const double);
81 
87 
92  GeometricObject(Geometry, float boundingBox[6]);
93 
95  virtual ~GeometricObject();
96 
98  vtkSmartPointer<vtkActor> getActor();
99 
101  void setPosition(const double, const double, const double);
102 
104  void setDirection(const double, const double, const double);
105 
107  void setColor(const double, const double, const double);
108 
113  void setSize(const double);
114 
116  Geometry getType() const;
117 
118 private:
119 
121  float bounds[6];
122 
125 
127  vtkSmartPointer<vtkActor> myActor;
128 
130  vtkSmartPointer<vtkPolyDataMapper> myMapper;
131 
133  vtkSmartPointer<vtkPolyDataAlgorithm> mySource;
134 
137 
139  void init();
140 
142  void defaultValues();
143 };
144 
146  return myType;
147 }
148 
149 }
150 
151 #endif
152 
camitk::GeometricObject::myType
Geometry myType
the geometric type
Definition: GeometricObject.h:136
camitk::GeometricObject::Y
@ Y
the object in the Y direction, size = 0.1
Definition: GeometricObject.h:66
camitk::GeometricObject::Geometry
Geometry
the geometric type
Definition: GeometricObject.h:58
camitk::Geometry
A 3D representation of a vtkPointSet to be displayed in a InteractiveViewer, this class implements th...
Definition: Geometry.h:126
CamiTKAPI.h
camitk::GeometricObject
A geometric object allows one to create geometric object (sphere, arrow, ...) that can be added direc...
Definition: GeometricObject.h:54
camitk::GeometricObject::ARROW
@ ARROW
an arrow
Definition: GeometricObject.h:59
Direction
Class that defines the direction of the Load with x, y and z.
Definition: Direction.h:39
camitk::GeometricObject::GeometricObject
GeometricObject(Geometry)
constructor by default of a geometric object of type given in parameters.
Definition: GeometricObject.cpp:78
camitk::GeometricObject::X
@ X
the object in the X direction, size = 0.1
Definition: GeometricObject.h:65
camitk::GeometricObject::myMapper
vtkSmartPointer< vtkPolyDataMapper > myMapper
the mapper
Definition: GeometricObject.h:130
camitk::GeometricObject::myActor
vtkSmartPointer< vtkActor > myActor
the actor
Definition: GeometricObject.h:127
camitk::GeometricObject::myDirection
Direction myDirection
Direction of the geometric object (sometimes has no particular meaning, e.g. for a sphere)
Definition: GeometricObject.h:124
camitk::GeometricObject::getType
Geometry getType() const
return the type
Definition: GeometricObject.h:145
camitk::GeometricObject::mySource
vtkSmartPointer< vtkPolyDataAlgorithm > mySource
the creator of the geometry
Definition: GeometricObject.h:133
GeometricObject.h
camitk::GeometricObject::Z
@ Z
the object in the Z direction, size = 0.1
Definition: GeometricObject.h:67
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:49
camitk
Definition: Action.cpp:35