Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkScalarBarOverlay Class Reference

Overlay displaying a scale bar in a render window. More...

#include <QmitkScalarBarOverlay.h>

Inheritance diagram for QmitkScalarBarOverlay:
Collaboration diagram for QmitkScalarBarOverlay:

Public Member Functions

 QmitkScalarBarOverlay (const char *id)
 Constructor. Creates the internal QmitkScalarBar widget. More...
 
 ~QmitkScalarBarOverlay () override
 Destructor. Removes the property observer. More...
 
void GenerateData (mitk::PropertyList::Pointer pl) override
 Configures the scalar bar overlay from the given PropertyList. More...
 
QSize GetNeededSize () override
 Returns the current size of the scalar bar widget. More...
 
- Public Member Functions inherited from QmitkOverlay
 QmitkOverlay (const char *id)
 Constructor. More...
 
 ~QmitkOverlay () override
 Destructor. Deletes the internal widget unless it was set externally. More...
 
virtual void SetPosition (DisplayPosition pos)
 Sets the display position of this overlay. More...
 
virtual DisplayPosition GetPosition ()
 Returns the current display position. More...
 
virtual void SetLayer (unsigned int layer)
 Sets the stacking layer of this overlay. More...
 
virtual unsigned int GetLayer ()
 Returns the current stacking layer. More...
 
virtual QWidget * GetWidget ()
 Returns the internal QWidget representing this overlay. More...
 

Protected Member Functions

void GetProperties (mitk::PropertyList::Pointer pl)
 Reads visual properties (color) from the PropertyList and applies them. More...
 
void SetupCallback (mitk::BaseProperty::Pointer prop)
 Sets up an ITK observer on the given property to auto-update the scale factor. More...
 
void SetScaleFactor ()
 Reads the scale factor property and applies it to the scalar bar. More...
 
- Protected Member Functions inherited from QmitkOverlay
void AddDropShadow (QWidget *widget)
 Adds a drop shadow graphics effect to the given widget. More...
 

Protected Attributes

QmitkScalarBar * m_ScalarBar
 The internal QmitkScalarBar widget. More...
 
mitk::BaseProperty::Pointer m_ObservedProperty
 The observed property for automatic updates. More...
 
mitk::PropertyList::Pointer m_PropertyList
 Cached PropertyList for property lookups. More...
 
unsigned long m_ObserverTag
 ITK observer tag for the property modification callback. More...
 
- Protected Attributes inherited from QmitkOverlay
const char * m_Id
 ID of the overlay, used as property key for lookups. More...
 
DisplayPosition m_Position
 Current display position of the overlay. More...
 
unsigned int m_Layer
 Stacking layer of the overlay. More...
 
QWidget * m_Widget
 Internal QWidget representing the overlay content. More...
 
bool m_WidgetIsCustom
 Flag indicating whether the widget was set externally (custom overlay). More...
 

Additional Inherited Members

- Public Types inherited from QmitkOverlay
enum  DisplayPosition {
  top_Left , top_Center , top_Right , middle_Left ,
  middle_Right , bottom_Left , bottom_Center , bottom_Right
}
 Enumeration of all possible display positions in a render window. More...
 

Detailed Description

Overlay displaying a scale bar in a render window.

This overlay wraps a QmitkScalarBar widget and configures it based on properties from a mitk::PropertyList. The scale factor is read from the property identified by the overlay's ID (as a float property), and the color is read from the "overlay.color" property.

The overlay registers an observer on the scale property so that the bar updates automatically when the property value changes.

See also
QmitkScalarBar
QmitkOverlay
QmitkTextOverlay

Definition at line 41 of file QmitkScalarBarOverlay.h.

Constructor & Destructor Documentation

◆ QmitkScalarBarOverlay()

QmitkScalarBarOverlay::QmitkScalarBarOverlay ( const char *  id)

Constructor. Creates the internal QmitkScalarBar widget.

Parameters
[in]idString identifier used to look up the scale factor property.

◆ ~QmitkScalarBarOverlay()

QmitkScalarBarOverlay::~QmitkScalarBarOverlay ( )
override

Destructor. Removes the property observer.

Member Function Documentation

◆ GenerateData()

void QmitkScalarBarOverlay::GenerateData ( mitk::PropertyList::Pointer  pl)
overridevirtual

Configures the scalar bar overlay from the given PropertyList.

Reads overlay-specific properties (color, scale factor) and sets up an observer for automatic updates when the scale property changes.

Parameters
[in]plThe PropertyList containing the configuration properties.

Reimplemented from QmitkOverlay.

◆ GetNeededSize()

QSize QmitkScalarBarOverlay::GetNeededSize ( )
overridevirtual

Returns the current size of the scalar bar widget.

Returns
The QSize of the internal widget.

Implements QmitkOverlay.

◆ GetProperties()

void QmitkScalarBarOverlay::GetProperties ( mitk::PropertyList::Pointer  pl)
protected

Reads visual properties (color) from the PropertyList and applies them.

Reads the "overlay.color" property and configures the pen of the internal QmitkScalarBar accordingly. Falls back to a default color if the property is missing.

Parameters
[in]plThe PropertyList to read properties from.

◆ SetScaleFactor()

void QmitkScalarBarOverlay::SetScaleFactor ( )
protected

Reads the scale factor property and applies it to the scalar bar.

The scale factor is read from the property identified by m_Id. Falls back to a default value of 2 if the property is not found.

◆ SetupCallback()

void QmitkScalarBarOverlay::SetupCallback ( mitk::BaseProperty::Pointer  prop)
protected

Sets up an ITK observer on the given property to auto-update the scale factor.

Parameters
[in]propThe property to observe for modifications.

Member Data Documentation

◆ m_ObservedProperty

mitk::BaseProperty::Pointer QmitkScalarBarOverlay::m_ObservedProperty
protected

The observed property for automatic updates.

Definition at line 100 of file QmitkScalarBarOverlay.h.

◆ m_ObserverTag

unsigned long QmitkScalarBarOverlay::m_ObserverTag
protected

ITK observer tag for the property modification callback.

Definition at line 106 of file QmitkScalarBarOverlay.h.

◆ m_PropertyList

mitk::PropertyList::Pointer QmitkScalarBarOverlay::m_PropertyList
protected

Cached PropertyList for property lookups.

Definition at line 103 of file QmitkScalarBarOverlay.h.

◆ m_ScalarBar

QmitkScalarBar* QmitkScalarBarOverlay::m_ScalarBar
protected

The internal QmitkScalarBar widget.

Definition at line 97 of file QmitkScalarBarOverlay.h.


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