Computer Assited Medical Intervention Tool Kit  version 5.0
camitk::InterfaceGeometry Class Referenceabstract

This class describes what are the methods to implement for a Geometry (rendering parameters, input/output, filters, picking parameters...) More...

#include <InterfaceGeometry.h>

+ Inheritance diagram for camitk::InterfaceGeometry:
+ Collaboration diagram for camitk::InterfaceGeometry:

Public Types

enum  EnhancedMode { Normal = 0x0, Hidden = 0x1, Shaded = 0x2, Highlighted = 0x4 }
 
enum  GlyphType { NoGlyph = 0x0, Sphere = 0x1 }
 
enum  RenderingMode { None = 0x0, Surface = 0x1, Wireframe = 0x2, Points = 0x4 }
 

Public Member Functions

virtual const QString getLabel () const =0
 get the string used to display the label More...
 
virtual void setLabel (QString newName)=0
 set the string used to display the label More...
 
virtual ~InterfaceGeometry ()=default
 empty virtual destructor, to avoid memory leak More...
 
Vtk related

get the low-level vtk data

virtual vtkSmartPointer< vtkPointSet > getPointSet ()=0
 
virtual void setPointSet (vtkSmartPointer< vtkPointSet >)=0
 set the low-level data set. More...
 
virtual void setPointData (vtkSmartPointer< vtkDataArray >)=0
 set the point data (may contains a lookup table). More...
 
virtual void setMeshWorldTransform (vtkSmartPointer< vtkTransform >)=0
 set the transformation for 3D representation More...
 
virtual vtkSmartPointer< vtkAlgorithmOutput > getDataPort () const =0
 get the custom algorithm pipeline input. More...
 
virtual void setDataConnection (vtkSmartPointer< vtkAlgorithmOutput >)=0
 Set/reset the connection for the InterfaceGeometry internal algorithm. More...
 
virtual void setTexture (vtkSmartPointer< vtkTexture >)=0
 Set a texture to this object. More...
 
virtual void pointPicked (vtkIdType pointId, bool pickingIsSelecting)=0
 This method is called when a vtkPoint included in the vtk representation was picked. More...
 
virtual void cellPicked (vtkIdType cellId, bool pickingIsSelecting)=0
 This method is called when a vtkCell included in the vtk representation was picked. More...
 
virtual vtkSmartPointer< vtkActor > getActor (const RenderingModes)=0
 Return the actor for the representation mode, NULL if the actor doesn't exist. More...
 
manage extra prop associated with an InterfaceGeometry

TODO

  • put all this management into a dedicated interface
  • remove it from InterfaceBitMap and InterfaceGeometry
  • remove it from Slice and Geometry helper classes
  • create a new associated helper class
  • update Component class and all other code using it (if needed) Note : beware that Geometry requires this to manage to at least "label" and "glyph" extra actors
virtual vtkSmartPointer< vtkProp > getProp (const QString &)=0
 Return the vtkProp (actors, volumes and annotations) corresponding to the given name. More...
 
virtual unsigned int getNumberOfProp () const =0
 return the number of additional prop More...
 
virtual vtkSmartPointer< vtkProp > getProp (unsigned int)=0
 return an additional prop by its index More...
 
virtual bool removeProp (const QString &)=0
 remove a given additional prop. More...
 
virtual bool addProp (const QString &, vtkSmartPointer< vtkProp >)=0
 insert an additional prop, defining it by its name (default visibility = false). More...
 
Helpers methods
virtual void getBounds (double *bounds)=0
 compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax] More...
 
virtual double getBoundingRadius ()=0
 compute the object's bounding sphere radius More...
 
virtual void setPointPosition (const unsigned int orderNumber, const double x, const double y, const double z)=0
 set a given point position More...
 
rendering mode settings

Set the actor associated to a rendering mode visible or not.

virtual void setRenderingModes (const RenderingModes)=0
 
virtual const RenderingModes getRenderingModes () const =0
 Return if the actor associated to a rendering mode is currently visible or not. More...
 
virtual void setEnhancedModes (const EnhancedModes)=0
 set the enhanced mode More...
 
virtual const EnhancedModes getEnhancedModes () const =0
 get the current enhanced mode More...
 
virtual void setActorColor (const RenderingModes, double *color)=0
 Set the color of given representation modes. More...
 
virtual void setActorColor (const RenderingModes, const double, const double, const double)=0
 Set the color of given representation modes. More...
 
virtual void getActorColor (const RenderingModes mode, double *color)=0
 Get the color of given representation modes in the second parameter. More...
 
virtual void setColor (const double, const double, const double)=0
 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)=0
 Set an (r,g,b,a) color to all representation modes. More...
 
virtual void setActorOpacity (const RenderingModes, const double)=0
 Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified! More...
 
virtual double getActorOpacity (const RenderingModes) const =0
 Return the opacity of a given renderng mode. More...
 
virtual void setOpacity (const double)=0
 Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified! More...
 
virtual void setMapperScalarRange (double min, double max)=0
 Set the mapper scalar range. More...
 
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 dataset). More...
 
virtual void setLinesAsTubes (bool)=0
 set the lines as tubes (works only for vtkDataSet representation that contains lines) More...
 

Detailed Description

This class describes what are the methods to implement for a Geometry (rendering parameters, input/output, filters, picking parameters...)

An InterfaceGeometry is a kind of simplifier/wrapper for vtkPointSet.

This class defines an "interface" (in the OOP/java meaning of the term). See the introduction of GoF: "Program to an interface, not an implementation." To see what Erich Gamma has to say about it: http://www.artima.com/lejava/articles/designprinciplesP.html To see what Bjarne Stroustrup has to say about it: http://www.artima.com/intv/modern.html

See also
Geometry

Member Enumeration Documentation

◆ EnhancedMode

(and QFlags EnhancedModes) handle the way the rendering actors will be enhanced or not (from completely hidden to highlighted)

Enumerator
Normal 

the object is normally displayed

Hidden 

the object is hidden

Shaded 

the object is shaded

Highlighted 

the object is highlighted

◆ GlyphType

(and QFlags GlyphTypes) is the type of glyph attached to the geometry representation

Enumerator
NoGlyph 

there are no glyph type attached to the geometry

Sphere 

the glyph is a nice sphere

◆ RenderingMode

(and QFlags RenderingModes) handle actor rendering options (render this InterfaceGeometry as a surface, a wireframe and set of points).

Enumerator
None 

no rendering mode, the InterfaceGeometry is not visible

Surface 

the surface is visible

Wireframe 

the wireframe is visible

Points 

the points are visible

Constructor & Destructor Documentation

◆ ~InterfaceGeometry()

virtual camitk::InterfaceGeometry::~InterfaceGeometry ( )
virtualdefault

empty virtual destructor, to avoid memory leak

Member Function Documentation

◆ addProp()

virtual bool camitk::InterfaceGeometry::addProp ( const QString &  ,
vtkSmartPointer< vtkProp >   
)
pure virtual

insert an additional prop, defining it by its name (default visibility = false).

Returns
true if the additional prop was added (i.e. another additional prop of the same name does not exist)

Implemented in camitk::Component, and camitk::Geometry.

◆ cellPicked()

virtual void camitk::InterfaceGeometry::cellPicked ( vtkIdType  cellId,
bool  pickingIsSelecting 
)
pure virtual

This method is called when a vtkCell included in the vtk representation was picked.

This is the same as method getChildComponentFromVtkPointId, but for CELL_PICKING.

A Component re-implementing this method can manage a specific selection process (or any other suitable action).

Parameters
cellIdthe vtkCell id that was selected by picking
pickingIsSelectingindicates if the current picking session is selecting or unselecting
See also
InteractiveViewer

Implemented in camitk::Component, camitk::Geometry, and camitk::MeshComponent.

◆ getActor()

virtual vtkSmartPointer<vtkActor> camitk::InterfaceGeometry::getActor ( const  RenderingModes)
pure virtual

Return the actor for the representation mode, NULL if the actor doesn't exist.

Implemented in camitk::Geometry.

◆ getActorColor()

virtual void camitk::InterfaceGeometry::getActorColor ( const RenderingModes  mode,
double *  color 
)
pure virtual

Get the color of given representation modes in the second parameter.

Parameters
colorthe 4-sized double tab of color (r,g,b,a) of the actor.
Warning
color must points a 4 double-sized tab minimum.

Implemented in camitk::Geometry.

◆ getActorOpacity()

virtual double camitk::InterfaceGeometry::getActorOpacity ( const  RenderingModes) const
pure virtual

Return the opacity of a given renderng mode.

Implemented in camitk::Geometry.

◆ getBoundingRadius()

virtual double camitk::InterfaceGeometry::getBoundingRadius ( )
pure virtual

compute the object's bounding sphere radius

Implemented in camitk::Geometry, and camitk::Component.

◆ getBounds()

virtual void camitk::InterfaceGeometry::getBounds ( double *  bounds)
pure virtual

compute the object's bounding box [xmin,xmax, ymin,ymax, zmin,zmax]

Parameters
boundsthe 6-sized double tab of the bounding box (in 3D).
Warning
bounds must points a 6 double-sized tab minimum.

Implemented in camitk::Geometry, and camitk::Component.

◆ getDataPort()

virtual vtkSmartPointer<vtkAlgorithmOutput> camitk::InterfaceGeometry::getDataPort ( ) const
pure virtual

get the custom algorithm pipeline input.

This method returns the unmodified data that you have to use as an input for your filter/algorithm. I.e. if you want to temporarily apply some filter/algorithm to the InterfaceGeometry call this method to get the input of your filter/algorithm pipeline. Typically, your custom filter/algorithm connection should start with:

vtkSomeAlgorithm *startFilter = vtkSomeAlgorithm::New();
startFilter->SetInputConnection(theAbstractGeometry->getDataPort());
...
// in the end call setDataConnection()
See also
setDataConnection()
Geometry

Implemented in camitk::Geometry.

◆ getEnhancedModes()

virtual const EnhancedModes camitk::InterfaceGeometry::getEnhancedModes ( ) const
pure virtual

get the current enhanced mode

Implemented in camitk::Geometry.

◆ getLabel()

virtual const QString camitk::InterfaceGeometry::getLabel ( ) const
pure virtual

get the string used to display the label

Implemented in camitk::Component, and camitk::Geometry.

◆ getNumberOfProp()

virtual unsigned int camitk::InterfaceGeometry::getNumberOfProp ( ) const
pure virtual

return the number of additional prop

Implemented in camitk::Component, and camitk::Geometry.

◆ getPointSet()

◆ getProp() [1/2]

virtual vtkSmartPointer<vtkProp> camitk::InterfaceGeometry::getProp ( const QString &  )
pure virtual

Return the vtkProp (actors, volumes and annotations) corresponding to the given name.

Implemented in camitk::Component, and camitk::Geometry.

◆ getProp() [2/2]

virtual vtkSmartPointer<vtkProp> camitk::InterfaceGeometry::getProp ( unsigned int  )
pure virtual

return an additional prop by its index

Implemented in camitk::Geometry, and camitk::Component.

◆ getRenderingModes()

virtual const RenderingModes camitk::InterfaceGeometry::getRenderingModes ( ) const
pure virtual

Return if the actor associated to a rendering mode is currently visible or not.

Implemented in camitk::Component, and camitk::Geometry.

◆ pointPicked()

virtual void camitk::InterfaceGeometry::pointPicked ( vtkIdType  pointId,
bool  pickingIsSelecting 
)
pure virtual

This method is called when a vtkPoint included in the vtk representation was picked.

When the picking mode is set in InteractiveViewer to POINT_PICKING the vtk picker can select a specific vtkPoint in the big Geometry.

A Component re-implementing this method can manage a specific selection process (or any other suitable action).

Parameters
pointIdthe vtkPoint id that was selected by picking
pickingIsSelectingindicates if the current picking session is selecting or unselecting
See also
InteractiveViewer

Implemented in camitk::Component, camitk::Geometry, and camitk::MeshComponent.

◆ removeProp()

virtual bool camitk::InterfaceGeometry::removeProp ( const QString &  )
pure virtual

remove a given additional prop.

Returns
true if effictively done

Implemented in camitk::Component, and camitk::Geometry.

◆ setActorColor() [1/2]

virtual void camitk::InterfaceGeometry::setActorColor ( const  RenderingModes,
const double  ,
const double  ,
const double   
)
pure virtual

Set the color of given representation modes.

Implemented in camitk::Geometry.

◆ setActorColor() [2/2]

virtual void camitk::InterfaceGeometry::setActorColor ( const  RenderingModes,
double *  color 
)
pure virtual

Set the color of given representation modes.

Parameters
colorthe 4-sized double tab of color (r,g,b,a) of the actor.
Warning
color must points a 4 double-sized tab minimum.

Implemented in camitk::Geometry.

◆ setActorOpacity()

virtual void camitk::InterfaceGeometry::setActorOpacity ( const  RenderingModes,
const double   
)
pure virtual

Set the opacity of this representation modes. WARNING color field (surfaceColor, ...) are not modified!

Implemented in camitk::Geometry.

◆ setColor() [1/2]

virtual void camitk::InterfaceGeometry::setColor ( const double  ,
const double  ,
const double   
)
pure virtual

Set an (r,g,b) color to all representation modes, without changing the opacity.

Implemented in camitk::Geometry.

◆ setColor() [2/2]

virtual void camitk::InterfaceGeometry::setColor ( const double  ,
const double  ,
const double  ,
const double   
)
pure virtual

Set an (r,g,b,a) color to all representation modes.

Implemented in camitk::Geometry.

◆ setDataConnection()

