Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkOverlay Class Referenceabstract

Abstract base class for all Qt-based overlay widgets in MITK. More...

#include <QmitkOverlay.h>

Inheritance diagram for QmitkOverlay:
Collaboration diagram for QmitkOverlay:

Public Types

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

Public Member Functions

 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 void GenerateData (mitk::PropertyList::Pointer pl)
 Configures the overlay using properties from the given PropertyList. More...
 
virtual QWidget * GetWidget ()
 Returns the internal QWidget representing this overlay. More...
 
virtual QSize GetNeededSize ()=0
 Returns the minimum size needed to fully display this overlay. More...
 

Protected Member Functions

void AddDropShadow (QWidget *widget)
 Adds a drop shadow graphics effect to the given widget. More...
 

Protected Attributes

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

Detailed Description

Abstract base class for all Qt-based overlay widgets in MITK.

This class is the basis for all classes representing objects that can be visualized as overlays in MITK render windows. It encapsulates an ID, a display-position, and a layer.

The ID is used to access mitkProperties in a PropertyList that holds information needed for the visualization, e.g. text for TextOverlays or scaleFactor for ScalarBarOverlays.

The display-position encodes where on the screen the overlay will be positioned at (see and USE the constants defined by DisplayPosition):

* 0 - 1 - 2
* |   |   |
* 3 -   - 4
* |   |   |
* 5 - 6 - 7
* 

The layer is needed if several overlays shall be put in the same position. In this case the layer defines the order in which the objects are laid out.

See also
QmitkOverlayController
QmitkTextOverlay
QmitkScalarBarOverlay
QmitkCustomWidgetOverlay

Definition at line 54 of file QmitkOverlay.h.

Member Enumeration Documentation

◆ DisplayPosition

Enumeration of all possible display positions in a render window.

Positions are arranged in a 3x3 grid (excluding the center cell): top-left(0), top-center(1), top-right(2), middle-left(3), middle-right(4), bottom-left(5), bottom-center(6), bottom-right(7).

Enumerator
top_Left 

Top-left corner position.

top_Center 

Top-center position.

top_Right 

Top-right corner position.

middle_Left 

Middle-left position.

middle_Right 

Middle-right position.

bottom_Left 

Bottom-left corner position.

bottom_Center 

Bottom-center position.

bottom_Right 

Bottom-right corner position.

Definition at line 66 of file QmitkOverlay.h.

Constructor & Destructor Documentation

◆ QmitkOverlay()

QmitkOverlay::QmitkOverlay ( const char *  id)

Constructor.

Parameters
[in]idString identifier used to look up overlay properties in a PropertyList.

◆ ~QmitkOverlay()

QmitkOverlay::~QmitkOverlay ( )
override

Destructor. Deletes the internal widget unless it was set externally.

Member Function Documentation

◆ AddDropShadow()

void QmitkOverlay::AddDropShadow ( QWidget *  widget)
protected

Adds a drop shadow graphics effect to the given widget.

Parameters
[in]widgetThe widget to add the shadow effect to.

◆ GenerateData()

virtual void QmitkOverlay::GenerateData ( mitk::PropertyList::Pointer  pl)
virtual

Configures the overlay using properties from the given PropertyList.

Subclasses override this to extract relevant properties (e.g. text, scale factor) from the PropertyList and apply them to the internal widget.

Parameters
[in]plThe PropertyList containing overlay configuration properties.

Reimplemented in QmitkTextOverlay, and QmitkScalarBarOverlay.

◆ GetLayer()

virtual unsigned int QmitkOverlay::GetLayer ( )
virtual

Returns the current stacking layer.

Returns
The layer index.

◆ GetNeededSize()

virtual QSize QmitkOverlay::GetNeededSize ( )
pure virtual

Returns the minimum size needed to fully display this overlay.

Returns
The needed QSize.

Implemented in QmitkTextOverlay, QmitkScalarBarOverlay, and QmitkCustomWidgetOverlay.

◆ GetPosition()

virtual DisplayPosition QmitkOverlay::GetPosition ( )
virtual

Returns the current display position.

Returns
The DisplayPosition of this overlay.

◆ GetWidget()

virtual QWidget* QmitkOverlay::GetWidget ( )
virtual

Returns the internal QWidget representing this overlay.

Returns
Pointer to the QWidget, or nullptr if none has been created.

◆ SetLayer()

virtual void QmitkOverlay::SetLayer ( unsigned int  layer)
virtual

Sets the stacking layer of this overlay.

Parameters
[in]layerThe layer index (lower values are rendered first).

◆ SetPosition()

virtual void QmitkOverlay::SetPosition ( DisplayPosition  pos)
virtual

Sets the display position of this overlay.

Parameters
[in]posThe desired position in the render window.

Member Data Documentation

◆ m_Id

const char* QmitkOverlay::m_Id
protected

ID of the overlay, used as property key for lookups.

Definition at line 141 of file QmitkOverlay.h.

◆ m_Layer

unsigned int QmitkOverlay::m_Layer
protected

Stacking layer of the overlay.

Definition at line 147 of file QmitkOverlay.h.

◆ m_Position

DisplayPosition QmitkOverlay::m_Position
protected

Current display position of the overlay.

Definition at line 144 of file QmitkOverlay.h.

◆ m_Widget

QWidget* QmitkOverlay::m_Widget
protected

Internal QWidget representing the overlay content.

Definition at line 150 of file QmitkOverlay.h.

◆ m_WidgetIsCustom

bool QmitkOverlay::m_WidgetIsCustom
protected

Flag indicating whether the widget was set externally (custom overlay).

Definition at line 153 of file QmitkOverlay.h.


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