Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkSynchronizedNodeSelectionWidget Class Reference

#include <QmitkSynchronizedNodeSelectionWidget.h>

Inheritance diagram for QmitkSynchronizedNodeSelectionWidget:
Collaboration diagram for QmitkSynchronizedNodeSelectionWidget:

Public Types

using NodeList = QmitkAbstractNodeSelectionWidget::NodeList
 
- 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)
 
- 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 ()
 
- 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)
 
void SetSelectAll (bool selectAll)
 
bool GetSelectAll () const
 
void SelectAll ()
 
void SetSynchronized (bool synchronize)
 
bool IsSynchronized () const
 
- 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::NodePredicateBaseGetNodePredicate () 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
 
bool AllowEmissionOfSelection (const NodeList &emissionCandidates) const 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
 
void EmitSelection (const NodeList &emissionCandidates)
 
void SetCurrentInternalSelection (NodeList selectedNodes)
 
const NodeListGetCurrentInternalSelection () const
 
const NodeListGetCurrentExternalSelection () const
 

Additional Inherited Members

- Protected Slots inherited from QmitkAbstractNodeSelectionWidget
void RemoveNodeFromSelection (const mitk::DataNode *node)
 
- Protected Attributes inherited from QmitkAbstractNodeSelectionWidget
mitk::WeakPointer< mitk::DataStoragem_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

Definition at line 42 of file QmitkSynchronizedNodeSelectionWidget.h.

Member Typedef Documentation

◆ NodeList

Constructor & Destructor Documentation

◆ QmitkSynchronizedNodeSelectionWidget()

QmitkSynchronizedNodeSelectionWidget::QmitkSynchronizedNodeSelectionWidget ( QWidget *  parent)

◆ ~QmitkSynchronizedNodeSelectionWidget()

QmitkSynchronizedNodeSelectionWidget::~QmitkSynchronizedNodeSelectionWidget ( )

Member Function Documentation

◆ AllowEmissionOfSelection()

bool QmitkSynchronizedNodeSelectionWidget::AllowEmissionOfSelection ( const NodeList emissionCandidates) const
overrideprotectedvirtual

This function will be called before the CurrentSelectionChanged signal is emitted. The return value indicates if the signal should be emitted (true = emission; false = no emission). The default implementation always returns true.

Parameters
emissionCandidatesThe nodes that will be emitted if the function returns true.

Reimplemented from QmitkAbstractNodeSelectionWidget.

◆ DeregisterSynchronization

void QmitkSynchronizedNodeSelectionWidget::DeregisterSynchronization ( )
signal

◆ GetSelectAll()

bool QmitkSynchronizedNodeSelectionWidget::GetSelectAll ( ) const

◆ Initialize()

void QmitkSynchronizedNodeSelectionWidget::Initialize ( )
protected

◆ IsSynchronized()

bool QmitkSynchronizedNodeSelectionWidget::IsSynchronized ( ) const

◆ 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 ( )

◆ SelectionModeChanged

void QmitkSynchronizedNodeSelectionWidget::SelectionModeChanged ( bool  selectAll)
signal

◆ SetBaseRenderer()

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

◆ SetSelectAll()

void QmitkSynchronizedNodeSelectionWidget::SetSelectAll ( bool  selectAll)

◆ SetSelection

void QmitkSynchronizedNodeSelectionWidget::SetSelection ( const NodeList newSelection)
slot

◆ SetSynchronized()

void QmitkSynchronizedNodeSelectionWidget::SetSynchronized ( bool  synchronize)

◆ SetUpConnections()

void QmitkSynchronizedNodeSelectionWidget::SetUpConnections ( )
protected

◆ 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: