|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Abstract base widget for displaying multiple render windows at once. More...
#include <QmitkAbstractMultiWidget.h>


Public Types | |
| 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... | |
Signals | |
| void | ActiveRenderWindowChanged () |
Public Member Functions | |
| QmitkAbstractMultiWidget (QWidget *parent=0, Qt::WindowFlags f={}, const QString &multiWidgetName="multiwidget") | |
| virtual | ~QmitkAbstractMultiWidget () |
| virtual void | InitializeMultiWidget ()=0 |
| Initialize the multi widget. Must be implemented by subclasses. More... | |
| 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 QmitkRenderWindow * | GetRenderWindow (const QString &widgetName) const |
| Returns the render window with the given widget name. More... | |
| virtual QmitkRenderWindow * | GetRenderWindow (const mitk::AnatomicalPlane &orientation) const =0 |
| Returns the render window that shows the given anatomical orientation. 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 | InitializeViews (const mitk::TimeGeometry *geometry, bool resetCamera)=0 |
| Initialize the render windows of the concrete multi widget to the given geometry. More... | |
| virtual void | SetInteractionReferenceGeometry (const mitk::TimeGeometry *referenceGeometry)=0 |
| Define the reference geometry for interaction within a render window. More... | |
| virtual bool | HasCoupledRenderWindows () const =0 |
| Returns true if the render windows are coupled; false if not. More... | |
| virtual void | SetSelectedPosition (const mitk::Point3D &newPosition, const QString &widgetName)=0 |
| Sets the selected position in the specified render window. More... | |
| virtual const mitk::Point3D | GetSelectedPosition (const QString &widgetName) const =0 |
| Returns the selected position in the specified render window. More... | |
| virtual void | SetCrosshairVisibility (bool visible)=0 |
| Sets the crosshair visibility. More... | |
| virtual bool | GetCrosshairVisibility () const =0 |
| Returns whether the crosshair is currently visible. More... | |
| virtual void | SetCrosshairGap (unsigned int gapSize)=0 |
| Sets the gap size of the crosshair. More... | |
| virtual void | ResetCrosshair ()=0 |
| Resets the crosshair to the default position. More... | |
| virtual void | SetWidgetPlaneMode (int mode)=0 |
| Sets the widget plane mode (e.g., rotation, swivel). 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... | |
Protected Member Functions | |
| 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... | |
Abstract base widget for displaying multiple render windows at once.
QmitkAbstractMultiWidget is a QWidget that can be subclassed to display multiple render windows at once. Render windows can dynamically be added and removed to change the layout of the multi widget. A subclass of this multi widget can be used inside a QmitkAbstractMultiWidgetEditor.
The class uses the DisplayActionEventBroadcast and DisplayActionEventHandler classes to load a state machine and set an event configuration.
Using the Synchronize() function the user can enable or disable the synchronization of display action events.
Definition at line 60 of file QmitkAbstractMultiWidget.h.
| using QmitkAbstractMultiWidget::RenderWindowHash = QHash<QString, QmitkRenderWindow*> |
Convenience type alias for a hash of render windows keyed by name.
Definition at line 71 of file QmitkAbstractMultiWidget.h.
| using QmitkAbstractMultiWidget::RenderWindowWidgetMap = std::map<QString, std::shared_ptr<QmitkRenderWindowWidget> > |
Convenience type alias for a map of render window widgets keyed by name.
Definition at line 69 of file QmitkAbstractMultiWidget.h.
| using QmitkAbstractMultiWidget::RenderWindowWidgetPointer = std::shared_ptr<QmitkRenderWindowWidget> |
Convenience type alias for a shared pointer to a render window widget.
Definition at line 67 of file QmitkAbstractMultiWidget.h.
| QmitkAbstractMultiWidget::QmitkAbstractMultiWidget | ( | QWidget * | parent = 0, |
| Qt::WindowFlags | f = {}, |
||
| const QString & | multiWidgetName = "multiwidget" |
||
| ) |
|
virtual |
|
virtual |
Activates or deactivates the render window menu widget.
| [in] | state | True to activate, false to deactivate. |
|
signal |
|
protectedvirtual |
Adds a render window widget with the given name.
| [in] | widgetName | The name for the new widget. |
| [in] | renderWindowWidget | The render window widget to add. |
| void QmitkAbstractMultiWidget::ForceImmediateUpdate | ( | const QString & | widgetName | ) |
Forces an immediate update of the render window with the given name.
| [in] | widgetName | The widget name. |
| void QmitkAbstractMultiWidget::ForceImmediateUpdateAll | ( | ) |
Forces an immediate update of all render windows.
| RenderWindowWidgetMap QmitkAbstractMultiWidget::Get2DRenderWindowWidgets | ( | ) | const |
Returns all 2D render window widgets.
| RenderWindowWidgetMap QmitkAbstractMultiWidget::Get3DRenderWindowWidgets | ( | ) | const |
Returns all 3D render window widgets.
| RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetActiveRenderWindowWidget | ( | ) | const |
Returns the currently active render window widget.
| int QmitkAbstractMultiWidget::GetColumnCount | ( | ) | const |
Returns the column count of the last SetLayout(r, c) call, or 0 if a non-grid layout has been loaded since.
See GetRowCount for the full semantics.
|
pure virtual |
Returns whether the crosshair is currently visible.
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
| mitk::DataStorage* QmitkAbstractMultiWidget::GetDataStorage | ( | ) | const |
Returns the current data storage.
| mitk::DisplayActionEventHandler* QmitkAbstractMultiWidget::GetDisplayActionEventHandler | ( | ) |
Returns the display action event handler.
| RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetFirstRenderWindowWidget | ( | ) | const |
Returns the first render window widget.
| mitk::InteractionEventHandler* QmitkAbstractMultiWidget::GetInteractionEventHandler | ( | ) |
Returns the interaction event handler.
| RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetLastRenderWindowWidget | ( | ) | const |
Returns the last render window widget.
| QmitkMultiWidgetLayoutManager* QmitkAbstractMultiWidget::GetMultiWidgetLayoutManager | ( | ) | const |
Returns the layout manager for this multi widget.
| QString QmitkAbstractMultiWidget::GetMultiWidgetName | ( | ) | const |
Returns the name of this multi widget.
|
virtual |
Returns the widget name for the given row and column.
| [in] | row | Row index. |
| [in] | column | Column index. |
|
virtual |
Returns the qualified widget name for the given linear index.
For 'index' < current cell count: returns the i-th registered qualified name in map (sorted-by-key) order. Works under any naming scheme, including v2 layouts with custom names.
For 'index' == current cell count: returns the legacy positional name <multiWidgetName>.widget<index>. The call does not register or create anything. This look-ahead is what the configuration toolbar uses to predict the next cell's name.
For 'index' > current cell count: returns an empty QString.
Superseded for new code: the MxN editor's v2 layout pipeline registers render windows by the explicit 'name' field carried in the layout document (see 'QmitkMxNMultiWidget::CreateRenderWindowWidget(const QString&)'). New consumers should look up windows by the registered qualified name (via 'GetRenderWindowWidget(const QString&)') rather than reconstructing it from a positional index.
| [in] | index | The linear index. |
| unsigned int QmitkAbstractMultiWidget::GetNumberOfRenderWindowWidgets | ( | ) | const |
Returns the number of render window widgets.
|
pure virtual |
Returns the render window that shows the given anatomical orientation.
| [in] | orientation | The anatomical plane orientation. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
virtual |
Returns the render window with the given widget name.
| [in] | widgetName | The widget name. |
Reimplemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
| QmitkRenderWindow* QmitkAbstractMultiWidget::GetRenderWindow | ( | int | row, |
| int | column | ||
| ) | const |
Returns the render window at the given row and column.
| [in] | row | Row index. |
| [in] | column | Column index. |
| RenderWindowHash QmitkAbstractMultiWidget::GetRenderWindows | ( | ) | const |
Returns a hash of all render windows keyed by name.
| RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetRenderWindowWidget | ( | const QmitkRenderWindow * | renderWindow | ) | const |
Returns the render window widget that owns the given render window.
| [in] | renderWindow | The render window to search for. |
| RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetRenderWindowWidget | ( | const QString & | widgetName | ) | const |
Returns the render window widget with the given name.
| [in] | widgetName | The widget name. |
| RenderWindowWidgetPointer QmitkAbstractMultiWidget::GetRenderWindowWidget | ( | int | row, |
| int | column | ||
| ) | const |
Returns the render window widget at the given row and column.
| [in] | row | Row index. |
| [in] | column | Column index. |
| RenderWindowWidgetMap QmitkAbstractMultiWidget::GetRenderWindowWidgets | ( | ) | const |
Returns all render window widgets.
| int QmitkAbstractMultiWidget::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).
Callers that need to enumerate cells should use GetNumberOfRenderWindowWidgets() / GetRenderWindowWidgets() rather than this row/column pair, which only describes the regular grid set by SetLayout and is invalidated to 0 when a layout that is not a regular grid takes over.
|
pure virtual |
Returns the selected position in the specified render window.
| [in] | widgetName | The name of the render window widget. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
pure virtual |
Returns true if the render windows are coupled; false if not.
Render windows are coupled if the slice navigation controllers of the render windows are connected, meaning the same geometry is used for the render windows.
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
pure virtual |
Initialize the multi widget. Must be implemented by subclasses.
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
pure virtual |
Initialize the render windows of the concrete multi widget to the given geometry.
The concrete implementation is subclass-specific, no default implementation is provided here.
| [in] | geometry | The geometry to be used to initialize / update the render window's time and slice navigation controller. |
| [in] | resetCamera | If 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. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
virtual |
Returns whether the render window menu widget is enabled.
|
inlinevirtual |
Called when the multi widget is closed. Default implementation does nothing.
Definition at line 84 of file QmitkAbstractMultiWidget.h.
|
inlinevirtual |
Called when the multi widget is opened. Default implementation does nothing.
Definition at line 82 of file QmitkAbstractMultiWidget.h.
|
protectedvirtual |
Removes the last render window widget by reverse map order.
The map is keyed by qualified name (sorted lexicographically), so "removes the last" here means the lexicographically last name. This keeps the call point-free with respect to positional naming, which is what makes it safe for layouts that mix custom and widget<i> names.
|
protectedvirtual |
Removes the render window widget registered under the given qualified name. No-op if no such widget is registered.
| [in] | widgetName | The qualified widget name (as registered via AddRenderWindowWidget). |
| void QmitkAbstractMultiWidget::RequestUpdate | ( | const QString & | widgetName | ) |
Requests an update of the render window with the given name.
| [in] | widgetName | The widget name. |
| void QmitkAbstractMultiWidget::RequestUpdateAll | ( | ) |
Requests an update of all render windows.
|
pure virtual |
Resets the crosshair to the default position.
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
protected |
Reset the grid-layout sentinel: row/column counts to 0 and the active render-window pointer to nullptr.
Called by subclasses immediately before they tear down the existing cell tree (e.g. QmitkMxNMultiWidget::ApplyLayout / SetDataBasedLayout). After this call, GetRowCount() and GetColumnCount() both return 0 to signal that the current cell set is no longer a regular grid; subsequent SetLayout(r, c) calls restore both fields.
|
virtual |
Sets the active render window widget.
| [in] | activeRenderWindowWidget | The widget to set as active. |
Reimplemented in QmitkMxNMultiWidget.
|
pure virtual |
Sets the gap size of the crosshair.
| [in] | gapSize | The gap size in pixels. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
pure virtual |
Sets the crosshair visibility.
| [in] | visible | True to show the crosshair, false to hide it. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
virtual |
Sets the data storage for all render window widgets.
| [in] | dataStorage | Pointer to the data storage. May be nullptr. |
| void QmitkAbstractMultiWidget::SetDisplayActionEventHandler | ( | std::unique_ptr< mitk::DisplayActionEventHandler > | displayActionEventHandler | ) |
Sets the display action event handler.
| [in] | displayActionEventHandler | The event handler to use (ownership is transferred). |
|
pure virtual |
Define the reference geometry for interaction within a render window.
The concrete implementation is subclass-specific, no default implementation is provided here.
| [in] | referenceGeometry | The interaction reference geometry for the base renderer of the concrete multi widget. For more details, see BaseRenderer::SetInteractionReferenceGeometry. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
virtual |
Sets the interaction scheme for the multi widget.
| [in] | scheme | The interaction scheme to use. |
|
virtual |
Sets the layout to the given number of rows and columns.
| [in] | row | Number of rows. |
| [in] | column | Number of columns. |
|
pure virtual |
Sets the selected position in the specified render window.
| [in] | newPosition | The new 3D position. |
| [in] | widgetName | The name of the target render window widget. |
Implemented in QmitkStdMultiWidget, and QmitkMxNMultiWidget.
|
pure virtual |
Sets the widget plane mode (e.g., rotation, swivel).
| [in] | mode | The plane mode identifier. |
Implemented in QmitkMxNMultiWidget, and QmitkStdMultiWidget.
|
inlinevirtual |
Enable or disable synchronization of display action events.
Reimplemented in QmitkMxNMultiWidget.
Definition at line 124 of file QmitkAbstractMultiWidget.h.