Medical Imaging Interaction Toolkit  2024.06.00
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 ()
 
vtkProp * GetVtkProp (mitk::BaseRenderer *renderer) override
 
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 visibility 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 *)
 
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...
 
TimeStepType 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=nullptr, bool overwrite=false)
 
- Static Public Member Functions inherited from mitk::VtkMapper
static const char * GetStaticNameOfClass ()
 
- 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
 

Protected Member Functions

 PointSetVtkMapper3D ()
 
 ~PointSetVtkMapper3D () override
 
void GenerateDataForRenderer (mitk::BaseRenderer *renderer) override
 Generate the data needed for rendering into renderer. More...
 
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 ()
 
- Protected Member Functions inherited from mitk::VtkMapper
 VtkMapper ()
 
 ~VtkMapper () override
 
- Protected Member Functions inherited from mitk::Mapper
 Mapper ()
 explicit constructor which disallows implicit conversions More...
 
 ~Mapper () override
 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...
 

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
 
- 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:

  • "color": (ColorProperty*) Color of the point set
  • "Opacity": (FloatProperty) Opacity of the point set
  • "show contour": (BoolProperty) If the contour of the points are visible
  • "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 90 of file mitkPointSetVtkMapper3D.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

Constructor & Destructor Documentation

◆ PointSetVtkMapper3D()

mitk::PointSetVtkMapper3D::PointSetVtkMapper3D ( )
protected

◆ ~PointSetVtkMapper3D()

mitk::PointSetVtkMapper3D::~PointSetVtkMapper3D ( )
overrideprotected

Member Function Documentation

◆ ApplyAllProperties()

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

Reimplemented in mitk::SplineVtkMapper3D.

◆ Clone()

Pointer mitk::PointSetVtkMapper3D::Clone ( ) const

◆ CreateContour()

virtual void mitk::PointSetVtkMapper3D::CreateContour ( vtkPoints *  points,
vtkCellArray *  connections 
)
protectedvirtual

◆ CreateVTKRenderObjects()

virtual void mitk::PointSetVtkMapper3D::CreateVTKRenderObjects ( )
protectedvirtual

◆ GenerateDataForRenderer()

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

Generate the data needed for rendering into renderer.

Reimplemented from mitk::Mapper.

Reimplemented in mitk::SplineVtkMapper3D.

◆ GetClassHierarchy()

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

Reimplemented from mitk::VtkMapper.

Definition at line 93 of file mitkPointSetVtkMapper3D.h.

◆ GetClassName()

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

Reimplemented from mitk::VtkMapper.

◆ GetInput()

virtual const mitk::PointSet* mitk::PointSetVtkMapper3D::GetInput ( )
virtual

◆ GetStaticNameOfClass()

static const char* mitk::PointSetVtkMapper3D::GetStaticNameOfClass ( )
inlinestatic

Definition at line 93 of file mitkPointSetVtkMapper3D.h.

◆ GetVtkProp()

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

Implements mitk::VtkMapper.

Reimplemented in mitk::SplineVtkMapper3D.

◆ New()

static Pointer mitk::PointSetVtkMapper3D::New ( )
static

◆ ReleaseGraphicsResources() [1/2]

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.

◆ ReleaseGraphicsResources() [2/2]

void mitk::PointSetVtkMapper3D::ReleaseGraphicsResources ( vtkWindow *  renWin)

◆ ResetMapper()

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.

◆ SetDefaultProperties()

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

◆ UpdateVtkTransform()

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.

Member Data Documentation

◆ m_ContourActor

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

Definition at line 146 of file mitkPointSetVtkMapper3D.h.

◆ m_ContourRadius

ScalarType mitk::PointSetVtkMapper3D::m_ContourRadius
protected

Definition at line 159 of file mitkPointSetVtkMapper3D.h.

◆ m_LSH

LocalStorageHandler<BaseLocalStorage> mitk::PointSetVtkMapper3D::m_LSH

Definition at line 115 of file mitkPointSetVtkMapper3D.h.

◆ m_NumberOfSelectedAdded

unsigned int mitk::PointSetVtkMapper3D::m_NumberOfSelectedAdded
protected

Definition at line 154 of file mitkPointSetVtkMapper3D.h.

◆ m_NumberOfUnselectedAdded

unsigned int mitk::PointSetVtkMapper3D::m_NumberOfUnselectedAdded
protected

Definition at line 155 of file mitkPointSetVtkMapper3D.h.

◆ m_PointConnections

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

All connections between two points (used for contour drawing)

Definition at line 131 of file mitkPointSetVtkMapper3D.h.

◆ m_PointsAssembly

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

Definition at line 148 of file mitkPointSetVtkMapper3D.h.

◆ m_PointSize

ScalarType mitk::PointSetVtkMapper3D::m_PointSize
protected

Definition at line 158 of file mitkPointSetVtkMapper3D.h.

◆ m_SelectedActor

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

Definition at line 144 of file mitkPointSetVtkMapper3D.h.

◆ m_UnselectedActor

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

Definition at line 145 of file mitkPointSetVtkMapper3D.h.

◆ m_VtkPointConnections

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

Definition at line 137 of file mitkPointSetVtkMapper3D.h.

◆ m_VtkPoints

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

Definition at line 136 of file mitkPointSetVtkMapper3D.h.

◆ m_VtkPointsTransformer

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

Definition at line 139 of file mitkPointSetVtkMapper3D.h.

◆ m_vtkSelectedPointList

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

Definition at line 133 of file mitkPointSetVtkMapper3D.h.

◆ m_VtkSelectedPolyDataMapper

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

Definition at line 141 of file mitkPointSetVtkMapper3D.h.

◆ m_vtkTextList

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

Definition at line 151 of file mitkPointSetVtkMapper3D.h.

◆ m_vtkUnselectedPointList

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

Definition at line 134 of file mitkPointSetVtkMapper3D.h.

◆ m_VtkUnselectedPolyDataMapper

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

Definition at line 142 of file mitkPointSetVtkMapper3D.h.

◆ m_WorldPositions

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

All point positions, already in world coordinates.

Definition at line 129 of file mitkPointSetVtkMapper3D.h.


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