![]() |
Computer Assited Medical Intervention Tool Kit
version 3.2
|
A 3D representation of a vtkPointSet to be displayed in a InteractiveViewer, this class implements the InterfaceGeometry. More...
#include <Geometry.h>
Public Member Functions | |
Geometry (QString label, vtkSmartPointer< vtkPointSet > pointSet, const InterfaceGeometry::RenderingModes mode=InterfaceGeometry::Surface) | |
Instanciate a Geometry using existing stuff. More... | |
virtual const QString | getLabel () const |
get the label of this Geometry instance More... | |
virtual void | setLabel (QString newName) |
set the label of this Geometry instance More... | |
virtual | ~Geometry () |
destructor More... | |
InterfaceGeometry Vtk related inherited methods | |
All the implemented InterfaceGeometry methods (Geometry is the adaptee of Component) | |
virtual vtkSmartPointer < vtkPointSet > | getPointSet () |
virtual void | setPointSet (vtkSmartPointer< vtkPointSet > ds) |
set the input data of the Geometry, More... | |
virtual vtkSmartPointer < vtkAlgorithmOutput > | getDataPort () const |
get the custom algorithm pipeline input. More... | |
virtual void | setDataConnection (vtkSmartPointer< vtkAlgorithmOutput >) |
call this method with the custom algorithm pipeline output More... | |
virtual void | setPointData (vtkSmartPointer< vtkDataArray >) |
set the point data (may contains a lookup table) More... | |
virtual vtkSmartPointer< vtkActor > | getActor (const RenderingModes) |
Return the actor representing this representation mode (return NULL if hightlight mode is Hidden). More... | |
virtual vtkSmartPointer< vtkProp > | getProp (const QString &) |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name. More... | |
virtual unsigned int | getNumberOfProp () const |
return the number of additional prop More... | |
virtual vtkSmartPointer< vtkProp > | getProp (unsigned int) |
return an additional prop by its index More... | |
virtual bool | addProp (const QString &, vtkSmartPointer< vtkProp >) |
insert an additional prop, defining it by its name (default visibility = false) More... | |
virtual bool | removeProp (const QString &) |
remove a given additional prop. More... | |
virtual void | setTexture (vtkSmartPointer< vtkTexture > texture) |
Set a texture to this object. More... | |
virtual void | pointPicked (vtkIdType, bool) |
a vtkPoint of the structured was picked (to be reimplemented in a Component inherited class if needed) More... | |
virtual void | cellPicked (vtkIdType, bool) |
a vtkCell of the structured was picked (to be reimplemented in a Component inherited class if needed) More... | |
InterfaceGeometry Helpers inherited methods | |
virtual void | getBounds (double bounds[6]) |
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax] More... | |
virtual double | getBoundingRadius () |
compute the object's bounding sphere radius More... | |
virtual void | setPointPosition (const unsigned int orderNumber, const double x, const double y, const double z) |
set a given point position More... | |
InterfaceGeometry rendering mode settings inherited methods | |
virtual void | setRenderingModes (const RenderingModes rMode) |
Set the actor associated to a rendering mode visible or not. More... | |
virtual const RenderingModes | getRenderingModes () const |
Return if the actor associated to a rendering mode is currently visible or not. More... | |
virtual void | setEnhancedModes (const EnhancedModes) |
set the enhanced mode More... | |
virtual const EnhancedModes | getEnhancedModes () const |
get the current enhanced mode More... | |
virtual void | setActorColor (const RenderingModes, double[4]) |
Set the color of given representation modes. More... | |
virtual void | setActorColor (const RenderingModes, const double, const double, const double) |
Set the color of given representation modes. More... | |
virtual void | getActorColor (const RenderingModes, double[4]) |
Get the color of given representation modes in the second parameter, i.e. double[4] (r,g,b,a) More... | |
virtual void | setColor (const double, const double, const double) |
Set an (r,g,b) color to all representation modes, without changing the opacity. More... | |
virtual void | setColor (const double, const double, const double, const double) |
Set an (r,g,b,a) color to all representation modes. More... | |
virtual void | setActorOpacity (const RenderingModes, const double) |
Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified! More... | |
virtual double | getActorOpacity (const RenderingModes) const |
Return the opacity of a given renderng mode. More... | |
virtual void | setOpacity (const double) |
Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified! More... | |
virtual void | setGlyphType (const GlyphTypes type, const double size=0.0) |
set the glyph information More... | |
virtual void | setLinesAsTubes (bool tubes=false) |
display lines as tubes (depeding of the boolean) (only work if the Geometry was defined using a vtkPolyData). More... | |
![]() | |
virtual | ~InterfaceGeometry () |
empty virtual destructor, to avoid memory leak More... | |
Protected Member Functions | |
vtkSmartPointer< vtkPointSet > | New () |
Private Attributes | |
VTK members (data, filters, actors, etc...) | |
vtkSmartPointer< vtkPointSet > | pointSet |
vtkSmartPointer < vtkAlgorithmOutput > | dataOutput |
to be able to set external custom pipeline More... | |
vtkSmartPointer < vtkAlgorithmOutput > | customPipelineOutput |
the external custom pipeline output (equals to dataOuput if no custom pipeline plugged) More... | |
vtkSmartPointer < vtkCastToConcrete > | concreteData |
the filter to convert the DataSet to get a correct vtkPipeline output port More... | |
vtkSmartPointer< vtkDataSetMapper > | mapper |
the VTK mapper More... | |
QMap< QString, vtkSmartPointer < vtkProp > > | extraProp |
The additional map for prop (include at least "label" and "glyph". More... | |
vtkSmartPointer< vtkTextMapper > | labelActorMapper |
the mapper to create the text More... | |
vtkSmartPointer< vtkActor > | surfaceActor |
the surface actor that manages the surfacic representation More... | |
vtkSmartPointer< vtkActor > | wireframeActor |
the wireframe actor that manages the representation as wireframe More... | |
vtkSmartPointer< vtkActor > | pointsActor |
the point actor that manages the representation as a set of points More... | |
vtkSmartPointer< vtkTexture > | texture |
texture of this object. More... | |
vtkSmartPointer< vtkTubeFilter > | tube |
the tube filter (creates tubes insead of lines) More... | |
actor colors | |
All Colors are decribed using r, g, b, alpha (Alpha is opacity 0 = transparent, 1 = opaque) | |
double | surfaceColor [4] |
double | wireframeColor [4] |
double | pointsColor [4] |
Backup states | |
double | oldAlphaSurface |
double | oldAlphaWireframe |
double | oldAlphaPoints |
double | oldPointsColor [4] |
Other members | |
Rendering mode options for this Geometry (which actors are visible/rendered) | |
InterfaceGeometry::RenderingModes | renderingModes |
InterfaceGeometry::EnhancedModes | enhancedModes |
Enhanced mode options (the way actors are rendered: normal, hidden, highlighted, shaded) More... | |
double | alphaShaded |
Opacity value when this object must be shaded. More... | |
QString | label |
the label More... | |
double | glyphSize |
current size of glyph (0.0 means no glyph) More... | |
vtkSmartPointer< vtkSphereSource > | sphereGeom |
the sphere glyph More... | |
void | buildLabel () |
build the label extra prop More... | |
void | updateLabel () |
update position and text of the label More... | |
void | buildGlyph (const GlyphTypes type) |
build the glyph extra prop (sphere glyph by default) More... | |
Additional Inherited Members | |
![]() | |
enum | EnhancedMode { Normal = 0x0, Hidden = 0x1, Shaded = 0x2, Highlighted = 0x4 } |
(and QFlags EnhancedModes) handle the way the rendering actors will be enhanced or not (from completely hidden to highlighted) More... | |
enum | GlyphType { NoGlyph = 0x0, Sphere = 0x1 } |
(and QFlags GlyphTypes) is the type of glyph attached to the geometry representation More... | |
enum | RenderingMode { None = 0x0, Surface = 0x1, Wireframe = 0x2, Points = 0x4 } |
(and QFlags RenderingModes) handle actor rendering options (render this InterfaceGeometry as a surface, a wireframe and set of points). More... | |
A 3D representation of a vtkPointSet to be displayed in a InteractiveViewer, this class implements the InterfaceGeometry.
A Geometry is build out of a vtkPointSet. A single vtkDataSetMapper is created, with several associated vtkActors. Each actor has specific rendering properties: representation mode, color, ...
Available actors are: surface, wireframe and points.
An actor is visible or not according to the options of the RenderingModes associated to the Geometry as well as the highlight mode (from hidden to highlighted).
This class is used as a delegate by Component (who delegates all the InterfaceGeometry service implementation to Geometry), according to the Object Adapter Design Pattern (Component is the adaptor, Geometry is the adaptee concerning the InterfaceGeometry service).
If you need to add your own vtk filter/algorithm pipeline to pre-process the data, you need to write something like this:
The complete Vtk Pipeline looks like this:
* +-----> getDataPort() * +----------------+ +------------------+ / * | vtkPointSet | |vtkCastToConcrete |/ * | |----\| |----\ your custom ----\ ... * | pointSet |----/| concreteData |----/ pipeline ----/ * +----------------+ +------------------+ * ^ | * | | * setPointSet() | * | * v * getPointSet() * * * setDataConnection(..) * | * | +---OPTIONAL---+ +------------------+ * +->| vtkTubeFilter| | vtkDataSetMapper | *... ----\| |-----\ | | * ----/| tube |-----/ | mapper | * +--------------+ +------------------+ * ^ | * | V * setLinesAsTube() +------------------+ * | 3 actors: | * | surfaceActor | * | wireframeActor | * | pointsActor | * | | * +------------------+ * *
The other vtk (minor) ingredients not mentionned are specific vtkProp (actors, volumes and annotations) By default two props are defined: label and glyph. They can be accessed by getProp("label") and getProp("glyph"). You can also add your own additional custom props by using addProp(QString, vtkProp) and setPropVisible(QString, bool).
camitk::Geometry::Geometry | ( | QString | label, |
vtkSmartPointer< vtkPointSet > | pointSet, | ||
const InterfaceGeometry::RenderingModes | mode = InterfaceGeometry::Surface |
||
) |
Instanciate a Geometry using existing stuff.
label | name to display on the label |
pointSet | the vtkDataSet to take as the vtk object to display |
mode | the default rendering mode |
|
virtual |
destructor
|
virtual |
insert an additional prop, defining it by its name (default visibility = false)
Implements camitk::InterfaceGeometry.
|
private |
build the glyph extra prop (sphere glyph by default)
|
private |
build the label extra prop
|
inlinevirtual |
a vtkCell of the structured was picked (to be reimplemented in a Component inherited class if needed)
Implements camitk::InterfaceGeometry.
|
virtual |
Return the actor representing this representation mode (return NULL if hightlight mode is Hidden).
If RenderingModes have a more than one possible representation, it returns in priority order: the surface, wireframe or points representation.
Implements camitk::InterfaceGeometry.
|
virtual |
Get the color of given representation modes in the second parameter, i.e. double[4] (r,g,b,a)
Implements camitk::InterfaceGeometry.
|
virtual |
Return the opacity of a given renderng mode.
Implements camitk::InterfaceGeometry.
|
virtual |
compute the object's bounding sphere radius
Implements camitk::InterfaceGeometry.
|
virtual |
compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax]
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
get the custom algorithm pipeline input.
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
get the current enhanced mode
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
get the label of this Geometry instance
Implements camitk::InterfaceGeometry.
|
virtual |
return the number of additional prop
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
Return the dataset associated to this object.
Implements camitk::InterfaceGeometry.
|
virtual |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
Implements camitk::InterfaceGeometry.
|
virtual |
return an additional prop by its index
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
Return if the actor associated to a rendering mode is currently visible or not.
Implements camitk::InterfaceGeometry.
|
protected |
|
inlinevirtual |
a vtkPoint of the structured was picked (to be reimplemented in a Component inherited class if needed)
Implements camitk::InterfaceGeometry.
|
virtual |
remove a given additional prop.
Implements camitk::InterfaceGeometry.
|
virtual |
Set the color of given representation modes.
Implements camitk::InterfaceGeometry.
|
virtual |
Set the color of given representation modes.
Implements camitk::InterfaceGeometry.
|
virtual |
Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified!
Implements camitk::InterfaceGeometry.
|
virtual |
Set an (r,g,b) color to all representation modes, without changing the opacity.
Implements camitk::InterfaceGeometry.
|
virtual |
Set an (r,g,b,a) color to all representation modes.
Implements camitk::InterfaceGeometry.
|
virtual |
call this method with the custom algorithm pipeline output
Implements camitk::InterfaceGeometry.
|
virtual |
set the enhanced mode
Implements camitk::InterfaceGeometry.
|
virtual |
set the glyph information
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
set the label of this Geometry instance
Implements camitk::InterfaceGeometry.
|
virtual |
display lines as tubes (depeding of the boolean) (only work if the Geometry was defined using a vtkPolyData).
Implements camitk::InterfaceGeometry.
|
virtual |
Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified!
Implements camitk::InterfaceGeometry.
|
virtual |
set the point data (may contains a lookup table)
Implements camitk::InterfaceGeometry.
|
virtual |
set a given point position
Implements camitk::InterfaceGeometry.
|
virtual |
set the input data of the Geometry,
Implements camitk::InterfaceGeometry.
|
inlinevirtual |
Set the actor associated to a rendering mode visible or not.
Implements camitk::InterfaceGeometry.
|
virtual |
Set a texture to this object.
Implements camitk::InterfaceGeometry.
|
private |
update position and text of the label
|
private |
Opacity value when this object must be shaded.
|
private |
the filter to convert the DataSet to get a correct vtkPipeline output port
|
private |
the external custom pipeline output (equals to dataOuput if no custom pipeline plugged)
|
private |
to be able to set external custom pipeline
|
private |
Enhanced mode options (the way actors are rendered: normal, hidden, highlighted, shaded)
|
private |
The additional map for prop (include at least "label" and "glyph".
|
private |
current size of glyph (0.0 means no glyph)
|
private |
the label
|
private |
the mapper to create the text
|
private |
the VTK mapper
|
private |
|
private |
|
private |
|
private |
|
private |
the point actor that manages the representation as a set of points
|
private |
|
private |
The low-level VTK data
|
private |
|
private |
the sphere glyph
|
private |
the surface actor that manages the surfacic representation
|
private |
|
private |
texture of this object.
|
private |
the tube filter (creates tubes insead of lines)
|
private |
the wireframe actor that manages the representation as wireframe
|
private |