Medical Imaging Interaction Toolkit  2023.12.99-63768887
Medical Imaging Interaction Toolkit
QmitkMultiNodeSelectionWidget Class Reference

Widget that allows to perform and represents a multiple node selection. More...

#include <QmitkMultiNodeSelectionWidget.h>

Inheritance diagram for QmitkMultiNodeSelectionWidget:
Collaboration diagram for QmitkMultiNodeSelectionWidget:

Public Types

using NodeList = QmitkAbstractNodeSelectionWidget::NodeList
 
using SelectionCheckFunctionType = std::function< std::string(const NodeList &)>
 Helper function that is used to check the given selection for consistency. Returning an empty string assumes that everything is alright and the selection is valid. If the string is not empty, the content of the string will be used as error message in the overlay to indicate the problem. More...
 
- Public Types inherited from QmitkAbstractNodeSelectionWidget
using NodeList = QList< mitk::DataNode::Pointer >
 
using ConstNodeStdVector = std::vector< mitk::DataNode::ConstPointer >
 

Public Slots

void OnEditSelection ()
 
- 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)
 

Public Member Functions

 QmitkMultiNodeSelectionWidget (QWidget *parent=nullptr)
 
void SetSelectionCheckFunction (const SelectionCheckFunctionType &checkFunction)
 A selection check function can be set. If set the widget uses this function to check the made/set selection. If the selection is valid, everything is fine. If selection is indicated as invalid, it will not be communicated by the widget (no signal emission). 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::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
 

Protected Slots

void OnClearSelection (const mitk::DataNode *node)
 
- Protected Slots inherited from QmitkAbstractNodeSelectionWidget
void RemoveNodeFromSelection (const mitk::DataNode *node)
 

Protected Member Functions

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

Protected Attributes

QmitkSimpleTextOverlayWidgetm_Overlay
 
SelectionCheckFunctionType m_CheckFunction
 
std::string m_CheckResponse
 
Ui_QmitkMultiNodeSelectionWidget m_Controls
 
- 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
 

Additional Inherited Members

- Signals inherited from QmitkAbstractNodeSelectionWidget
void CurrentSelectionChanged (NodeList nodes)
 A signal that will be emitted if the selected node has changed. More...
 

Detailed Description

Widget that allows to perform and represents a multiple node selection.

Definition at line 33 of file QmitkMultiNodeSelectionWidget.h.

Member Typedef Documentation

◆ NodeList

◆ SelectionCheckFunctionType

using QmitkMultiNodeSelectionWidget::SelectionCheckFunctionType = std::function<std::string(const NodeList &)>

Helper function that is used to check the given selection for consistency. Returning an empty string assumes that everything is alright and the selection is valid. If the string is not empty, the content of the string will be used as error message in the overlay to indicate the problem.

Definition at line 48 of file QmitkMultiNodeSelectionWidget.h.

Constructor & Destructor Documentation

◆ QmitkMultiNodeSelectionWidget()

QmitkMultiNodeSelectionWidget::QmitkMultiNodeSelectionWidget ( QWidget *  parent = nullptr)
explicit

Member Function Documentation

◆ AllowEmissionOfSelection()

bool QmitkMultiNodeSelectionWidget::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.

◆ changeEvent()

void QmitkMultiNodeSelectionWidget::changeEvent ( QEvent *  event)
overrideprotected

◆ OnClearSelection

void QmitkMultiNodeSelectionWidget::OnClearSelection ( const mitk::DataNode node)
protectedslot

◆ OnEditSelection

void QmitkMultiNodeSelectionWidget::OnEditSelection ( )
slot

◆ OnInternalSelectionChanged()

void QmitkMultiNodeSelectionWidget::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.

◆ SetSelectionCheckFunction()

void QmitkMultiNodeSelectionWidget::SetSelectionCheckFunction ( const SelectionCheckFunctionType checkFunction)

A selection check function can be set. If set the widget uses this function to check the made/set selection. If the selection is valid, everything is fine. If selection is indicated as invalid, it will not be communicated by the widget (no signal emission).

◆ UpdateInfo()

void QmitkMultiNodeSelectionWidget::UpdateInfo ( )
overrideprotectedvirtual

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

Implements QmitkAbstractNodeSelectionWidget.

Member Data Documentation

◆ m_CheckFunction

SelectionCheckFunctionType QmitkMultiNodeSelectionWidget::m_CheckFunction
protected

Definition at line 73 of file QmitkMultiNodeSelectionWidget.h.

◆ m_CheckResponse

std::string QmitkMultiNodeSelectionWidget::m_CheckResponse
mutableprotected

Definition at line 74 of file QmitkMultiNodeSelectionWidget.h.

◆ m_Controls

Ui_QmitkMultiNodeSelectionWidget QmitkMultiNodeSelectionWidget::m_Controls
protected

Definition at line 76 of file QmitkMultiNodeSelectionWidget.h.

◆ m_Overlay

QmitkSimpleTextOverlayWidget* QmitkMultiNodeSelectionWidget::m_Overlay
protected

Definition at line 71 of file QmitkMultiNodeSelectionWidget.h.


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