Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ContourModelMapper2D Class Reference

OpenGL-based mapper to display a mitk::ContourModel in a 2D render window. More...

#include <mitkContourModelMapper2D.h>

Inheritance diagram for mitk::ContourModelMapper2D:
Collaboration diagram for mitk::ContourModelMapper2D:

Public Member Functions

 mitkClassMacro (ContourModelMapper2D, ContourModelMapper2DBase)
 
Pointer Clone () const
 
void MitkRender (BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override
 Perform the rendering of the contour model. More...
 
- Public Member Functions inherited from mitk::ContourModelMapper2DBase
 mitkClassMacro (ContourModelMapper2DBase, Mapper)
 
void ApplyColorAndOpacityProperties (mitk::BaseRenderer *renderer, vtkActor *actor=nullptr) override
 Apply color and opacity properties from the data node to the rendering context. More...
 
- Public Member Functions inherited from mitk::Mapper
 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...
 
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 Pointer New ()
 
static void SetDefaultProperties (mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
 Set default rendering properties for ContourModel nodes. More...
 
- Static Public Member Functions inherited from mitk::Mapper
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...
 

Public Attributes

LocalStorageHandler< BaseLocalStorage > m_LSH
 Local storage handler for per-renderer data. More...
 

Protected Member Functions

 ContourModelMapper2D ()
 
 ~ContourModelMapper2D () override
 
- Protected Member Functions inherited from mitk::ContourModelMapper2DBase
 ContourModelMapper2DBase ()
 
 ~ContourModelMapper2DBase () override
 
void DrawContour (mitk::ContourModel *contour, mitk::BaseRenderer *renderer)
 
void WriteTextWithAnnotation (TextAnnotationPointerType textAnnotation, const char *text, float rgb[3], Point2D pt2d, mitk::BaseRenderer *)
 
virtual void InternalDrawContour (mitk::ContourModel *renderingContour, mitk::BaseRenderer *renderer)
 
- 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 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::ContourModel::Pointer m_SubdivisionContour
 
bool m_InitSubdivisionCurve
 
- Protected Attributes inherited from mitk::ContourModelMapper2DBase
TextAnnotationPointerType m_PointNumbersAnnotation
 
TextAnnotationPointerType m_ControlPointNumbersAnnotation
 
RendererListType m_RendererList
 
- Protected Attributes inherited from mitk::Mapper
mitk::DataNode * m_DataNode
 

Additional Inherited Members

- Protected Types inherited from mitk::ContourModelMapper2DBase
typedef TextAnnotation2D::Pointer TextAnnotationPointerType
 
typedef std::vector< BaseRenderer * > RendererListType
 

Detailed Description

OpenGL-based mapper to display a mitk::ContourModel in a 2D render window.

Renders a ContourModel by projecting its vertices onto the current 2D slice and drawing line segments between them using OpenGL primitives. Supports optional subdivision curve smoothing via the "subdivision curve" property.

Properties evaluated by this mapper:

  • "contour.color": line color (default: yellow-green)
  • "contour.points.color": point marker color
  • "contour.width": line width in pixels
  • "contour.points.show": show point markers
  • "contour.controlpoints.show": show control point markers
  • "subdivision curve": enable DLG subdivision smoothing
See also
ContourModel, ContourModelMapper2DBase, ContourModelMapper3D

Definition at line 44 of file mitkContourModelMapper2D.h.

Constructor & Destructor Documentation

◆ ContourModelMapper2D()

mitk::ContourModelMapper2D::ContourModelMapper2D ( )
protected

◆ ~ContourModelMapper2D()

mitk::ContourModelMapper2D::~ContourModelMapper2D ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::ContourModelMapper2D::Clone ( ) const

◆ mitkClassMacro()

mitk::ContourModelMapper2D::mitkClassMacro ( ContourModelMapper2D  ,
ContourModelMapper2DBase   
)

◆ MitkRender()

void mitk::ContourModelMapper2D::MitkRender ( BaseRenderer *  renderer,
mitk::VtkPropRenderer::RenderType  type 
)
overridevirtual

Perform the rendering of the contour model.

Projects the contour onto the current 2D slice and draws it. If the "subdivision curve" property is enabled, the contour is first smoothed using a ContourModelSubDivisionFilter.

Parameters
[in]rendererThe renderer for the current render window.
[in]typeThe render type (opaque, transparent, overlay).

Implements mitk::Mapper.

◆ New()

static Pointer mitk::ContourModelMapper2D::New ( )
static

◆ SetDefaultProperties()

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

Set default rendering properties for ContourModel nodes.

Parameters
[in]nodeThe data node to configure.
[in]rendererThe renderer context. If nullptr, properties are set globally.
[in]overwriteIf true, existing properties are overwritten.

Member Data Documentation

◆ m_InitSubdivisionCurve

bool mitk::ContourModelMapper2D::m_InitSubdivisionCurve
protected

Definition at line 80 of file mitkContourModelMapper2D.h.

◆ m_LSH

LocalStorageHandler<BaseLocalStorage> mitk::ContourModelMapper2D::m_LSH

Local storage handler for per-renderer data.

Definition at line 72 of file mitkContourModelMapper2D.h.

◆ m_SubdivisionContour

mitk::ContourModel::Pointer mitk::ContourModelMapper2D::m_SubdivisionContour
protected

Definition at line 79 of file mitkContourModelMapper2D.h.


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