Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit

Vtk-based mapper for PointSet. More...

#include <mitkPointSetVtkMapper3D.h>

Inheritance diagram for mitk::PointSetVtkMapper3D:
Collaboration diagram for mitk::PointSetVtkMapper3D:

Public Types

typedef PointSetVtkMapper3D Self
 
typedef VtkMapper Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::VtkMapper
typedef VtkMapper Self
 
typedef Mapper Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::Mapper
typedef Mapper Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual const mitk::PointSetGetInput ()
 
virtual vtkProp * GetVtkProp (mitk::BaseRenderer *renderer) override
 
virtual void UpdateVtkTransform (mitk::BaseRenderer *renderer) override
 Set the vtkTransform of the m_Prop3D for the current time step of renderer. More...
 
void ReleaseGraphicsResources (vtkWindow *renWin)
 
void ReleaseGraphicsResources (mitk::BaseRenderer *renderer) override
 Release vtk-based graphics resources that are being consumed by this mapper. More...
 
- Public Member Functions inherited from mitk::VtkMapper
virtual bool IsVtkBased () const override
 Returns whether this is an vtk-based mapper. More...
 
void MitkRender (mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override
 Determines which geometry should be rendered (opaque, translucent, volumetric, overlay) and calls the appropriate function. More...
 
virtual void MitkRenderOverlay (BaseRenderer *renderer)
 Checks visibility and renders the overlay. More...
 
virtual void MitkRenderOpaqueGeometry (BaseRenderer *renderer)
 Checks visibility and renders untransparent geometry. More...
 
virtual void MitkRenderTranslucentGeometry (BaseRenderer *renderer)
 Checks visiblity and renders transparent geometry. More...
 
virtual void MitkRenderVolumetricGeometry (BaseRenderer *renderer)
 Checks visibility and renders volumes. More...
 
virtual bool HasVtkProp (const vtkProp *prop, BaseRenderer *renderer)
 Returns true if this mapper owns the specified vtkProp for the given BaseRenderer. More...
 
virtual void ApplyProperties (vtkActor *actor, mitk::BaseRenderer *renderer)
 Apply color and opacity properties read from the PropertyList. More...
 
void ApplyShaderProperties (mitk::BaseRenderer *renderer)
 SHADERTODO. More...
 
virtual void ApplyColorAndOpacityProperties (mitk::BaseRenderer *renderer, vtkActor *actor) override
 Apply color and opacity properties read from the PropertyList. Called by mapper subclasses. More...
 
- Public Member Functions inherited from mitk::Mapper
virtual void SetDataNode (DataNode *_arg)
 Set the DataNode containing the data to map. More...
 
virtual DataNodeGetDataNode () const
 Get the DataNode containing the data to map. Method only returns valid DataNode Pointer if the mapper belongs to a data node. Otherwise, the returned DataNode Pointer might be invalid. More...
 
BaseDataGetData () const
 Get the data to map. More...
 
virtual bool GetColor (float rgb[3], BaseRenderer *renderer, const char *name="color") const
 Convenience access method for color properties (instances of ColorProperty) More...
 
virtual bool GetVisibility (bool &visible, BaseRenderer *renderer, const char *name="visible") const
 Convenience access method for visibility properties (instances of BoolProperty) More...
 
virtual bool GetOpacity (float &opacity, BaseRenderer *renderer, const char *name="opacity") const
 Convenience access method for opacity properties (instances of FloatProperty) More...
 
virtual bool GetLevelWindow (LevelWindow &levelWindow, BaseRenderer *renderer, const char *name="levelwindow") const
 Convenience access method for color properties (instances of LevelWindoProperty) More...
 
virtual bool IsVisible (BaseRenderer *renderer, const char *name="visible") const
 Convenience access method for visibility properties (instances of BoolProperty). Return value is the visibility. Default is visible==true, i.e., true is returned even if the property (propertyKey) is not found. More...
 
virtual void Update (BaseRenderer *renderer)
 Calls the time step of the input data for the specified renderer and checks whether the time step is valid and calls method GenerateDataForRenderer() More...
 
int GetTimestep () const
 Returns the current time step as calculated from the renderer. More...
 
virtual bool IsLODEnabled (BaseRenderer *) const
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
static void SetDefaultProperties (mitk::DataNode *node, mitk::BaseRenderer *renderer=NULL, bool overwrite=false)
 
- Static Public Member Functions inherited from mitk::VtkMapper
static const char * GetStaticNameOfClass ()
 
static void SetVtkMapperImmediateModeRendering (vtkMapper *mapper)
 Re-issues all drawing commands required to describe the entire scene each time a new frame is required, regardless of actual changes. More...
 
- Static Public Member Functions inherited from mitk::Mapper
static const char * GetStaticNameOfClass ()
 
static void SetDefaultProperties (DataNode *node, BaseRenderer *renderer=nullptr, bool overwrite=false)
 Set default values of properties used by this mapper to node. More...
 

Public Attributes

LocalStorageHandler< BaseLocalStoragem_LSH
 
- Public Attributes inherited from mitk::VtkMapper
mitk::LocalStorageHandler< VtkMapperLocalStoragem_VtkMapperLSH
 

Protected Member Functions

 PointSetVtkMapper3D ()
 
virtual ~PointSetVtkMapper3D ()
 
virtual void GenerateDataForRenderer (mitk::BaseRenderer *renderer) override
 Generate the data needed for rendering into renderer. More...
 
virtual void ResetMapper (BaseRenderer *renderer) override
 Reset the mapper (i.e., make sure that nothing is displayed) if no valid data is present. In most cases the reimplemented function disables the according actors (toggling visibility off) More...
 
virtual void ApplyAllProperties (mitk::BaseRenderer *renderer, vtkActor *actor)
 
virtual void CreateContour (vtkPoints *points, vtkCellArray *connections)
 
virtual void CreateVTKRenderObjects ()
 
virtual void VertexRendering ()
 
- Protected Member Functions inherited from mitk::VtkMapper
 VtkMapper ()
 
virtual ~VtkMapper ()
 
- Protected Member Functions inherited from mitk::Mapper
 Mapper ()
 explicit constructor which disallows implicit conversions More...
 
virtual ~Mapper ()
 virtual destructor in order to derive from this class More...
 
virtual void GenerateData ()
 Generate the data needed for rendering (independent of a specific renderer) More...
 
virtual void CalculateTimeStep (BaseRenderer *renderer)
 Updates the time step, which is sometimes needed in subclasses. More...
 
virtual OverlayManagerGetOverlayManager () const
 

Protected Attributes

vtkSmartPointer< vtkPoints > m_WorldPositions
 All point positions, already in world coordinates. More...
 
vtkSmartPointer< vtkCellArray > m_PointConnections
 All connections between two points (used for contour drawing) More...
 
vtkSmartPointer< vtkAppendPolyData > m_vtkSelectedPointList
 
vtkSmartPointer< vtkAppendPolyData > m_vtkUnselectedPointList
 
vtkSmartPointer< vtkPoints > m_VtkPoints
 
vtkSmartPointer< vtkCellArray > m_VtkPointConnections
 
vtkSmartPointer< vtkTransformPolyDataFilter > m_VtkPointsTransformer
 
vtkSmartPointer< vtkPolyDataMapper > m_VtkSelectedPolyDataMapper
 
vtkSmartPointer< vtkPolyDataMapper > m_VtkUnselectedPolyDataMapper
 
vtkSmartPointer< vtkActor > m_SelectedActor
 
vtkSmartPointer< vtkActor > m_UnselectedActor
 
vtkSmartPointer< vtkActor > m_ContourActor
 
vtkSmartPointer< vtkPropAssembly > m_PointsAssembly
 
vtkSmartPointer< vtkAppendPolyData > m_vtkTextList
 
unsigned int m_NumberOfSelectedAdded
 
unsigned int m_NumberOfUnselectedAdded
 
ScalarType m_PointSize
 
ScalarType m_ContourRadius
 
bool m_VertexRendering
 
- Protected Attributes inherited from mitk::Mapper
mitk::DataNodem_DataNode
 

Detailed Description

Vtk-based mapper for PointSet.

Due to the need of different colors for selected and unselected points and the facts, that we also have a contour and labels for the points, the vtk structure is build up the following way:

We have two AppendPolyData, one selected, and one unselected and one for a contour between the points. Each one is connected to an own PolyDaraMapper and an Actor. The different color for the unselected and selected state and for the contour is read from properties.

"unselectedcolor", "selectedcolor" and "contourcolor" are the strings, that are looked for. Pointlabels are added besides the selected or the deselected points.

Then the three Actors are combined inside a vtkPropAssembly and this object is returned in GetProp() and so hooked up into the rendering pipeline.

Properties that can be set for point sets and influence the PointSetVTKMapper3D are:

- \b "color": (ColorProperty*) Color of the point set
- \b "Opacity": (FloatProperty) Opacity of the point set
- \b "show contour": (BoolProperty) If the contour of the points are visible
- \b "contourSizeProp":(FloatProperty) Contour size of the points

The default properties are:

- \b "line width": (IntProperty::New(2), renderer, overwrite )
- \b "pointsize": (FloatProperty::New(1.0), renderer, overwrite)
- \b "selectedcolor": (ColorProperty::New(1.0f, 0.0f, 0.0f), renderer, overwrite)  //red
- \b "color": (ColorProperty::New(1.0f, 1.0f, 0.0f), renderer, overwrite)  //yellow
- \b "show contour": (BoolProperty::New(false), renderer, overwrite )
- \b "contourcolor": (ColorProperty::New(1.0f, 0.0f, 0.0f), renderer, overwrite)
- \b "contoursize": (FloatProperty::New(0.5), renderer, overwrite )
- \b "close contour": (BoolProperty::New(false), renderer, overwrite )
- \b "show points": (BoolProperty::New(true), renderer, overwrite )
- \b "updateDataOnRender": (BoolProperty::New(true), renderer, overwrite )

Other properties looked for are:

  • "show contour": if set to on, lines between the points are shown
  • "close contour": if set to on, the open strip is closed (first point connected with last point)
  • "pointsize": size of the points mapped (diameter of a sphere, in world woordinates!)
  • "label": text of the Points to show besides points
  • "contoursize": size of the contour drawn between the points (if not set, the pointsize is taken)

Definition at line 94 of file mitkPointSetVtkMapper3D.h.

Member Typedef Documentation

Constructor & Destructor Documentation

mitk::PointSetVtkMapper3D::PointSetVtkMapper3D ( )
protected
mitk::PointSetVtkMapper3D::~PointSetVtkMapper3D ( )
protectedvirtual

Definition at line 73 of file mitkPointSetVtkMapper3D.cpp.

Member Function Documentation

void mitk::PointSetVtkMapper3D::ApplyAllProperties ( mitk::BaseRenderer renderer,
vtkActor *  actor 
)
protectedvirtual

!define a new ColorProp to be able to pass alpha value

!define a new ColorProp to be able to pass alpha value

Reimplemented in mitk::SplineVtkMapper3D.

Definition at line 529 of file mitkPointSetVtkMapper3D.cpp.

References mitk::ColorProperty::GetColor(), and selectedColor.

Pointer mitk::PointSetVtkMapper3D::Clone ( ) const
void mitk::PointSetVtkMapper3D::CreateContour ( vtkPoints *  points,
vtkCellArray *  connections 
)
protectedvirtual

Definition at line 659 of file mitkPointSetVtkMapper3D.cpp.

References mitk::New().

void mitk::PointSetVtkMapper3D::CreateVTKRenderObjects ( )
protectedvirtual
void mitk::PointSetVtkMapper3D::GenerateDataForRenderer ( mitk::BaseRenderer )
overrideprotectedvirtual

Generate the data needed for rendering into renderer.

Reimplemented from mitk::Mapper.

Reimplemented in mitk::SplineVtkMapper3D.

Definition at line 429 of file mitkPointSetVtkMapper3D.cpp.

References mitk::GenericProperty< T >::GetValue(), mitk::Mapper::BaseLocalStorage::IsGenerateDataRequired(), and mitk::Mapper::BaseLocalStorage::UpdateGenerateDataTime().

virtual std::vector<std::string> mitk::PointSetVtkMapper3D::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::VtkMapper.

Definition at line 97 of file mitkPointSetVtkMapper3D.h.

virtual const char* mitk::PointSetVtkMapper3D::GetClassName ( ) const
virtual

Reimplemented from mitk::VtkMapper.

const mitk::PointSet * mitk::PointSetVtkMapper3D::GetInput ( void  )
virtual
static const char* mitk::PointSetVtkMapper3D::GetStaticNameOfClass ( )
inlinestatic

Definition at line 97 of file mitkPointSetVtkMapper3D.h.

vtkProp * mitk::PointSetVtkMapper3D::GetVtkProp ( mitk::BaseRenderer renderer)
overridevirtual

Implements mitk::VtkMapper.

Reimplemented in mitk::SplineVtkMapper3D.

Definition at line 520 of file mitkPointSetVtkMapper3D.cpp.

static Pointer mitk::PointSetVtkMapper3D::New ( )
static
void mitk::PointSetVtkMapper3D::ReleaseGraphicsResources ( vtkWindow *  renWin)

Definition at line 77 of file mitkPointSetVtkMapper3D.cpp.

void mitk::PointSetVtkMapper3D::ReleaseGraphicsResources ( mitk::BaseRenderer )
overridevirtual

Release vtk-based graphics resources that are being consumed by this mapper.

Method called by mitk::VtkPropRenderer. The parameter renderer could be used to determine which graphic resources to release. The local storage is accessible by the parameter renderer. Should be overwritten in subclasses.

Reimplemented from mitk::VtkMapper.

Definition at line 86 of file mitkPointSetVtkMapper3D.cpp.

References mitk::BaseRenderer::GetRenderWindow().

void mitk::PointSetVtkMapper3D::ResetMapper ( BaseRenderer )
overrideprotectedvirtual

Reset the mapper (i.e., make sure that nothing is displayed) if no valid data is present. In most cases the reimplemented function disables the according actors (toggling visibility off)

To be implemented in sub-classes.

Reimplemented from mitk::Mapper.

Definition at line 515 of file mitkPointSetVtkMapper3D.cpp.

void mitk::PointSetVtkMapper3D::SetDefaultProperties ( mitk::DataNode node,
mitk::BaseRenderer renderer = NULL,
bool  overwrite = false 
)
static
void mitk::PointSetVtkMapper3D::UpdateVtkTransform ( mitk::BaseRenderer renderer)
overridevirtual

Set the vtkTransform of the m_Prop3D for the current time step of renderer.

Called by mitk::VtkPropRenderer::Update before rendering. This method will transform all actors (e.g. of an vtkAssembly) according the geometry.

Warning
This method transforms only props which derive from vtkProp3D. Make sure to use vtkAssembly, if you have multiple props. vtkPropAssembly does not work, since it derives from vtkProp.

Reimplemented from mitk::VtkMapper.

Reimplemented in mitk::SplineVtkMapper3D.

Definition at line 525 of file mitkPointSetVtkMapper3D.cpp.

void mitk::PointSetVtkMapper3D::VertexRendering ( )
protectedvirtual

Definition at line 376 of file mitkPointSetVtkMapper3D.cpp.

Member Data Documentation

vtkSmartPointer<vtkActor> mitk::PointSetVtkMapper3D::m_ContourActor
protected

Definition at line 149 of file mitkPointSetVtkMapper3D.h.

Referenced by PointSetVtkMapper3D().

ScalarType mitk::PointSetVtkMapper3D::m_ContourRadius
protected

Definition at line 162 of file mitkPointSetVtkMapper3D.h.

LocalStorageHandler<BaseLocalStorage> mitk::PointSetVtkMapper3D::m_LSH

Definition at line 117 of file mitkPointSetVtkMapper3D.h.

unsigned int mitk::PointSetVtkMapper3D::m_NumberOfSelectedAdded
protected

Definition at line 157 of file mitkPointSetVtkMapper3D.h.

unsigned int mitk::PointSetVtkMapper3D::m_NumberOfUnselectedAdded
protected

Definition at line 158 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkCellArray> mitk::PointSetVtkMapper3D::m_PointConnections
protected

All connections between two points (used for contour drawing)

Definition at line 134 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkPropAssembly> mitk::PointSetVtkMapper3D::m_PointsAssembly
protected

Definition at line 151 of file mitkPointSetVtkMapper3D.h.

Referenced by PointSetVtkMapper3D().

ScalarType mitk::PointSetVtkMapper3D::m_PointSize
protected

Definition at line 161 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkActor> mitk::PointSetVtkMapper3D::m_SelectedActor
protected

Definition at line 147 of file mitkPointSetVtkMapper3D.h.

Referenced by PointSetVtkMapper3D().

vtkSmartPointer<vtkActor> mitk::PointSetVtkMapper3D::m_UnselectedActor
protected

Definition at line 148 of file mitkPointSetVtkMapper3D.h.

Referenced by PointSetVtkMapper3D().

bool mitk::PointSetVtkMapper3D::m_VertexRendering
protected

Definition at line 163 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkCellArray> mitk::PointSetVtkMapper3D::m_VtkPointConnections
protected

Definition at line 140 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkPoints> mitk::PointSetVtkMapper3D::m_VtkPoints
protected

Definition at line 139 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkTransformPolyDataFilter> mitk::PointSetVtkMapper3D::m_VtkPointsTransformer
protected

Definition at line 142 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkAppendPolyData> mitk::PointSetVtkMapper3D::m_vtkSelectedPointList
protected

Definition at line 136 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkPolyDataMapper> mitk::PointSetVtkMapper3D::m_VtkSelectedPolyDataMapper
protected

Definition at line 144 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkAppendPolyData> mitk::PointSetVtkMapper3D::m_vtkTextList
protected

Definition at line 154 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkAppendPolyData> mitk::PointSetVtkMapper3D::m_vtkUnselectedPointList
protected

Definition at line 137 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkPolyDataMapper> mitk::PointSetVtkMapper3D::m_VtkUnselectedPolyDataMapper
protected

Definition at line 145 of file mitkPointSetVtkMapper3D.h.

vtkSmartPointer<vtkPoints> mitk::PointSetVtkMapper3D::m_WorldPositions
protected

All point positions, already in world coordinates.

Definition at line 132 of file mitkPointSetVtkMapper3D.h.


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