Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkStdMultiWidget Class Reference

The 'QmitkStdMultiWidget' is a 'QmitkAbstractMultiWidget' that is used to display multiple render windows at once. Render windows are predefined in a 2x2 design with 3 different 2D view planes and a 3D render window. More...

#include <QmitkStdMultiWidget.h>

Inheritance diagram for QmitkStdMultiWidget:
Collaboration diagram for QmitkStdMultiWidget:

Public Slots

virtual void mousePressEvent (QMouseEvent *) override
 
virtual void moveEvent (QMoveEvent *e) override
 
virtual void wheelEvent (QWheelEvent *e) override
 
void Fit ()
 
void AddDisplayPlaneSubTree ()
 
void EnsureDisplayContainsPoint (mitk::BaseRenderer *renderer, const mitk::Point3D &p)
 
void SetWidgetPlaneVisibility (const char *widgetName, bool visible, mitk::BaseRenderer *renderer=nullptr)
 
void SetWidgetPlanesVisibility (bool visible, mitk::BaseRenderer *renderer=nullptr)
 

Signals

void NotifyCrosshairVisibilityChanged (bool visible)
 
void NotifyCrosshair3DVisibilityChanged (bool visible)
 
void NotifyCrosshairRotationModeChanged (int mode)
 
void WheelMoved (QWheelEvent *)
 
void Moved ()
 
- Signals inherited from QmitkAbstractMultiWidget
void ActiveRenderWindowChanged ()
 

Public Member Functions

 QmitkStdMultiWidget (QWidget *parent=nullptr, Qt::WindowFlags f={}, const QString &name="stdmulti")
 
 ~QmitkStdMultiWidget () override
 
virtual void InitializeMultiWidget () override
 Initialize the multi widget. Must be implemented by subclasses. More...
 
virtual QmitkRenderWindow * GetRenderWindow (const QString &widgetName) const override
 Returns the render window with the given widget name. More...
 
virtual QmitkRenderWindow * GetRenderWindow (const mitk::AnatomicalPlane &orientation) const override
 Returns the render window that shows the given anatomical orientation. More...
 
void InitializeViews (const mitk::TimeGeometry *geometry, bool resetCamera) override
 Initialize all render windows of the StdMultiWidget to the given geometry. Overridem from 'QmitkAbstractMultiWidget'. More...
 
void SetInteractionReferenceGeometry (const mitk::TimeGeometry *referenceGeometry) override
 Not implemented in this class. Overridem from 'QmitkAbstractMultiWidget'. More...
 
bool HasCoupledRenderWindows () const override
 Returns true if the render windows are coupled; false if not. More...
 
virtual void SetSelectedPosition (const mitk::Point3D &newPosition, const QString &widgetName) override
 Sets the selected position in the specified render window. More...
 
virtual const mitk::Point3D GetSelectedPosition (const QString &widgetName) const override
 Returns the selected position in the specified render window. More...
 
virtual void SetCrosshairVisibility (bool) override
 Sets the crosshair visibility. More...
 
virtual bool GetCrosshairVisibility () const override
 Returns whether the crosshair is currently visible. More...
 
void SetCrosshairGap (unsigned int gapSize) override
 Sets the gap size of the crosshair. More...
 
void SetCrosshair3DVisibility (bool visible)
 Set the crosshair visibility in the 3D render window only. More...
 
virtual void ResetCrosshair () override
 Resets the crosshair to the default position. More...
 
virtual void SetWidgetPlaneMode (int mode) override
 Sets the widget plane mode (e.g., rotation, swivel). More...
 
void AddPlanesToDataStorage ()
 
void RemovePlanesFromDataStorage ()
 
QmitkRenderWindow * GetRenderWindow (unsigned int number) const
 Convenience method to get a render window widget. More...
 
QmitkRenderWindow * GetRenderWindow1 () const
 
QmitkRenderWindow * GetRenderWindow2 () const
 
