Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit

Base class of all mappers, Vtk as well as OpenGL mappers. More...

#include <mitkMapper.h>

Inheritance diagram for mitk::Mapper:
Collaboration diagram for mitk::Mapper:

Classes

class  BaseLocalStorage
 Base class for mapper-specific rendering resources. More...
 

Public Member Functions

 mitkClassMacroItkParent (Mapper, itk::Object)
 
virtual void SetDataNode (DataNode *_arg)
 Set the DataNode containing the data to map. More...
 
virtual DataNode * GetDataNode () const
 Get the DataNode containing the data to map. More...
 
virtual void Update (BaseRenderer *renderer)
 Calculate the time step for the current renderer and generate rendering data. More...
 
virtual void MitkRender (mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type)=0
 Responsible for calling the appropriate render functions. More...
 
virtual void ApplyColorAndOpacityProperties (mitk::BaseRenderer *renderer, vtkActor *actor=nullptr)=0
 Apply color and opacity properties read from the PropertyList to the rendering actor. More...
 
TimeStepType GetTimestep () const
 Return the current time step as calculated from the renderer. More...
 
virtual bool IsLODEnabled (BaseRenderer *) const
 Return whether this Mapper currently allows for Level-of-Detail rendering. More...
 

Static Public Member Functions

static void SetDefaultProperties (DataNode *node, BaseRenderer *renderer=nullptr, bool overwrite=false)
 Set default values of properties used by this mapper on the given node. More...
 

Protected Member Functions

 Mapper ()
 explicit constructor which disallows implicit conversions More...
 
 ~Mapper () override
 virtual destructor in order to derive from this class More...
 
virtual void GenerateDataForRenderer (BaseRenderer *)
 Generate the data needed for rendering into renderer. More...
 
virtual void CalculateTimeStep (BaseRenderer *renderer)
 Updates the time step, which is sometimes needed in subclasses. More...
 
virtual void ResetMapper (BaseRenderer *)
 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...
 

Protected Attributes

mitk::DataNode * m_DataNode
 

Detailed Description

Base class of all mappers, Vtk as well as OpenGL mappers.

By the help of mappers, the input data is transformed to tangible primitives, such as surfaces, points, lines, etc. This is the base class of all mappers, Vtk as well as OpenGL mappers. Subclasses of mitk::Mapper control the creation of rendering primitives that interface to the graphics library (e.g., OpenGL, vtk).

Each Mapper is associated with a DataNode, from which it reads the data and properties needed for rendering. The Update() method calculates the current time step and calls GenerateDataForRenderer() to produce the rendering output for a given BaseRenderer.

See also
VtkMapper
BaseRenderer
DataNode

Definition at line 55 of file mitkMapper.h.

Constructor & Destructor Documentation

◆ Mapper()

mitk::Mapper::Mapper ( )
explicitprotected

explicit constructor which disallows implicit conversions

◆ ~Mapper()

mitk::Mapper::~Mapper ( )
overrideprotected

virtual destructor in order to derive from this class

Member Function Documentation

◆ ApplyColorAndOpacityProperties()

virtual void mitk::Mapper::ApplyColorAndOpacityProperties ( mitk::BaseRenderer *  renderer,
vtkActor *  actor = nullptr 
)
pure virtual

Apply color and opacity properties read from the PropertyList to the rendering actor.

Reimplemented in GLmapper (does not use the actor) and the VtkMapper class. Called by the individual mapper, typically in ApplyProperties() or ApplyAllProperties().

Parameters
[in]rendererThe renderer whose property list is queried.
[in]actorThe vtkActor to apply color/opacity to. Can be nullptr.

Implemented in mitk::PlanarFigureMapper2D, mitk::ContourModelMapper2DBase, mitk::EnhancedPointSetVtkMapper3D, mitk::VtkMapper, mitk::ROIMapper3D, mitk::ROIMapper2D, mitk::PlanarFigureVtkMapper3D, mitk::BoundingShapeVtkMapper3D, and mitk::BoundingShapeVtkMapper2D.

◆ CalculateTimeStep()

virtual void mitk::Mapper::CalculateTimeStep ( BaseRenderer *  renderer)
protectedvirtual

Updates the time step, which is sometimes needed in subclasses.

◆ GenerateDataForRenderer()

◆ GetDataNode()

virtual DataNode* mitk::Mapper::GetDataNode ( ) const
virtual

Get the DataNode containing the data to map.

Returns a valid DataNode pointer only if the mapper belongs to a data node. Otherwise, the returned pointer might be invalid.

Returns
Pointer to the associated DataNode, or nullptr.

◆ GetTimestep()

TimeStepType mitk::Mapper::GetTimestep ( ) const
inline

Return the current time step as calculated from the renderer.

Returns
The current time step index.

Definition at line 125 of file mitkMapper.h.

◆ IsLODEnabled()

virtual bool mitk::Mapper::IsLODEnabled ( BaseRenderer *  ) const
inlinevirtual

Return whether this Mapper currently allows for Level-of-Detail rendering.

This reflects whether this Mapper currently invokes StartEvent, EndEvent, and ProgressEvent on BaseRenderer.

Returns
true if LOD rendering is enabled, false otherwise. Default is false.

Definition at line 135 of file mitkMapper.h.

◆ mitkClassMacroItkParent()

mitk::Mapper::mitkClassMacroItkParent ( Mapper  ,
itk::Object   
)

◆ MitkRender()

virtual void mitk::Mapper::MitkRender ( mitk::BaseRenderer *  renderer,
mitk::VtkPropRenderer::RenderType  type 
)
pure virtual

Responsible for calling the appropriate render functions.

To be implemented in sub-classes. Called during the rendering pipeline to dispatch to the correct render pass (opaque, translucent, overlay, volumetric).

Parameters
[in]rendererThe renderer to render into.
[in]typeThe render pass type.

Implemented in mitk::PlanarFigureMapper2D, mitk::VtkMapper, mitk::ContourModelSetMapper2D, and mitk::ContourModelMapper2D.

◆ ResetMapper()

virtual void mitk::Mapper::ResetMapper ( BaseRenderer *  )
inlineprotectedvirtual

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 in mitk::GizmoMapper2D, mitk::SurfaceVtkMapper3D, mitk::SurfaceVtkMapper2D, mitk::PointSetVtkMapper3D, and mitk::PointSetVtkMapper2D.

Definition at line 154 of file mitkMapper.h.

◆ SetDataNode()

virtual void mitk::Mapper::SetDataNode ( DataNode *  _arg)
virtual

Set the DataNode containing the data to map.

Parameters
[in]_argPointer to the DataNode.

◆ SetDefaultProperties()

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

Set default values of properties used by this mapper on the given node.

Sets "visible", "layer", and "name" properties with default values.

Parameters
[in]nodeThe node for which the properties are set.
[in]rendererDefines which property list of the node is used (default: nullptr, i.e. the default property list).
[in]overwriteIf true, overwrite existing properties (default: false).

◆ Update()

virtual void mitk::Mapper::Update ( BaseRenderer *  renderer)
virtual

Calculate the time step for the current renderer and generate rendering data.

Calls CalculateTimeStep() to determine the appropriate time step from the renderer, validates it against the data's TimeGeometry, and then calls GenerateDataForRenderer(). If the time step is invalid, ResetMapper() is called instead.

Parameters
[in]rendererThe renderer for which to update the mapper.

Reimplemented in mitk::DoseImageVtkMapper2D, mitk::MultiLabelSegmentationVtkMapper3D, mitk::LabelSetImageVtkMapper2D, mitk::RegEvaluationMapper2D, mitk::ImageVtkMapper2D, mitk::CrosshairVtkMapper2D, mitk::ContourModelSetMapper3D, mitk::ContourModelMapper3D, and mitk::SurfaceVtkMapper2D.

Member Data Documentation

◆ m_DataNode

mitk::DataNode* mitk::Mapper::m_DataNode
protected

Definition at line 155 of file mitkMapper.h.


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