 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
37 class vtkAlgorithmOutput;
38 class vtkDataSetMapper;
45 class vtkCastToConcrete;
47 class vtkSphereSource;
48 class vtkTransformFilter;
126 class CAMITK_API Geometry :
public InterfaceGeometry {
140 Geometry(QString label, vtkSmartPointer<vtkPointSet> pointSet,
const InterfaceGeometry::RenderingModes mode =
InterfaceGeometry::Surface);
143 ~Geometry()
override;
146 const QString getLabel()
const {
151 void setLabel(QString newName) {
160 vtkSmartPointer<vtkPointSet> getPointSet() {
167 void setPointSet(vtkSmartPointer<vtkPointSet> ds)
override;
170 void setMeshWorldTransform(vtkSmartPointer<vtkTransform>)
override;
173 vtkSmartPointer<vtkAlgorithmOutput> getDataPort()
const {
178 void setDataConnection(vtkSmartPointer<vtkAlgorithmOutput>)
override;
181 void setPointData(vtkSmartPointer<vtkDataArray>)
override;
187 vtkSmartPointer<vtkActor> getActor(
const RenderingModes)
override;
190 vtkSmartPointer<vtkProp> getProp(
const QString&)
override;
193 unsigned int getNumberOfProp()
const override;
196 vtkSmartPointer<vtkProp> getProp(
unsigned int)
override;
201 bool addProp(
const QString&, vtkSmartPointer<vtkProp>)
override;
209 void setTexture(vtkSmartPointer<vtkTexture> texture)
override;
212 void pointPicked(vtkIdType,
bool) {};
215 void cellPicked(vtkIdType,
bool) {};
223 void getBounds(
double* bounds)
override;
226 double getBoundingRadius()
override;
229 void setPointPosition(
const unsigned int orderNumber,
const double x,
const double y,
const double z)
override;
238 void setRenderingModes(
const RenderingModes rMode) {
239 renderingModes = rMode;
243 const RenderingModes getRenderingModes()
const {
244 return renderingModes;
248 void setEnhancedModes(
const EnhancedModes)
override;
251 const EnhancedModes getEnhancedModes()
const {
252 return enhancedModes;
256 void setActorColor(
const RenderingModes,
double*)
override;
259 void setActorColor(
const RenderingModes,
const double,
const double,
const double)
override;
262 void getActorColor(
const RenderingModes,
double*)
override;
265 void setColor(
const double,
const double,
const double)
override;
268 void setColor(
const double,
const double,
const double,
const double)
override;
271 void setActorOpacity(
const RenderingModes,
const double)
override;
274 double getActorOpacity(
const RenderingModes)
const override;
277 void setOpacity(
const double)
override;
280 void setMapperScalarRange(
double min,
double max)
override;
283 void setGlyphType(
const GlyphTypes type,
const double size = 0.0)
override;
286 void setLinesAsTubes(
bool tubes =
false)
override;
295 vtkSmartPointer<vtkPointSet> pointSet;
300 vtkSmartPointer<vtkAlgorithmOutput> dataOutput;
303 vtkSmartPointer<vtkAlgorithmOutput> customPipelineOutput;
306 vtkSmartPointer<vtkCastToConcrete> concreteData;
309 vtkSmartPointer<vtkDataSetMapper> mapper;
312 QMap<QString, vtkSmartPointer<vtkProp> > extraProp;
315 vtkSmartPointer<vtkTextMapper> labelActorMapper;
318 vtkSmartPointer<vtkActor> surfaceActor;
321 vtkSmartPointer<vtkActor> wireframeActor;
324 vtkSmartPointer<vtkActor> pointsActor;
327 vtkSmartPointer<vtkTexture> texture;
330 vtkSmartPointer<vtkTubeFilter> tube;
333 vtkSmartPointer<vtkTransformFilter> worldTransformFilter;
336 vtkSmartPointer<vtkSphereSource> sphereGeom;
342 InterfaceGeometry::RenderingModes renderingModes;
345 InterfaceGeometry::EnhancedModes enhancedModes;
363 void buildGlyph(
const GlyphTypes type);
370 void createPointCloudVisualization();
376 double surfaceColor[4];
378 double wireframeColor[4];
379 double pointsColor[4];
384 double oldAlphaSurface;
385 double oldAlphaWireframe;
386 double oldAlphaPoints;
387 double oldPointsColor[4];
390 vtkSmartPointer< vtkPointSet > New();
vtkSmartPointer< vtkAlgorithmOutput > customPipelineOutput
the external custom pipeline output (equals to dataOuput if no custom pipeline plugged)
Definition: Geometry.h:302
the object is shaded
Definition: InterfaceGeometry.h:76
vtkSmartPointer< vtkDataSetMapper > mapper
the VTK mapper
Definition: Geometry.h:308
vtkSmartPointer< vtkCastToConcrete > concreteData
the filter to convert the DataSet to get a correct vtkPipeline output port
Definition: Geometry.h:305
void setGlyphType(const GlyphTypes type, const double size=0.0) override
set the glyph information
Definition: Geometry.cpp:676
void getBounds(double *bounds) override
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax]
Definition: Geometry.cpp:783
QString label
the label
Definition: Geometry.h:350
the object is normally displayed
Definition: InterfaceGeometry.h:74
double pointsColor[4]
Definition: Geometry.h:378
void setEnhancedModes(const EnhancedModes) override
set the enhanced mode
Definition: Geometry.cpp:701
vtkSmartPointer< vtkActor > wireframeActor
the wireframe actor that manages the representation as wireframe
Definition: Geometry.h:320
vtkSmartPointer< vtkSphereSource > sphereGeom
the sphere glyph
Definition: Geometry.h:335
the surface is visible
Definition: InterfaceGeometry.h:66
void setPointSet(vtkSmartPointer< vtkPointSet > ds) override
set the input data of the Geometry,
Definition: Geometry.cpp:191
double oldAlphaSurface
Definition: Geometry.h:383
vtkSmartPointer< vtkTextMapper > labelActorMapper
the mapper to create the text
Definition: Geometry.h:314
void setActorOpacity(const RenderingModes, const double) override
Set the opacity of this representation modes. WARNING color field (surfaceColor, ....
Definition: Geometry.cpp:602
void updateLabel()
update position and text of the label
Definition: Geometry.cpp:424
void setMapperScalarRange(double min, double max) override
Set the mapper scalar range.
Definition: Geometry.cpp:660
vtkSmartPointer< vtkTexture > texture
texture of this object.
Definition: Geometry.h:326
vtkSmartPointer< vtkAlgorithmOutput > dataOutput
to be able to set external custom pipeline
Definition: Geometry.h:299
void setTexture(vtkSmartPointer< vtkTexture > texture) override
Set a texture to this object.
Definition: Geometry.cpp:665
void setPointData(vtkSmartPointer< vtkDataArray >) override
set the point data (may contains a lookup table)
Definition: Geometry.cpp:810
void setLinesAsTubes(bool tubes=false) override
display lines as tubes (depeding of the boolean) (only work if the Geometry was defined using a vtkPo...
Definition: Geometry.cpp:758
the object is highlighted
Definition: InterfaceGeometry.h:77
vtkSmartPointer< vtkActor > getActor(const RenderingModes) override
Return the actor representing this representation mode (return NULL if hightlight mode is Hidden).
Definition: Geometry.cpp:265
the object is hidden
Definition: InterfaceGeometry.h:75
vtkSmartPointer< vtkProp > getProp(const QString &) override
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
Definition: Geometry.cpp:463
double oldAlphaPoints
Definition: Geometry.h:385
void setColor(const double, const double, const double) override
Set an (r,g,b) color to all representation modes, without changing the opacity.
Definition: Geometry.cpp:586
double alphaShaded
Opacity value when this object must be shaded.
Definition: Geometry.h:347
void setDataConnection(vtkSmartPointer< vtkAlgorithmOutput >) override
call this method with the custom algorithm pipeline output
Definition: Geometry.cpp:246
vtkSmartPointer< vtkPointSet > pointSet
Definition: Geometry.h:296
InterfaceGeometry::RenderingModes renderingModes
Definition: Geometry.h:341
vtkSmartPointer< vtkActor > pointsActor
the point actor that manages the representation as a set of points
Definition: Geometry.h:323
Geometry(QString label, vtkSmartPointer< vtkPointSet > pointSet, const InterfaceGeometry::RenderingModes mode=InterfaceGeometry::Surface)
instantiate a Geometry using existing stuff.
Definition: Geometry.cpp:77
double oldAlphaWireframe
Definition: Geometry.h:384
void setOpacity(const double) override
Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified!
Definition: Geometry.cpp:655
double getBoundingRadius() override
compute the object's bounding sphere radius
Definition: Geometry.cpp:788
~Geometry() override
destructor
Definition: Geometry.cpp:166
double wireframeColor[4]
Definition: Geometry.h:377
vtkSmartPointer< vtkTransformFilter > worldTransformFilter
the transform filter to place the mesh correctly with respect to its Frame
Definition: Geometry.h:332
the glyph is a nice sphere
Definition: InterfaceGeometry.h:84
bool addProp(const QString &, vtkSmartPointer< vtkProp >) override
insert an additional prop, defining it by its name (default visibility = false)
Definition: Geometry.cpp:452
vtkSmartPointer< vtkTubeFilter > tube
the tube filter (creates tubes insead of lines)
Definition: Geometry.h:329
void buildLabel()
build the label extra prop
Definition: Geometry.cpp:400
vtkSmartPointer< vtkTransform > transform
Definition: RendererWidget.cpp:593
the points are visible
Definition: InterfaceGeometry.h:68
QMap< QString, vtkSmartPointer< vtkProp > > extraProp
The additional map for prop (include at least "label" and "glyph".
Definition: Geometry.h:311
vtkSmartPointer< vtkActor > surfaceActor
the surface actor that manages the surfacic representation
Definition: Geometry.h:317
bool removeProp(const QString &) override
remove a given additional prop.
Definition: Geometry.cpp:491
double glyphSize
current size of glyph (0.0 means no glyph)
Definition: Geometry.h:353
InterfaceGeometry::EnhancedModes enhancedModes
Enhanced mode options (the way actors are rendered: normal, hidden, highlighted, shaded)
Definition: Geometry.h:344
double getActorOpacity(const RenderingModes) const override
Return the opacity of a given renderng mode.
Definition: Geometry.cpp:639
void getActorColor(const RenderingModes, double *) override
Get the color of given representation modes in the second parameter, i.e. double[4] (r,...
Definition: Geometry.cpp:562
void removeProp(vtkSmartPointer< vtkProp > p, bool refresh=false)
remove the given vtkProp (e.g.
void buildGlyph(const GlyphTypes type)
build the glyph extra prop (sphere glyph by default)
Definition: Geometry.cpp:327
the wireframe is visible
Definition: InterfaceGeometry.h:67
void setPointPosition(const unsigned int orderNumber, const double x, const double y, const double z) override
set a given point position
Definition: Geometry.cpp:512
double surfaceColor[4]
Definition: Geometry.h:376
void setActorColor(const RenderingModes, double *) override
Set the color of given representation modes.
Definition: Geometry.cpp:518
orientationDecorationActors[3] GetPositionCoordinate() -> SetValue(0.5, 0.05)
void setMeshWorldTransform(vtkSmartPointer< vtkTransform >) override
Set the world transform (if the Geometry depends on another Frame)
Definition: Geometry.cpp:238
unsigned int getNumberOfProp() const override
return the number of additional prop
Definition: Geometry.cpp:481
void createPointCloudVisualization()
force visualization of point cloud If the point set does only contains a point cloud,...
Definition: Geometry.cpp:212
there are no glyph type attached to the geometry
Definition: InterfaceGeometry.h:83
#define CAMITK_API
Definition: CamiTKAPI.h:48
Definition: Action.cpp:36