Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
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
42 {
56  public:
57 
59  enum Geometry {
61  SPHERE
62  };
63 
65  enum Direction {
66  X,
67  Y,
68  Z,
69  USER_DEFINED
70  };
71 
76 
81  GeometricObject(Geometry, const double, const double, const double);
82 
88 
93  GeometricObject(Geometry, float boundingBox[6]);
94 
96  virtual ~GeometricObject();
97 
99  vtkSmartPointer<vtkActor> getActor();
100 
102  void setPosition(const double, const double, const double);
103 
105  void setDirection(const double, const double, const double);
106 
108  void setColor(const double, const double, const double);
109 
114  void setSize(const double);
115 
117  Geometry getType() const;
118 
119  private:
120 
122  float bounds[6];
123 
126 
128  vtkSmartPointer<vtkActor> myActor;
129 
131  vtkSmartPointer<vtkPolyDataMapper> myMapper;
132 
134  vtkSmartPointer<vtkPolyDataAlgorithm> mySource;
135 
138 
140  virtual void init();
141 
143  void defaultValues();
144 };
145 
147  return myType;
148 }
149 
150 }
151 
152 #endif
153 
Geometry myType
the geometric type
Definition: GeometricObject.h:137
the object in the X direction, size = 0.1
Definition: GeometricObject.h:66
A geometric object allows to create geometric object (sphere, arrow, ...) that can be added directly ...
Definition: GeometricObject.h:55
vtkSmartPointer< vtkPolyDataAlgorithm > mySource
the creator of the geometry
Definition: GeometricObject.h:134
vtkSmartPointer< vtkActor > myActor
the actor
Definition: GeometricObject.h:128
#define CAMITK_API
Definition: CamiTKAPI.h:49
Class that defines the direction of the Load with x, y and z.
Definition: Direction.h:39
an arrow
Definition: GeometricObject.h:60
vtkSmartPointer< vtkPolyDataMapper > myMapper
the mapper
Definition: GeometricObject.h:131
the object in the Z direction, size = 0.1
Definition: GeometricObject.h:68
the object in the Y direction, size = 0.1
Definition: GeometricObject.h:67
A 3D representation of a vtkPointSet to be displayed in a InteractiveViewer, this class implements th...
Definition: Geometry.h:126
Geometry
the geometric type
Definition: GeometricObject.h:59
Geometry getType() const
return the type
Definition: GeometricObject.h:146
Direction myDirection
Direction of the geometric object (sometimes has no particular meaning, e.g. for a sphere) ...
Definition: GeometricObject.h:125