QmitkRenderWindow * GetRenderWindow3 () const
 
QmitkRenderWindow * GetRenderWindow4 () const
 
mitk::DataNode::Pointer GetWidgetPlane (unsigned int number) const
 Convenience method to get a widget plane. More...
 
mitk::DataNode::Pointer GetWidgetPlane1 () const
 
mitk::DataNode::Pointer GetWidgetPlane2 () const
 
mitk::DataNode::Pointer GetWidgetPlane3 () const
 
void SetDecorationColor (unsigned int widgetNumber, mitk::Color color)
 SetDecorationColor Set the color of the decoration of the 4 widgets. More...
 
mitk::Color GetDecorationColor (unsigned int widgetNumber)
 GetDecorationColorForWidget Get the color for annotation, crosshair and rectangle. More...
 
- Public Member Functions inherited from QmitkAbstractMultiWidget
 QmitkAbstractMultiWidget (QWidget *parent=0, Qt::WindowFlags f={}, const QString &multiWidgetName="multiwidget")
 
virtual ~QmitkAbstractMultiWidget ()
 
virtual void MultiWidgetOpened ()
 Called when the multi widget is opened. Default implementation does nothing. More...
 
virtual void MultiWidgetClosed ()
 Called when the multi widget is closed. Default implementation does nothing. More...
 
virtual void SetDataStorage (mitk::DataStorage *dataStorage)
 Sets the data storage for all render window widgets. More...
 
mitk::DataStorage * GetDataStorage () const
 Returns the current data storage. More...
 
int GetRowCount () const
 Returns the row count of the last SetLayout(r, c) call, or 0 if a non-grid layout has been loaded since (e.g. via ApplyLayout or SetDataBasedLayout). More...
 
int GetColumnCount () const
 Returns the column count of the last SetLayout(r, c) call, or 0 if a non-grid layout has been loaded since. More...
 
virtual void SetLayout (int row, int column)
 Sets the layout to the given number of rows and columns. More...
 
virtual void Synchronize (bool)
 Enable or disable synchronization of display action events. More...
 
virtual void SetInteractionScheme (mitk::InteractionSchemeSwitcher::InteractionScheme scheme)
 Sets the interaction scheme for the multi widget. More...
 
mitk::InteractionEventHandler * GetInteractionEventHandler ()
 Returns the interaction event handler. More...
 
void SetDisplayActionEventHandler (std::unique_ptr< mitk::DisplayActionEventHandler > displayActionEventHandler)
 Sets the display action event handler. More...
 
mitk::DisplayActionEventHandler * GetDisplayActionEventHandler ()
 Returns the display action event handler. More...
 
RenderWindowWidgetMap GetRenderWindowWidgets () const
 Returns all render window widgets. More...
 
RenderWindowWidgetMap Get2DRenderWindowWidgets () const
 Returns all 2D render window widgets. More...
 
RenderWindowWidgetMap Get3DRenderWindowWidgets () const
 Returns all 3D render window widgets. More...
 
RenderWindowWidgetPointer GetRenderWindowWidget (int row, int column) const
 Returns the render window widget at the given row and column. More...
 
RenderWindowWidgetPointer GetRenderWindowWidget (const QString &widgetName) const
 Returns the render window widget with the given name. More...
 
RenderWindowWidgetPointer GetRenderWindowWidget (const QmitkRenderWindow *renderWindow) const
 Returns the render window widget that owns the given render window. More...
 
RenderWindowHash GetRenderWindows () const
 Returns a hash of all render windows keyed by name. More...
 
QmitkRenderWindow * GetRenderWindow (int row, int column) const
 Returns the render window at the given row and column. More...
 
virtual void SetActiveRenderWindowWidget (RenderWindowWidgetPointer activeRenderWindowWidget)
 Sets the active render window widget. More...
 
RenderWindowWidgetPointer GetActiveRenderWindowWidget () const
 Returns the currently active render window widget. More...
 
