Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
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-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, 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
34class vtkPointSet;
35class vtkTexture;
36class vtkActor;
37class vtkProp;
38class vtkDataArray;
39class vtkAlgorithm;
40class vtkAlgorithmOutput;
41class vtkTransform;
42
43
44namespace camitk {
62
63public:
66 None = 0x0,
67 Surface = 0x1,
68 Wireframe = 0x2,
69 Points = 0x4
70 };
71 Q_DECLARE_FLAGS(RenderingModes, RenderingMode)
72
73
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
95 virtual vtkSmartPointer<vtkPointSet> getPointSet() = 0;
96
103 virtual void setPointSet(vtkSmartPointer<vtkPointSet>) = 0;
104
106 virtual void setPointData(vtkSmartPointer<vtkDataArray>) = 0;
107
109 virtual void setMeshWorldTransform(vtkSmartPointer<vtkTransform>) = 0;
110
111
128 virtual vtkSmartPointer<vtkAlgorithmOutput> getDataPort() const = 0;
129
148 virtual void setDataConnection(vtkSmartPointer<vtkAlgorithmOutput>) = 0;
149
151 virtual void setTexture(vtkSmartPointer<vtkTexture>) = 0;
152
165 virtual void pointPicked(vtkIdType pointId, bool pickingIsSelecting) = 0;
166
178 virtual void cellPicked(vtkIdType cellId, bool pickingIsSelecting) = 0;
179
181 virtual vtkSmartPointer<vtkActor> getActor(const RenderingModes) = 0;
183
193
195 virtual vtkSmartPointer<vtkProp> getProp(const QString&) = 0;
196
198 virtual unsigned int getNumberOfProp() const = 0;
199
201 virtual vtkSmartPointer<vtkProp> getProp(unsigned int) = 0;
202
206 virtual bool removeProp(const QString&) = 0;
207
211 virtual bool addProp(const QString&, vtkSmartPointer<vtkProp>) = 0;
212
215 virtual void updateLabel(const QString& label) = 0;
216
218
221
225 virtual void getBounds(double* bounds) = 0;
226
228 virtual double getBoundingRadius() = 0;
229
231 virtual void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z) = 0;
232
234
238 virtual void setRenderingModes(const RenderingModes) = 0;
239
241 virtual const RenderingModes getRenderingModes() const = 0;
242
244 virtual void setEnhancedModes(const EnhancedModes) = 0;
245
247 virtual const EnhancedModes getEnhancedModes() const = 0;
248
252 virtual void setActorColor(const RenderingModes, double* color) = 0;
253
255 virtual void setActorColor(const RenderingModes, const double, const double, const double) = 0;
256
261 virtual void getActorColor(const RenderingModes mode, double* color, bool ignoreEnhancedModes = false) const = 0;
262
264 virtual void setColor(const double, const double, const double) = 0;
265
267 virtual void setColor(const double, const double, const double, const double) = 0;
268
270 virtual void setActorOpacity(const RenderingModes, const double) = 0;
271
273 virtual double getActorOpacity(const RenderingModes) const = 0;
274
276 virtual void setOpacity(const double) = 0;
277
279 virtual void setMapperScalarRange(double min, double max) = 0;
280
291 virtual void setGlyphType(const GlyphTypes type, const double size = 0.0) = 0;
292
299 virtual void setLinesAsTubes(bool isTubes = true, bool radiusFromLength = true, double radiusFactor = 1.0 / 40.0, int numberOfSides = 5) = 0;
300
301 virtual void setColorMode(int vtkColorMode = VTK_COLOR_MODE_DEFAULT) = 0;
302
304};
305
306
307}
308
309// declare the | aka OR operators
310Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::RenderingModes)
311Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::GlyphTypes)
312Q_DECLARE_OPERATORS_FOR_FLAGS(camitk::InterfaceGeometry::EnhancedModes)
313
314
315#endif
Handle rendering options (surface and wireframe) of an Object3D.
Definition RenderingMode.h:37
This class describes what are the methods to implement for a Geometry (rendering parameters,...
Definition InterfaceGeometry.h:61
virtual vtkSmartPointer< vtkPointSet > getPointSet()=0
virtual void setTexture(vtkSmartPointer< vtkTexture >)=0
Set a texture to this object.
virtual unsigned int getNumberOfProp() const =0
return the number of additional prop
virtual void pointPicked(vtkIdType pointId, bool pickingIsSelecting)=0
This method is called when a vtkPoint included in the vtk representation was picked.
virtual void setEnhancedModes(const EnhancedModes)=0
set the enhanced mode
virtual void setOpacity(const double)=0
Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified!
virtual void cellPicked(vtkIdType cellId, bool pickingIsSelecting)=0
This method is called when a vtkCell included in the vtk representation was picked.
virtual void setActorOpacity(const RenderingModes, const double)=0
Set the opacity of this representation modes. WARNING color field (surfaceColor, ....
virtual double getActorOpacity(const RenderingModes) const =0
Return the opacity of a given renderng mode.
virtual vtkSmartPointer< vtkActor > getActor(const RenderingModes)=0
Return the actor for the representation mode, nullptr if the actor doesn't exist.
virtual void setRenderingModes(const RenderingModes)=0
virtual bool addProp(const QString &, vtkSmartPointer< vtkProp >)=0
insert an additional prop, defining it by its name (default visibility = false).
GlyphType
(and QFlags GlyphTypes) is the type of glyph attached to the geometry representation
Definition InterfaceGeometry.h:83
@ NoGlyph
there are no glyph type attached to the geometry
Definition InterfaceGeometry.h:84
@ Sphere
the glyph is a nice sphere
Definition InterfaceGeometry.h:85
virtual void setColorMode(int vtkColorMode=VTK_COLOR_MODE_DEFAULT)=0
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...
virtual void setMeshWorldTransform(vtkSmartPointer< vtkTransform >)=0
set the transformation for 3D representation
virtual double getBoundingRadius()=0
compute the object's bounding sphere radius
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 vtkSmartPointer< vtkAlgorithmOutput > getDataPort() const =0
get the custom algorithm pipeline input.
EnhancedMode
(and QFlags EnhancedModes) handle the way the rendering actors will be enhanced or not (from complete...
Definition InterfaceGeometry.h:74
@ Hidden
the object is hidden
Definition InterfaceGeometry.h:76
@ Highlighted
the object is highlighted
Definition InterfaceGeometry.h:78
@ Normal
the object is normally displayed
Definition InterfaceGeometry.h:75
@ Shaded
the object is shaded
Definition InterfaceGeometry.h:77
virtual void getBounds(double *bounds)=0
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax]
virtual void getActorColor(const RenderingModes mode, double *color, bool ignoreEnhancedModes=false) const =0
Get the color of given representation modes in the second parameter.
@ None
no rendering mode, the InterfaceGeometry is not visible
Definition InterfaceGeometry.h:66
@ Surface
the surface is visible
Definition InterfaceGeometry.h:67
@ Wireframe
the wireframe is visible
Definition InterfaceGeometry.h:68
@ Points
the points are visible
Definition InterfaceGeometry.h:69
virtual void setLinesAsTubes(bool isTubes=true, bool radiusFromLength=true, double radiusFactor=1.0/40.0, int numberOfSides=5)=0
Set the lines as tubes (works only for vtkDataSet representation that contains lines)
virtual void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z)=0
set a given point position
virtual void setDataConnection(vtkSmartPointer< vtkAlgorithmOutput >)=0
Set/reset the connection for the InterfaceGeometry internal algorithm.
virtual vtkSmartPointer< vtkProp > getProp(const QString &)=0
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
virtual void updateLabel(const QString &label)=0
update position and text of the label prop
virtual void setPointData(vtkSmartPointer< vtkDataArray >)=0
set the point data (may contains a lookup table).
virtual void setMapperScalarRange(double min, double max)=0
Set the mapper scalar range.
virtual void setActorColor(const RenderingModes, double *color)=0
Set the color of given representation modes.
virtual void setPointSet(vtkSmartPointer< vtkPointSet >)=0
set the low-level data set.
virtual const RenderingModes getRenderingModes() const =0
Return if the actor associated to a rendering mode is currently visible or not.
virtual bool removeProp(const QString &)=0
remove a given additional prop.
Definition Action.cpp:40