Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSynchronizedNodeSelectionWidget Class Reference

Node selection widget with renderer-specific functionality and synchronization support. More...

#include <QmitkSynchronizedNodeSelectionWidget.h>

Inheritance diagram for QmitkSynchronizedNodeSelectionWidget:
Collaboration diagram for QmitkSynchronizedNodeSelectionWidget:

Public Types

using NodeList = QmitkAbstractNodeSelectionWidget::NodeList
 
using GroupSyncIndexType = int
 Type alias for the synchronization group index. More...
 
- Public Types inherited from QmitkAbstractNodeSelectionWidget
using NodeList = QList< mitk::DataNode::Pointer >
 
using ConstNodeStdVector = std::vector< mitk::DataNode::ConstPointer >
 

Public Slots

void SetSelection (const NodeList &newSelection)
 
void SetNodeVisibility (mitk::DataNode::Pointer node, const bool visibility)
 
- Public Slots inherited from QmitkAbstractNodeSelectionWidget
void SetSelectOnlyVisibleNodes (bool selectOnlyVisibleNodes)
 Change the selection modus of the item view's selection model. More...
 
void SetCurrentSelection (NodeList selectedNodes)
 Transform a list of data nodes (a selection) into a model selection and set this as a new selection of the selection model of the private member item view. More...
 
void SetInvalidInfo (QString info)
 
void SetEmptyInfo (QString info)
 
void SetPopUpTitel (QString info)
 
void SetPopUpHint (QString info)
 
void SetSelectionIsOptional (bool isOptional)
 

Signals

void SelectionModeChanged (bool selectAll)
 
void DeregisterSynchronization ()
 
void NodeVisibilityChanged (mitk::DataNode::Pointer node, const bool visibility)
 
void SyncGroupIndexChanged (GroupSyncIndexType index)
 Emitted when the synchronization group index actually changes. More...
 
- Signals inherited from QmitkAbstractNodeSelectionWidget
void CurrentSelectionChanged (NodeList nodes)
 A signal that will be emitted if the selected node has changed. More...
 

Public Member Functions

 QmitkSynchronizedNodeSelectionWidget (QWidget *parent)
 
 ~QmitkSynchronizedNodeSelectionWidget ()
 
void SetBaseRenderer (mitk::BaseRenderer *baseRenderer)
 Sets the base renderer that this widget controls. More...
 
QmitkRenderWindowDataNodeTableModel * GetStorageModel () const
 Returns the internal data node table model. More...
 
void SetSelectAll (bool selectAll)
 Sets whether all nodes should be selected. More...
 
bool GetSelectAll () const
 Returns whether the "select all" mode is active. More...
 
void SelectAll ()
 Selects all nodes from the data storage. More...
 
void SetSyncGroup (const GroupSyncIndexType index)
 Sets the synchronization group for this widget. More...
 
GroupSyncIndexType GetSyncGroup () const
 Returns the current synchronization group index. More...
 
- Public Member Functions inherited from QmitkAbstractNodeSelectionWidget
 QmitkAbstractNodeSelectionWidget (QWidget *parent=nullptr)
 
virtual ~QmitkAbstractNodeSelectionWidget () override
 
void SetDataStorage (mitk::DataStorage *dataStorage)
 Sets the data storage that will be used / monitored by widget. More...
 
void SetNodePredicate (const mitk::NodePredicateBase *nodePredicate)
 
const mitk::NodePredicateBase * GetNodePredicate () const
 
QString GetInvalidInfo () const
 
QString GetEmptyInfo () const
 
QString GetPopUpTitel () const
 
QString GetPopUpHint () const
 
bool GetSelectionIsOptional () const
 
bool GetSelectOnlyVisibleNodes () const
 
NodeList GetSelectedNodes () const
 
ConstNodeStdVector GetSelectedNodesStdVector () const
 
void OnSelectionReceived (const std::string &context, const std::vector< mitk::DataNode::Pointer > &selection) override
 Callback method for received selections. More...
 

Protected Member Functions

void SetUpConnections ()
 
void Initialize ()
 
void UpdateInfo () override
 
void OnDataStorageChanged () override
 
void OnNodePredicateChanged () override
 