RenderWindowWidgetPointer GetFirstRenderWindowWidget () const
 Returns the first render window widget. More...
 
RenderWindowWidgetPointer GetLastRenderWindowWidget () const
 Returns the last render window widget. More...
 
QString GetMultiWidgetName () const
 Returns the name of this multi widget. More...
 
virtual QString GetNameFromIndex (int row, int column) const
 Returns the widget name for the given row and column. More...
 
virtual QString GetNameFromIndex (size_t index) const
 Returns the qualified widget name for the given linear index. More...
 
unsigned int GetNumberOfRenderWindowWidgets () const
 Returns the number of render window widgets. More...
 
void RequestUpdate (const QString &widgetName)
 Requests an update of the render window with the given name. More...
 
void RequestUpdateAll ()
 Requests an update of all render windows. More...
 
void ForceImmediateUpdate (const QString &widgetName)
 Forces an immediate update of the render window with the given name. More...
 
void ForceImmediateUpdateAll ()
 Forces an immediate update of all render windows. More...
 
virtual void ActivateMenuWidget (bool state)
 Activates or deactivates the render window menu widget. More...
 
virtual bool IsMenuWidgetEnabled () const
 Returns whether the render window menu widget is enabled. More...
 
QmitkMultiWidgetLayoutManager * GetMultiWidgetLayoutManager () const
 Returns the layout manager for this multi widget. More...
 

Additional Inherited Members

- Public Types inherited from QmitkAbstractMultiWidget
using RenderWindowWidgetPointer = std::shared_ptr< QmitkRenderWindowWidget >
 Convenience type alias for a shared pointer to a render window widget. More...
 
using RenderWindowWidgetMap = std::map< QString, std::shared_ptr< QmitkRenderWindowWidget > >
 Convenience type alias for a map of render window widgets keyed by name. More...
 
using RenderWindowHash = QHash< QString, QmitkRenderWindow * >
 Convenience type alias for a hash of render windows keyed by name. More...
 
- Protected Member Functions inherited from QmitkAbstractMultiWidget
virtual void AddRenderWindowWidget (const QString &widgetName, RenderWindowWidgetPointer renderWindowWidget)
 Adds a render window widget with the given name. More...
 
virtual void RemoveRenderWindowWidget ()
 Removes the last render window widget by reverse map order. More...
 
virtual void RemoveRenderWindowWidget (const QString &widgetName)
 Removes the render window widget registered under the given qualified name. No-op if no such widget is registered. More...
 
void ResetGridState ()
 Reset the grid-layout sentinel: row/column counts to 0 and the active render-window pointer to nullptr. More...
 

Detailed Description

The 'QmitkStdMultiWidget' is a 'QmitkAbstractMultiWidget' that is used to display multiple render windows at once. Render windows are predefined in a 2x2 design with 3 different 2D view planes and a 3D render window.

Definition at line 24 of file QmitkStdMultiWidget.h.

Constructor & Destructor Documentation

◆ QmitkStdMultiWidget()

QmitkStdMultiWidget::QmitkStdMultiWidget ( QWidget *  parent = nullptr,
Qt::WindowFlags  f = {},
const QString &  name = "stdmulti" 
)

◆ ~QmitkStdMultiWidget()

QmitkStdMultiWidget::~QmitkStdMultiWidget ( )
override

Member Function Documentation

◆ AddDisplayPlaneSubTree

void QmitkStdMultiWidget::AddDisplayPlaneSubTree ( )
slot

◆ AddPlanesToDataStorage()

void QmitkStdMultiWidget::AddPlanesToDataStorage ( )

◆ EnsureDisplayContainsPoint

void QmitkStdMultiWidget::EnsureDisplayContainsPoint ( mitk::BaseRenderer *  renderer,
const mitk::Point3D &  p 
)
slot

◆ Fit

void QmitkStdMultiWidget::Fit ( )
slot

◆ GetCrosshairVisibility()

