Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSynchronizedWidgetConnector Class Reference

This class connects different 'QmitkSynchronizedNodeSelectionWidget', such that they can synchronize their current node selection and their current selection mode. More...

#include <QmitkSynchronizedWidgetConnector.h>

Inheritance diagram for QmitkSynchronizedWidgetConnector:
Collaboration diagram for QmitkSynchronizedWidgetConnector:

Public Types

using NodeList = QmitkSynchronizedNodeSelectionWidget::NodeList
 

Public Slots

void ChangeSelection (NodeList nodes)
 Set a new internal selection and send this new selection to connected QmitkSynchronizedNodeSelectionWidgets using the 'NodeSelectionChanged'-signal. More...
 
void ChangeSelectionMode (bool selectAll)
 Set a new selection mode and send this new selection mode to connected QmitkSynchronizedNodeSelectionWidgets using the 'SelectionModeChanged'-signal. More...
 
void OnNodeVisibilityChanged (mitk::DataNode::Pointer node, bool visibility)
 When the visibility of a node is changed in a connected widget, update the internal set of invisible selected nodes. This information is needed to fully synchronize newly connected widgets. More...
 
void DeregisterWidget ()
 Decrease the internal counter of connections to keep track of how many QmitkSynchronizedNodeSelectionWidgets are synchronized. More...
 

Signals

void NodeSelectionChanged (NodeList nodes)
 A signal that will be emitted by the 'ChangeSelection'-slot. This happens if a new selection / list of nodes is set from outside of this class, e.g. from a QmitkSynchronizedNodeSelectionWidget. This signal is connected to the 'SetCurrentSelection'-slot of each QmitkSynchronizedNodeSelectionWidget to propagate the new selection. More...
 
void SelectionModeChanged (bool selectAll)
 A signal that will be emitted by the 'ChangeSelectionMode'-slot. This happens if the selection mode is change from outside of this class, e.g. from a QmitkSynchronizedNodeSelectionWidget. This signal is connected to the 'SetSelectAll'-slot of each QmitkSynchronizedNodeSelectionWidget to propagate the selection mode. More...
 
void NodeVisibilityChanged (mitk::DataNode::Pointer node, const bool visibility)
 
void NodesLayerMoved (QSet< mitk::DataNode * > movedNodes, const int targetLayer)
 

Public Member Functions

 QmitkSynchronizedWidgetConnector ()
 
void ConnectWidget (const QmitkSynchronizedNodeSelectionWidget *nodeSelectionWidget)
 This function connects the different signals and slots of this instance and the given given node selection widget, such that changes to the current list of nodes and the selection mode can be forwarded or received. The connections are as follows: More...
 
void DisconnectWidget (const QmitkSynchronizedNodeSelectionWidget *nodeSelectionWidget)
 This function disconnects the different signals and slot of this instance and the given given node selection widget, such that changes to the current list of nodes and the selection mode cannot be forwarded or received anymore. More...
 
void SynchronizeWidget (QmitkSynchronizedNodeSelectionWidget *nodeSelectionWidget) const
 This function sets the current selection and the selection mode of the given node selection widget to the values of this instance. The required values are stored in this class internally. It can be used to newly initialize the given node selection widget. More...
 
NodeList GetNodeSelection () const
 Get the current internal node selection. More...
 
bool GetSelectionMode () const
 Get the current internal selection mode. More...
 

Protected Member Functions

void SeedFromMember (const NodeList &seedSelection, const mitk::BaseRenderer *seedRenderer)
 Seed this connector's runtime selection from a designated member cell. More...
 

Detailed Description

This class connects different 'QmitkSynchronizedNodeSelectionWidget', such that they can synchronize their current node selection and their current selection mode.

In order to synchronize a new node selection widget with other already connected node selection widgets, 'ConnectWidget(const QmitkSynchronizedNodeSelectionWidget*)' has to be used. In order to desynchronize a node selection widget, 'DisconnectWidget(const QmitkSynchronizedNodeSelectionWidget*)' has to be used. If a new node selection has been connected / synchronized, 'SynchronizeWidget(QmitkSynchronizedNodeSelectionWidget*' can be used to initially set the current selection and the current selection mode. For this, both values are stored in this class internally.

Note
Per-renderer node properties this connector fans out via per-cell writes:

Connector-internal state (NOT fanned out via per-renderer property writes):

  • selection list (m_InternalSelection)
  • select_all mode (m_SelectAll)
  • invisibles set (m_InternalInvisibles)

Selection-list membership is propagated to other widgets via the NodeSelectionChanged signal, not via per-renderer writes - selection is a runtime concept tracked at the widget level. select_all is group-scoped and authored in the layout document; the protected SeedFromMember entry deliberately does NOT touch it.

Definition at line 59 of file QmitkSynchronizedWidgetConnector.h.

Member Typedef Documentation

◆ NodeList

Constructor & Destructor Documentation

◆ QmitkSynchronizedWidgetConnector()

QmitkSynchronizedWidgetConnector::QmitkSynchronizedWidgetConnector ( )

Member Function Documentation

◆ ChangeSelection

void QmitkSynchronizedWidgetConnector::ChangeSelection ( NodeList  nodes)
slot

Set a new internal selection and send this new selection to connected QmitkSynchronizedNodeSelectionWidgets using the 'NodeSelectionChanged'-signal.

This slot itself is connected to the 'CurrentSelectionChanged'-signal of each QmitkSynchronizedNodeSelectionWidget to receive a new selection.

Parameters
nodesA list of data nodes that are newly selected.

◆ ChangeSelectionMode

void QmitkSynchronizedWidgetConnector::ChangeSelectionMode ( bool  selectAll)
slot

Set a new selection mode and send this new selection mode to connected QmitkSynchronizedNodeSelectionWidgets using the 'SelectionModeChanged'-signal.

This slot itself is connected to the 'SelectionModeChanged'-signal of each QmitkSynchronizedNodeSelectionWidget to receive a new selection mode.

Parameters
selectAllTrue, if the selection mode is changed to "select all" nodes. False otherwise.

◆ ConnectWidget()

void QmitkSynchronizedWidgetConnector::ConnectWidget ( const QmitkSynchronizedNodeSelectionWidget *  nodeSelectionWidget)

This function connects the different signals and slots of this instance and the given given node selection widget, such that changes to the current list of nodes and the selection mode can be forwarded or received. The connections are as follows:

Parameters
nodeSelectionWidgetThe synchronized node selection widget to be connected / synchronized.

◆ DeregisterWidget

void QmitkSynchronizedWidgetConnector::DeregisterWidget ( )
slot

Decrease the internal counter of connections to keep track of how many QmitkSynchronizedNodeSelectionWidgets are synchronized.

This slot itself is connected to the 'DeregisterSynchronization'-signal of each QmitkSynchronizedNodeSelectionWidget to get notified when a synchronized widget is deleted.

◆ DisconnectWidget()

void QmitkSynchronizedWidgetConnector::DisconnectWidget ( const QmitkSynchronizedNodeSelectionWidget *  nodeSelectionWidget)

This function disconnects the different signals and slot of this instance and the given given node selection widget, such that changes to the current list of nodes and the selection mode cannot be forwarded or received anymore.

Parameters
nodeSelectionWidgetThe synchronized node selection widget to be disconnected / desynchronized.

◆ GetNodeSelection()

NodeList QmitkSynchronizedWidgetConnector::GetNodeSelection ( ) const

Get the current internal node selection.

Returns
NodeList The current internal node selection stored as a member variable.

◆ GetSelectionMode()

bool QmitkSynchronizedWidgetConnector::GetSelectionMode ( ) const

Get the current internal selection mode.

Returns
The current internal selection mode stored as a member variable.

◆ NodeSelectionChanged

void QmitkSynchronizedWidgetConnector::NodeSelectionChanged ( NodeList  nodes)
signal

A signal that will be emitted by the 'ChangeSelection'-slot. This happens if a new selection / list of nodes is set from outside of this class, e.g. from a QmitkSynchronizedNodeSelectionWidget. This signal is connected to the 'SetCurrentSelection'-slot of each QmitkSynchronizedNodeSelectionWidget to propagate the new selection.

Parameters
nodesA list of data nodes that are newly selected.

◆ NodesLayerMoved

void QmitkSynchronizedWidgetConnector::NodesLayerMoved ( QSet< mitk::DataNode * >  movedNodes,
const int  targetLayer 
)
signal

◆ NodeVisibilityChanged

void QmitkSynchronizedWidgetConnector::NodeVisibilityChanged ( mitk::DataNode::Pointer  node,
const bool  visibility 
)
signal

◆ OnNodeVisibilityChanged

void QmitkSynchronizedWidgetConnector::OnNodeVisibilityChanged ( mitk::DataNode::Pointer  node,
bool  visibility 
)
slot

When the visibility of a node is changed in a connected widget, update the internal set of invisible selected nodes. This information is needed to fully synchronize newly connected widgets.

Parameters
nodeA pointer to the data node for which visibility was toggled.
visibilityThe new visibility of the respective data node.

◆ SeedFromMember()

void QmitkSynchronizedWidgetConnector::SeedFromMember ( const NodeList &  seedSelection,
const mitk::BaseRenderer *  seedRenderer 
)
protected

Seed this connector's runtime selection from a designated member cell.

   Used by the v2 layout applier to make a group's seed cell authoritative
   for the connector's `m_InternalSelection` and `m_InternalInvisibles`.
   The seed cell is the cell that appears first in document order whose
   `links.selection` references this group (see the schema description
   of the seeding rule).

   The connector takes the seed cell's selection list verbatim and
   rebuilds its invisible-nodes set by reading per-renderer visibility
   from `seedRenderer` for each selected node.

   Group-scoped state is not touched: `m_SelectAll` is set from the
   layout document's `groups` dict, not derived from any cell, so
   SeedFromMember leaves it alone.

   This method is intended for layout-load seeding only. Calling it
   outside of `ApplyLayout`'s seeding pass risks clobbering the
   runtime state that the user has built up since load time. Access
   is restricted to `QmitkMxNMultiWidget` (via friendship) and to
   test fixtures that subclass this type to exercise the contract
   directly.
Parameters
seedSelectionThe selection list of the seed cell.
seedRendererThe base renderer of the seed cell. Per-node visibility is read from this renderer to rebuild m_InternalInvisibles. Must not be null.

◆ SelectionModeChanged

void QmitkSynchronizedWidgetConnector::SelectionModeChanged ( bool  selectAll)
signal

A signal that will be emitted by the 'ChangeSelectionMode'-slot. This happens if the selection mode is change from outside of this class, e.g. from a QmitkSynchronizedNodeSelectionWidget. This signal is connected to the 'SetSelectAll'-slot of each QmitkSynchronizedNodeSelectionWidget to propagate the selection mode.

Parameters
selectAllTrue, if the selection mode is changed to "select all" nodes. False otherwise.

◆ SynchronizeWidget()

void QmitkSynchronizedWidgetConnector::SynchronizeWidget ( QmitkSynchronizedNodeSelectionWidget *  nodeSelectionWidget) const

This function sets the current selection and the selection mode of the given node selection widget to the values of this instance. The required values are stored in this class internally. It can be used to newly initialize the given node selection widget.

Parameters
nodeSelectionWidgetThe synchronized node selection widget for which the current selection and the selection mode should be set.

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