void ReviseSelectionChanged (const NodeList &oldInternalSelection, NodeList &newInternalSelection) override
 
void OnInternalSelectionChanged () override
 
void OnNodeAddedToStorage (const mitk::DataNode *node) override
 
void OnNodeModified (const itk::Object *caller, const itk::EventObject &event) override
 
- Protected Member Functions inherited from QmitkAbstractNodeSelectionWidget
virtual void OnNodeRemovedFromStorage (const mitk::DataNode *node)
 
void HandleChangeOfInternalSelection (NodeList newInternalSelection)
 
NodeList CompileEmitSelection () const
 
virtual bool AllowEmissionOfSelection (const NodeList &emissionCandidates) const
 
void EmitSelection (const NodeList &emissionCandidates)
 
void SetCurrentInternalSelection (NodeList selectedNodes)
 
const NodeList & GetCurrentInternalSelection () const
 
const NodeList & GetCurrentExternalSelection () const
 

Additional Inherited Members

- Protected Slots inherited from QmitkAbstractNodeSelectionWidget
void RemoveNodeFromInternalSelection (const mitk::DataNode *node)
 
- Protected Attributes inherited from QmitkAbstractNodeSelectionWidget
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
 
mitk::NodePredicateBase::ConstPointer m_NodePredicate
 
QString m_InvalidInfo
 
QString m_EmptyInfo
 
QString m_PopUpTitel
 
QString m_PopUpHint
 
bool m_IsOptional
 
bool m_SelectOnlyVisibleNodes
 

Detailed Description

Node selection widget with renderer-specific functionality and synchronization support.

The QmitkSynchronizedNodeSelectionWidget implements QmitkAbstractNodeSelectionWidget by providing a table view, using a QmitkRenderWindowDataNodeTableModel and extending it with base renderer-specific functionality.

Given a base renderer, the selection widget is able to display and access render window specific properties of the selected nodes. It can be connected with other QmitkSynchronizedNodeSelectionWidgets to synchronize their state. The widget can be used to decide if all data nodes of the data storage should be selected or only an individually selected set of nodes, defined by a QmitkNodeSelectionDialog. If individual nodes are selected / removed from the selection, the widget can inform other QmitkSynchronizedNodeSelectionWidget instances about the current selection, if desired. Additionally the widget allows to reinitialize the corresponding base renderer with a specific data node geometry.

Definition at line 48 of file QmitkSynchronizedNodeSelectionWidget.h.

Member Typedef Documentation

◆ GroupSyncIndexType

Type alias for the synchronization group index.

Definition at line 78 of file QmitkSynchronizedNodeSelectionWidget.h.

◆ NodeList

Constructor & Destructor Documentation

◆ QmitkSynchronizedNodeSelectionWidget()

QmitkSynchronizedNodeSelectionWidget::QmitkSynchronizedNodeSelectionWidget ( QWidget *  parent)

◆ ~QmitkSynchronizedNodeSelectionWidget()

QmitkSynchronizedNodeSelectionWidget::~QmitkSynchronizedNodeSelectionWidget ( )

Member Function Documentation

◆ DeregisterSynchronization

void QmitkSynchronizedNodeSelectionWidget::DeregisterSynchronization ( )
signal

◆ GetSelectAll()

bool QmitkSynchronizedNodeSelectionWidget::GetSelectAll ( ) const

Returns whether the "select all" mode is active.

◆ GetStorageModel()

QmitkRenderWindowDataNodeTableModel* QmitkSynchronizedNodeSelectionWidget::GetStorageModel ( ) const

Returns the internal data node table model.

◆ GetSyncGroup()

GroupSyncIndexType QmitkSynchronizedNodeSelectionWidget::GetSyncGroup ( ) const

Returns the current synchronization group index.

◆ Initialize()

void QmitkSynchronizedNodeSelectionWidget::Initialize ( )
protected

◆ NodeVisibilityChanged

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

◆ OnDataStorageChanged()

void QmitkSynchronizedNodeSelectionWidget::OnDataStorageChanged ( )
overrideprotectedvirtual

Method is called if the data storage has changed. The selection will be automatically be reset afterwards. The default implementation does nothing.

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ OnInternalSelectionChanged()

