Computer Assited Medical Intervention Tool Kit  version 3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
InterfaceGeometry.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2013 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 #ifndef INTERFACEGEOMETRY_H
27 #define INTERFACEGEOMETRY_H
28 
29 // -- vtk stuff
30 #include <vtkType.h>
31 #include <vtkSmartPointer.h>
32 
33 // -- vtk stuff classes
34 class vtkPointSet;
35 class vtkTexture;
36 class vtkActor;
37 class vtkProp;
38 class vtkDataArray;
39 class vtkAlgorithm;
40 class vtkAlgorithmOutput;
41 
42 
43 namespace camitk
44 {
58 
59  public:
62  None = 0x0,
63  Surface = 0x1,
64  Wireframe = 0x2,
65  Points = 0x4
66  };
67  Q_DECLARE_FLAGS(RenderingModes, RenderingMode)
68 
69 
70  enum EnhancedMode {
71  Normal = 0x0,
72  Hidden = 0x1,
73  Shaded = 0x2,
74  Highlighted = 0x4
75  };
76  Q_DECLARE_FLAGS(EnhancedModes, EnhancedMode)
77 
78 
79  enum GlyphType {
80  NoGlyph = 0x0,
81  Sphere = 0x1
82  };
83  Q_DECLARE_FLAGS(GlyphTypes, GlyphType)
84 
85 
86  virtual ~InterfaceGeometry() {};
87 
89  virtual const QString getLabel() const = 0;
90 
92  virtual void setLabel(QString newName) = 0;
93 
97  virtual vtkSmartPointer<vtkPointSet> getPointSet() = 0;
98 
105  virtual void setPointSet(vtkSmartPointer<vtkPointSet>) = 0;
106 
108  virtual void setPointData(vtkSmartPointer<vtkDataArray>) = 0;
109 
126  virtual vtkSmartPointer<vtkAlgorithmOutput> getDataPort() const = 0;
127 
146  virtual void setDataConnection(vtkSmartPointer<vtkAlgorithmOutput>) = 0;
147 
149  virtual vtkSmartPointer<vtkActor> getActor(const RenderingModes) = 0;
150 
152  virtual vtkSmartPointer<vtkProp> getProp(const QString &) = 0;
153 
155  virtual unsigned int getNumberOfProp() const = 0;
156 
158  virtual vtkSmartPointer<vtkProp> getProp(unsigned int) = 0;
159 
163  virtual bool removeProp(const QString &) = 0;
164 
168  virtual bool addProp(const QString &, vtkSmartPointer<vtkProp>) = 0;
169 
171  virtual void setTexture(vtkSmartPointer<vtkTexture>) = 0;
172 
185  virtual void pointPicked(vtkIdType pointId, bool pickingIsSelecting) = 0;
186 
198  virtual void cellPicked(vtkIdType cellId, bool pickingIsSelecting) = 0;
200 
204  virtual void getBounds(double bounds[6]) = 0;
205 
207  virtual double getBoundingRadius() = 0;
208 
210  virtual void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z) = 0;
211 
213 
217  virtual void setRenderingModes(const RenderingModes) = 0;
218 
220  virtual const RenderingModes getRenderingModes() const = 0;
221 
223  virtual void setEnhancedModes(const EnhancedModes) = 0;
224 
226  virtual const EnhancedModes getEnhancedModes() const = 0;
227 
229  virtual void setActorColor(const RenderingModes, double [4]) = 0;
230 
232  virtual void setActorColor(const RenderingModes, const double, const double, const double) = 0;
233 
235  virtual void getActorColor(const RenderingModes, double [4]) = 0;
236 
238  virtual void setColor(const double, const double, const double) = 0;
239 
241  virtual void setColor(const double, const double, const double, const double) = 0;
242 
244  virtual void setActorOpacity(const RenderingModes, const double) = 0;
245 
247  virtual double getActorOpacity(const RenderingModes) const = 0;
248 
250  virtual void setOpacity(const double) = 0;
251 
262  virtual void setGlyphType(const GlyphTypes type, const double size=0.0) = 0;
263 
265  virtual void setLinesAsTubes(bool) = 0;
266 
268 };
269 
270 
271 }
272 
273 // declare the | aka OR operators
274 Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::RenderingModes)
275 Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::GlyphTypes)
276 Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::EnhancedModes)
277 
278 
279 #endif
virtual void setTexture(vtkSmartPointer< vtkTexture >)=0
Set a texture to this object.
virtual void setRenderingModes(const RenderingModes)=0
virtual void setPointSet(vtkSmartPointer< vtkPointSet >)=0
set the low-level data set.
virtual void getBounds(double bounds[6])=0
there are no glyph type attached to the geometry
Definition: InterfaceGeometry.h:80
no rendering mode, the InterfaceGeometry is not visible
Definition: InterfaceGeometry.h:62
virtual void getActorColor(const RenderingModes, double[4])=0
Get the color of given representation modes in the second parameter, i.e. double[4] (r...
virtual void setActorOpacity(const RenderingModes, const double)=0
Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified!
virtual void setOpacity(const double)=0
Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified! ...
virtual void pointPicked(vtkIdType pointId, bool pickingIsSelecting)=0
This method is called when a vtkPoint included in the vtk representation was picked.
virtual void setPointData(vtkSmartPointer< vtkDataArray >)=0
set the point data (may contains a lookup table).
virtual void cellPicked(vtkIdType cellId, bool pickingIsSelecting)=0
This method is called when a vtkCell included in the vtk representation was picked.
virtual void setColor(const double, const double, const double)=0
Set an (r,g,b) color to all representation modes, without changing the opacity.
virtual const EnhancedModes getEnhancedModes() const =0
get the current enhanced mode
virtual const QString getLabel() const =0
get the string used to display the label
virtual vtkSmartPointer< vtkAlgorithmOutput > getDataPort() const =0
get the custom algorithm pipeline input.
virtual void setLinesAsTubes(bool)=0
set the lines as tubes (works only for vtkDataSet representation that contains lines) ...
the object is hidden
Definition: InterfaceGeometry.h:72
virtual void setLabel(QString newName)=0
set the string used to display the label
virtual bool removeProp(const QString &)=0
remove a given additional prop.
the surface is visible
Definition: InterfaceGeometry.h:63
virtual void setActorColor(const RenderingModes, double[4])=0
Set the color of given representation modes.
virtual vtkSmartPointer< vtkProp > getProp(const QString &)=0
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
virtual const RenderingModes getRenderingModes() const =0
Return if the actor associated to a rendering mode is currently visible or not.
virtual double getBoundingRadius()=0
compute the object&#39;s bounding sphere radius
virtual unsigned int getNumberOfProp() const =0
return the number of additional prop
virtual void setEnhancedModes(const EnhancedModes)=0
set the enhanced mode
GlyphType
(and QFlags GlyphTypes) is the type of glyph attached to the geometry representation ...
Definition: InterfaceGeometry.h:79
the object is shaded
Definition: InterfaceGeometry.h:73
virtual vtkSmartPointer< vtkPointSet > getPointSet()=0
EnhancedMode
(and QFlags EnhancedModes) handle the way the rendering actors will be enhanced or not (from complete...
Definition: InterfaceGeometry.h:70
virtual vtkSmartPointer< vtkActor > getActor(const RenderingModes)=0
Return the actor for the representation mode, NULL if the actor doesn&#39;t exist.
virtual void setDataConnection(vtkSmartPointer< vtkAlgorithmOutput >)=0
Set/reset the connection for the InterfaceGeometry internal algorithm.
This class describes what are the methods to implement for a Geometry (rendering parameters, input/output, filters, picking parameters...)
Definition: InterfaceGeometry.h:57
RenderingMode
(and QFlags RenderingModes) handle actor rendering options (render this InterfaceGeometry as a surfac...
Definition: InterfaceGeometry.h:61
virtual void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z)=0
set a given point position
virtual double getActorOpacity(const RenderingModes) const =0
Return the opacity of a given renderng mode.
the object is highlighted
Definition: InterfaceGeometry.h:74
the glyph is a nice sphere
Definition: InterfaceGeometry.h:81
virtual void setGlyphType(const GlyphTypes type, const double size=0.0)=0
Set the glyph type (a glyph is a geometric representation attached to every point in the input datase...
the object is normally displayed
Definition: InterfaceGeometry.h:71
the wireframe is visible
Definition: InterfaceGeometry.h:64
the points are visible
Definition: InterfaceGeometry.h:65
virtual bool addProp(const QString &, vtkSmartPointer< vtkProp >)=0
insert an additional prop, defining it by its name (default visibility = false).