Computer Assited Medical Intervention Tool Kit  version 5.0
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-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 #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 class vtkTransform;
42 
43 
44 namespace camitk {
62 
63 public:
66  None = 0x0,
67  Surface = 0x1,
68  Wireframe = 0x2,
69  Points = 0x4
70  };
71  Q_DECLARE_FLAGS(RenderingModes, RenderingMode)
72 
73 
74  enum EnhancedMode {
75  Normal = 0x0,
76  Hidden = 0x1,
77  Shaded = 0x2,
78  Highlighted = 0x4
79  };
80  Q_DECLARE_FLAGS(EnhancedModes, EnhancedMode)
81 
82 
83  enum GlyphType {
84  NoGlyph = 0x0,
85  Sphere = 0x1
86  };
87  Q_DECLARE_FLAGS(GlyphTypes, GlyphType)
88 
89 
90  virtual ~InterfaceGeometry() = default;
91 
93  virtual const QString getLabel() const = 0;
94 
96  virtual void setLabel(QString newName) = 0;
97 
101  virtual vtkSmartPointer<vtkPointSet> getPointSet() = 0;
102 
109  virtual void setPointSet(vtkSmartPointer<vtkPointSet>) = 0;
110 
112  virtual void setPointData(vtkSmartPointer<vtkDataArray>) = 0;
113 
115  virtual void setMeshWorldTransform(vtkSmartPointer<vtkTransform>) = 0;
116 
117 
134  virtual vtkSmartPointer<vtkAlgorithmOutput> getDataPort() const = 0;
135 
154  virtual void setDataConnection(vtkSmartPointer<vtkAlgorithmOutput>) = 0;
155 
157  virtual void setTexture(vtkSmartPointer<vtkTexture>) = 0;
158 
171  virtual void pointPicked(vtkIdType pointId, bool pickingIsSelecting) = 0;
172 
184  virtual void cellPicked(vtkIdType cellId, bool pickingIsSelecting) = 0;
185 
187  virtual vtkSmartPointer<vtkActor> getActor(const RenderingModes) = 0;
189 
199 
201  virtual vtkSmartPointer<vtkProp> getProp(const QString&) = 0;
202 
204  virtual unsigned int getNumberOfProp() const = 0;
205 
207  virtual vtkSmartPointer<vtkProp> getProp(unsigned int) = 0;
208 
212  virtual bool removeProp(const QString&) = 0;
213 
217  virtual bool addProp(const QString&, vtkSmartPointer<vtkProp>) = 0;
218 
220 
223 
227  virtual void getBounds(double* bounds) = 0;
228 
230  virtual double getBoundingRadius() = 0;
231 
233  virtual void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z) = 0;
234 
236 
240  virtual void setRenderingModes(const RenderingModes) = 0;
241 
243  virtual const RenderingModes getRenderingModes() const = 0;
244 
246  virtual void setEnhancedModes(const EnhancedModes) = 0;
247 
249  virtual const EnhancedModes getEnhancedModes() const = 0;
250 
254  virtual void setActorColor(const RenderingModes, double* color) = 0;
255 
257  virtual void setActorColor(const RenderingModes, const double, const double, const double) = 0;
258 
262  virtual void getActorColor(const RenderingModes mode, double* color) = 0;
263 
265  virtual void setColor(const double, const double, const double) = 0;
266 
268  virtual void setColor(const double, const double, const double, const double) = 0;
269 
271  virtual void setActorOpacity(const RenderingModes, const double) = 0;
272 
274  virtual double getActorOpacity(const RenderingModes) const = 0;
275 
277  virtual void setOpacity(const double) = 0;
278 
280  virtual void setMapperScalarRange(double min, double max) = 0;
281 
292  virtual void setGlyphType(const GlyphTypes type, const double size = 0.0) = 0;
293 
295  virtual void setLinesAsTubes(bool) = 0;
296 
298 };
299 
300 
301 }
302 
303 // declare the | aka OR operators
304 Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::RenderingModes)
305 Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::GlyphTypes)
306 Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::EnhancedModes)
307 
308 
309 #endif
camitk::InterfaceGeometry::removeProp
virtual bool removeProp(const QString &)=0
remove a given additional prop.
camitk::InterfaceGeometry::getBoundingRadius
virtual double getBoundingRadius()=0
compute the object's bounding sphere radius
camitk::InterfaceGeometry::Shaded
@ Shaded
the object is shaded
Definition: InterfaceGeometry.h:77
camitk::InterfaceGeometry::setRenderingModes
virtual void setRenderingModes(const RenderingModes)=0
camitk::InterfaceGeometry::Normal
@ Normal
the object is normally displayed
Definition: InterfaceGeometry.h:75
camitk::InterfaceGeometry::getActorColor
virtual void getActorColor(const RenderingModes mode, double *color)=0
Get the color of given representation modes in the second parameter.
camitk::InterfaceGeometry::Surface
@ Surface
the surface is visible
Definition: InterfaceGeometry.h:67
camitk::InterfaceGeometry::addProp
virtual bool addProp(const QString &, vtkSmartPointer< vtkProp >)=0
insert an additional prop, defining it by its name (default visibility = false).
camitk::InterfaceGeometry::GlyphType
GlyphType
Definition: InterfaceGeometry.h:83
RenderingMode
Handle rendering options (surface and wireframe) of an Object3D.
Definition: RenderingMode.h:37
camitk::InterfaceGeometry::setMeshWorldTransform
virtual void setMeshWorldTransform(vtkSmartPointer< vtkTransform >)=0
set the transformation for 3D representation
camitk::InterfaceGeometry::Highlighted
@ Highlighted
the object is highlighted
Definition: InterfaceGeometry.h:78
camitk::InterfaceGeometry::Hidden
@ Hidden
the object is hidden
Definition: InterfaceGeometry.h:76
camitk::InterfaceGeometry::getPointSet
virtual vtkSmartPointer< vtkPointSet > getPointSet()=0
camitk::InterfaceGeometry::pointPicked
virtual void pointPicked(vtkIdType pointId, bool pickingIsSelecting)=0
This method is called when a vtkPoint included in the vtk representation was picked.
camitk::InterfaceGeometry::setActorColor
virtual void setActorColor(const RenderingModes, double *color)=0
Set the color of given representation modes.
camitk::InterfaceGeometry::setActorOpacity
virtual void setActorOpacity(const RenderingModes, const double)=0
Set the opacity of this representation modes. WARNING color field (surfaceColor, ....
camitk::InterfaceGeometry
This class describes what are the methods to implement for a Geometry (rendering parameters,...
Definition: InterfaceGeometry.h:61
camitk::InterfaceGeometry::getBounds
virtual void getBounds(double *bounds)=0
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax]
camitk::InterfaceGeometry::getLabel
virtual const QString getLabel() const =0
get the string used to display the label
camitk::InterfaceGeometry::setColor
virtual void setColor(const double, const double, const double)=0
Set an (r,g,b) color to all representation modes, without changing the opacity.
camitk::InterfaceGeometry::Sphere
@ Sphere
the glyph is a nice sphere
Definition: InterfaceGeometry.h:85
camitk::InterfaceGeometry::setMapperScalarRange
virtual void setMapperScalarRange(double min, double max)=0
Set the mapper scalar range.
camitk::InterfaceGeometry::getRenderingModes
virtual const RenderingModes getRenderingModes() const =0
Return if the actor associated to a rendering mode is currently visible or not.
camitk::InterfaceGeometry::getDataPort
virtual vtkSmartPointer< vtkAlgorithmOutput > getDataPort() const =0
get the custom algorithm pipeline input.
camitk::InterfaceGeometry::setPointData
virtual void setPointData(vtkSmartPointer< vtkDataArray >)=0
set the point data (may contains a lookup table).
camitk::InterfaceGeometry::setOpacity
virtual void setOpacity(const double)=0
Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified!
camitk::InterfaceGeometry::setPointSet
virtual void setPointSet(vtkSmartPointer< vtkPointSet >)=0
set the low-level data set.
camitk::InterfaceGeometry::Points
@ Points
the points are visible
Definition: InterfaceGeometry.h:69
camitk::InterfaceGeometry::getActorOpacity
virtual double getActorOpacity(const RenderingModes) const =0
Return the opacity of a given renderng mode.
camitk::InterfaceGeometry::setGlyphType
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...
camitk::InterfaceGeometry::getNumberOfProp
virtual unsigned int getNumberOfProp() const =0
return the number of additional prop
camitk::InterfaceGeometry::~InterfaceGeometry
virtual ~InterfaceGeometry()=default
empty virtual destructor, to avoid memory leak
camitk::InterfaceGeometry::setLinesAsTubes
virtual void setLinesAsTubes(bool)=0
set the lines as tubes (works only for vtkDataSet representation that contains lines)
camitk::InterfaceGeometry::setLabel
virtual void setLabel(QString newName)=0
set the string used to display the label
camitk::InterfaceGeometry::Wireframe
@ Wireframe
the wireframe is visible
Definition: InterfaceGeometry.h:68
camitk::InterfaceGeometry::None
@ None
no rendering mode, the InterfaceGeometry is not visible
Definition: InterfaceGeometry.h:66
camitk::InterfaceGeometry::getActor
virtual vtkSmartPointer< vtkActor > getActor(const RenderingModes)=0
Return the actor for the representation mode, NULL if the actor doesn't exist.
camitk::InterfaceGeometry::cellPicked
virtual void cellPicked(vtkIdType cellId, bool pickingIsSelecting)=0
This method is called when a vtkCell included in the vtk representation was picked.
camitk::InterfaceGeometry::NoGlyph
@ NoGlyph
there are no glyph type attached to the geometry
Definition: InterfaceGeometry.h:84
camitk::InterfaceGeometry::getProp
virtual vtkSmartPointer< vtkProp > getProp(const QString &)=0
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
camitk::InterfaceGeometry::setPointPosition
virtual void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z)=0
set a given point position
camitk::InterfaceGeometry::setDataConnection
virtual void setDataConnection(vtkSmartPointer< vtkAlgorithmOutput >)=0
Set/reset the connection for the InterfaceGeometry internal algorithm.
camitk::InterfaceGeometry::setEnhancedModes
virtual void setEnhancedModes(const EnhancedModes)=0
set the enhanced mode
camitk::InterfaceGeometry::getEnhancedModes
virtual const EnhancedModes getEnhancedModes() const =0
get the current enhanced mode
camitk::InterfaceGeometry::setTexture
virtual void setTexture(vtkSmartPointer< vtkTexture >)=0
Set a texture to this object.
camitk::InterfaceGeometry::EnhancedMode
EnhancedMode
Definition: InterfaceGeometry.h:74
camitk
Definition: Action.cpp:35