virtual bool QmitkStdMultiWidget::GetCrosshairVisibility ( ) const
overridevirtual

Returns whether the crosshair is currently visible.

Implements QmitkAbstractMultiWidget.

◆ GetDecorationColor()

mitk::Color QmitkStdMultiWidget::GetDecorationColor ( unsigned int  widgetNumber)

GetDecorationColorForWidget Get the color for annotation, crosshair and rectangle.

Parameters
widgetNumberNumber of the renderwindow (0-3).
Returns
Color in mitk format.

◆ GetRenderWindow() [1/3]

virtual QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow ( const mitk::AnatomicalPlane &  orientation) const
overridevirtual

Returns the render window that shows the given anatomical orientation.

Parameters
[in]orientationThe anatomical plane orientation.
Returns
Pointer to the render window, or nullptr if not found.

Implements QmitkAbstractMultiWidget.

◆ GetRenderWindow() [2/3]

virtual QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow ( const QString &  widgetName) const
overridevirtual

Returns the render window with the given widget name.

Parameters
[in]widgetNameThe widget name.
Returns
Pointer to the render window, or nullptr if not found.

Reimplemented from QmitkAbstractMultiWidget.

◆ GetRenderWindow() [3/3]

QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow ( unsigned int  number) const

Convenience method to get a render window widget.

Parameters
numberof the widget (0-3)
Returns
The render window widget

◆ GetRenderWindow1()

QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow1 ( ) const

◆ GetRenderWindow2()

QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow2 ( ) const

◆ GetRenderWindow3()

QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow3 ( ) const

◆ GetRenderWindow4()

QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow4 ( ) const

◆ GetSelectedPosition()

virtual const mitk::Point3D QmitkStdMultiWidget::GetSelectedPosition ( const QString &  widgetName) const
overridevirtual

Returns the selected position in the specified render window.

Parameters
[in]widgetNameThe name of the render window widget.
Returns
The currently selected 3D position.

Implements QmitkAbstractMultiWidget.

◆ GetWidgetPlane()

mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane ( unsigned int  number) const

Convenience method to get a widget plane.

Parameters
numberof the widget plane (1-3)
Returns
The widget plane as data node

◆ GetWidgetPlane1()

mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane1 ( ) const

◆ GetWidgetPlane2()

mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane2 ( ) const

◆ GetWidgetPlane3()

mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane3 ( ) const

◆ HasCoupledRenderWindows()

bool QmitkStdMultiWidget::HasCoupledRenderWindows ( ) const
overridevirtual

Returns true if the render windows are coupled; false if not.

For the StdMultiWidget the render windows are typically coupled.

Implements QmitkAbstractMultiWidget.

◆ InitializeMultiWidget()

virtual void QmitkStdMultiWidget::InitializeMultiWidget ( )
overridevirtual

Initialize the multi widget. Must be implemented by subclasses.

Implements QmitkAbstractMultiWidget.

◆ InitializeViews()

void QmitkStdMultiWidget::InitializeViews ( const mitk::TimeGeometry *  geometry,
bool  resetCamera 
)
overridevirtual

Initialize all render windows of the StdMultiWidget to the given geometry. Overridem from 'QmitkAbstractMultiWidget'.

Parameters
geometryThe geometry to be used to initialize / update all render window's time and slice navigation controller.
resetCameraIf true, the camera and crosshair will be reset to the default view (centered, no zoom). If false, the current crosshair position and the camera zoom will be stored and reset after the reference geometry has been updated.

Implements QmitkAbstractMultiWidget.

◆ mousePressEvent

virtual void QmitkStdMultiWidget::mousePressEvent ( QMouseEvent *  )
overridevirtualslot

◆ Moved

void QmitkStdMultiWidget::Moved ( )
signal

◆ moveEvent

virtual void QmitkStdMultiWidget::moveEvent ( QMoveEvent *  e)
overridevirtualslot

◆ NotifyCrosshair3DVisibilityChanged