virtual void camitk::InterfaceGeometry::setDataConnection ( vtkSmartPointer< vtkAlgorithmOutput >  )
pure virtual

Set/reset the connection for the InterfaceGeometry internal algorithm.

This method sets the input for the InterfaceGeometry mapping/rendering pipeline. Your should call this method to have the correct rendering of your custom filter/algorithm pipelines. Typically, your custom filter/algorithm connection should end with:

// begining of the custom filter/algorithm pipelines (don't forget to call getDataPort()!)
...
theAbstractGeometry->setDataConnection(endFilter->GetOutputPort());

To remove your custom pipeline, either call setDataConnection(NULL) or theAbstractGeometry->setDataConnection(theAbstractGeometry->getDataPort())

See also
getDataPort()
Geometry

Implemented in camitk::Geometry.

Referenced by LoadTransformation::apply(), MeshClipping::changeAllComponents(), MeshClipping::clipMesh(), RigidTransform::close(), RigidTransform::getWidget(), and MeshClipping::restoreMeshes().

+ Here is the caller graph for this function:

◆ setEnhancedModes()

virtual void camitk::InterfaceGeometry::setEnhancedModes ( const  EnhancedModes)
pure virtual

set the enhanced mode

Implemented in camitk::Geometry.

Referenced by PMLComponent::refreshDisplay().

+ Here is the caller graph for this function:

◆ setGlyphType()

virtual void camitk::InterfaceGeometry::setGlyphType ( const GlyphTypes  type,
const double  size = 0.0 
)
pure virtual

Set the glyph type (a glyph is a geometric representation attached to every point in the input dataset).

The glyph size is needed when the type is not NoGlyph (the size value is used depending on the current GlyphTypes) :

  • if type is Sphere, size is the radius for the sphere (this is the default)
  • if type is NoGlyph, then no glyph are shown

To show the glyph call getProp("glyph")->SetVisibility(true) or getProp("glyph")->VisibilityOn().

Parameters
typethe glyph type
sizesize of the glyph (default is 0.0)

Implemented in camitk::Geometry.

◆ setLabel()

virtual void camitk::InterfaceGeometry::setLabel ( QString  newName)
pure virtual

set the string used to display the label

Implemented in camitk::Component, and camitk::Geometry.

◆ setLinesAsTubes()

virtual void camitk::InterfaceGeometry::setLinesAsTubes ( bool  )
pure virtual

set the lines as tubes (works only for vtkDataSet representation that contains lines)

Implemented in camitk::Geometry.

Referenced by camitk::InteractiveViewer::refresh().

+ Here is the caller graph for this function:

◆ setMapperScalarRange()

virtual void camitk::InterfaceGeometry::setMapperScalarRange ( double  min,
double  max 
)
pure virtual

Set the mapper scalar range.

Implemented in camitk::Geometry.

◆ setMeshWorldTransform()

virtual void camitk::InterfaceGeometry::setMeshWorldTransform ( vtkSmartPointer< vtkTransform >  )
pure virtual

set the transformation for 3D representation

Implemented in camitk::Geometry.

◆ setOpacity()

virtual void camitk::InterfaceGeometry::setOpacity ( const double  )
pure virtual

Set the opacity of this object. WARNING color field (surfaceColor, ...) are not modified!

Implemented in camitk::Geometry.

◆ setPointData()

virtual void camitk::InterfaceGeometry::setPointData ( vtkSmartPointer< vtkDataArray >  )
pure virtual

set the point data (may contains a lookup table).

Note
values have to be in interval [0..1]

Implemented in camitk::Geometry.

◆ setPointPosition()

virtual void camitk::InterfaceGeometry::setPointPosition ( const unsigned int  orderNumber,
const double  x,
const double  y,
const double  z 
)
pure virtual

set a given point position

Implemented in camitk::Geometry.

◆ setPointSet()

virtual void camitk::InterfaceGeometry::setPointSet ( vtkSmartPointer< vtkPointSet >  )
pure virtual

set the low-level data set.

Note
if there is already a vtkPointSet, this method calls DeepCopy(ds)
it is very important to overload this method in your Component subclass as this will be called by all the operators that operates a change directly on the data.

Implemented in camitk::Geometry.

◆ setRenderingModes()

virtual void camitk::InterfaceGeometry::setRenderingModes ( const  RenderingModes)
pure virtual

Implemented in camitk::Geometry.

◆ setTexture()

virtual void camitk::InterfaceGeometry::setTexture ( vtkSmartPointer< vtkTexture >  )
pure virtual

Set a texture to this object.

Implemented in camitk::Geometry.

Referenced by LoadTextureFromBMP::process().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: