|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
This class connects different 'QmitkSynchronizedNodeSelectionWidget', such that they can synchronize their current node selection and their current selection mode. More...
#include <QmitkSynchronizedWidgetConnector.h>


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... | |
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.
Connector-internal state (NOT fanned out via per-renderer property writes):
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.
Definition at line 65 of file QmitkSynchronizedWidgetConnector.h.
| QmitkSynchronizedWidgetConnector::QmitkSynchronizedWidgetConnector | ( | ) |
|
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.
| nodes | A list of data nodes that are newly selected. |
|
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.
| selectAll | True, if the selection mode is changed to "select all" nodes. False otherwise. |
| 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:
| nodeSelectionWidget | The synchronized node selection widget to be connected / synchronized. |
|
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.
| 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.
| nodeSelectionWidget | The synchronized node selection widget to be disconnected / desynchronized. |
| NodeList QmitkSynchronizedWidgetConnector::GetNodeSelection | ( | ) | const |
Get the current internal node selection.
| bool QmitkSynchronizedWidgetConnector::GetSelectionMode | ( | ) | const |
Get the current internal selection mode.
|
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.
| nodes | A list of data nodes that are newly selected. |
|
signal |
|
signal |
|
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.
| node | A pointer to the data node for which visibility was toggled. |
| visibility | The new visibility of the respective data node. |
|
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.
| seedSelection | The selection list of the seed cell. |
| seedRenderer | The base renderer of the seed cell. Per-node visibility is read from this renderer to rebuild m_InternalInvisibles. Must not be null. |
|
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.
| selectAll | True, if the selection mode is changed to "select all" nodes. False otherwise. |
| 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.
| nodeSelectionWidget | The synchronized node selection widget for which the current selection and the selection mode should be set. |