void QmitkStdMultiWidget::NotifyCrosshair3DVisibilityChanged ( bool  visible)
signal

◆ NotifyCrosshairRotationModeChanged

void QmitkStdMultiWidget::NotifyCrosshairRotationModeChanged ( int  mode)
signal

◆ NotifyCrosshairVisibilityChanged

void QmitkStdMultiWidget::NotifyCrosshairVisibilityChanged ( bool  visible)
signal

◆ RemovePlanesFromDataStorage()

void QmitkStdMultiWidget::RemovePlanesFromDataStorage ( )

◆ ResetCrosshair()

virtual void QmitkStdMultiWidget::ResetCrosshair ( )
overridevirtual

Resets the crosshair to the default position.

Implements QmitkAbstractMultiWidget.

◆ SetCrosshair3DVisibility()

void QmitkStdMultiWidget::SetCrosshair3DVisibility ( bool  visible)

Set the crosshair visibility in the 3D render window only.

Sets the 'visible' property of the three plane nodes on the 3D render window's renderer-specific property list, which takes precedence over the general property list. This leaves the crosshair visibility in the 2D render windows untouched.

◆ SetCrosshairGap()

void QmitkStdMultiWidget::SetCrosshairGap ( unsigned int  gapSize)
overridevirtual

Sets the gap size of the crosshair.

Parameters
[in]gapSizeThe gap size in pixels.

Implements QmitkAbstractMultiWidget.

◆ SetCrosshairVisibility()

virtual void QmitkStdMultiWidget::SetCrosshairVisibility ( bool  visible)
overridevirtual

Sets the crosshair visibility.

Parameters
[in]visibleTrue to show the crosshair, false to hide it.

Implements QmitkAbstractMultiWidget.

◆ SetDecorationColor()

void QmitkStdMultiWidget::SetDecorationColor ( unsigned int  widgetNumber,
mitk::Color  color 
)

SetDecorationColor Set the color of the decoration of the 4 widgets.

This is used to color the frame of the renderwindow and the corner annatation. For the first 3 widgets, this color is a property of the helper object nodes which contain the respective plane geometry. For widget 4, this is a member, since there is no data node for this widget.

◆ SetInteractionReferenceGeometry()

void QmitkStdMultiWidget::SetInteractionReferenceGeometry ( const mitk::TimeGeometry *  referenceGeometry)
overridevirtual

Not implemented in this class. Overridem from 'QmitkAbstractMultiWidget'.

Implements QmitkAbstractMultiWidget.

◆ SetSelectedPosition()

virtual void QmitkStdMultiWidget::SetSelectedPosition ( const mitk::Point3D &  newPosition,
const QString &  widgetName 
)
overridevirtual

Sets the selected position in the specified render window.

Parameters
[in]newPositionThe new 3D position.
[in]widgetNameThe name of the target render window widget.

Implements QmitkAbstractMultiWidget.

◆ SetWidgetPlaneMode()

virtual void QmitkStdMultiWidget::SetWidgetPlaneMode ( int  mode)
overridevirtual

Sets the widget plane mode (e.g., rotation, swivel).

Parameters
[in]modeThe plane mode identifier.

Implements QmitkAbstractMultiWidget.

◆ SetWidgetPlanesVisibility

void QmitkStdMultiWidget::SetWidgetPlanesVisibility ( bool  visible,
mitk::BaseRenderer *  renderer = nullptr 
)
slot

◆ SetWidgetPlaneVisibility

void QmitkStdMultiWidget::SetWidgetPlaneVisibility ( const char *  widgetName,
bool  visible,
mitk::BaseRenderer *  renderer = nullptr 
)
slot

◆ wheelEvent

virtual void QmitkStdMultiWidget::wheelEvent ( QWheelEvent *  e)
overridevirtualslot

◆ WheelMoved

void QmitkStdMultiWidget::WheelMoved ( QWheelEvent *  )
signal

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