void QmitkSynchronizedNodeSelectionWidget::OnInternalSelectionChanged ( )
overrideprotectedvirtual

This member function will called when ever a new internal selection has been determined. This can be used to update the state of internal widgets. The default implementation does nothing.

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ OnNodeAddedToStorage()

void QmitkSynchronizedNodeSelectionWidget::OnNodeAddedToStorage ( const mitk::DataNode *  node)
overrideprotectedvirtual

Method is called when a node is added to the storage. Default implementation does nothing. Derived widgets can override the method if they want to react on new nodes in the storage.

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ OnNodeModified()

void QmitkSynchronizedNodeSelectionWidget::OnNodeModified ( const itk::Object *  caller,
const itk::EventObject &  event 
)
overrideprotectedvirtual

Method is called when a node is modified. The modified node is passed as 'caller' variable. Default implementation handles changes that are related to the node predicate:

  • If the node does not fit the node predicate anymore, it will be removed.
  • If the node was part of the external selection and now fits the node predicate, a new selection is compiled and emitted. Derived widgets can override the method if they want to react on modified nodes.

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ OnNodePredicateChanged()

void QmitkSynchronizedNodeSelectionWidget::OnNodePredicateChanged ( )
overrideprotectedvirtual

Method is called if the predicate has changed, before the selection will be updated according to the new predicate. The default implementation does nothing.

Remarks
If you are only interested to know when the selection has changed, overwrite OnInternalSelectionChange().

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ ReviseSelectionChanged()

void QmitkSynchronizedNodeSelectionWidget::ReviseSelectionChanged ( const NodeList &  oldInternalSelection,
NodeList &  newInternalSelection 
)
overrideprotectedvirtual

This member function is called if the internal selection is about to be changed by the base implementation. This is the slot where derived classes can revise and change the internal selection before widget updates, signal emissions and other things are triggered. Default implementation does nothing, thus it keeps the passed internal selection as compiled by the base implementation.

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ SelectAll()

void QmitkSynchronizedNodeSelectionWidget::SelectAll ( )

Selects all nodes from the data storage.

◆ SelectionModeChanged

void QmitkSynchronizedNodeSelectionWidget::SelectionModeChanged ( bool  selectAll)
signal

◆ SetBaseRenderer()

void QmitkSynchronizedNodeSelectionWidget::SetBaseRenderer ( mitk::BaseRenderer *  baseRenderer)

Sets the base renderer that this widget controls.

Parameters
[in]baseRendererPointer to the base renderer.

◆ SetNodeVisibility

void QmitkSynchronizedNodeSelectionWidget::SetNodeVisibility ( mitk::DataNode::Pointer  node,
const bool  visibility 
)
slot

◆ SetSelectAll()

void QmitkSynchronizedNodeSelectionWidget::SetSelectAll ( bool  selectAll)

Sets whether all nodes should be selected.

Parameters
[in]selectAllIf true, selects all nodes from the data storage.

◆ SetSelection

void QmitkSynchronizedNodeSelectionWidget::SetSelection ( const NodeList &  newSelection)
slot

◆ SetSyncGroup()

void QmitkSynchronizedNodeSelectionWidget::SetSyncGroup ( const GroupSyncIndexType  index)

Sets the synchronization group for this widget.

Parameters
[in]indexThe synchronization group index.

◆ SetUpConnections()

void QmitkSynchronizedNodeSelectionWidget::SetUpConnections ( )
protected

◆ SyncGroupIndexChanged

void QmitkSynchronizedNodeSelectionWidget::SyncGroupIndexChanged ( GroupSyncIndexType  index)
signal

Emitted when the synchronization group index actually changes.

Listeners (typically the owning utility widget) use this to keep view-side state – e.g. a group-selector combobox – in sync with the widget's authoritative 'm_SyncGroupIndex'. Not emitted when 'SetSyncGroup' is called with the value the widget already holds.

◆ UpdateInfo()

void QmitkSynchronizedNodeSelectionWidget::UpdateInfo ( )
overrideprotectedvirtual

Method is called if the display of the selected nodes should be updated (e.g. because the selection changed).

Implements QmitkAbstractNodeSelectionWidget.


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