Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 &)>
 
- Public Types inherited from QmitkAbstractNodeSelectionWidget
using NodeList = QList< mitk::DataNode::Pointer >
 

Public Slots

void OnEditSelection ()
 
- Public Slots inherited from QmitkAbstractNodeSelectionWidget
void SetSelectOnlyVisibleNodes (bool selectOnlyVisibleNodes)
 
void SetCurrentSelection (NodeList selectedNodes)
 
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)
 
- 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
 

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

Detailed Description

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

Definition at line 36 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 49 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.

Definition at line 154 of file QmitkMultiNodeSelectionWidget.cpp.

References m_CheckFunction, and m_CheckResponse.

◆ changeEvent()

void QmitkMultiNodeSelectionWidget::changeEvent ( QEvent *  event)
overrideprotected

Definition at line 145 of file QmitkMultiNodeSelectionWidget.cpp.

References UpdateInfo().

◆ OnClearSelection

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

◆ OnEditSelection

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

Definition at line 115 of file QmitkMultiNodeSelectionWidget.cpp.

References QmitkAbstractNodeSelectionWidget::GetCurrentInternalSelection(), m_Controls, QmitkAbstractNodeSelectionWidget::m_IsOptional, QmitkAbstractNodeSelectionWidget::m_NodePredicate, and OnClearSelection().

Referenced by QmitkMultiNodeSelectionWidget().

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

Definition at line 35 of file QmitkMultiNodeSelectionWidget.cpp.

References QmitkAbstractNodeSelectionWidget::CompileEmitSelection(), QmitkAbstractNodeSelectionWidget::EmitSelection(), m_CheckFunction, m_CheckResponse, and UpdateInfo().

◆ UpdateInfo()

void QmitkMultiNodeSelectionWidget::UpdateInfo ( )
overrideprotectedvirtual

Member Data Documentation

◆ m_CheckFunction

SelectionCheckFunctionType QmitkMultiNodeSelectionWidget::m_CheckFunction
protected

◆ m_CheckResponse

std::string QmitkMultiNodeSelectionWidget::m_CheckResponse
mutableprotected

◆ m_Controls

Ui_QmitkMultiNodeSelectionWidget QmitkMultiNodeSelectionWidget::m_Controls
protected

◆ m_Overlay

QmitkSimpleTextOverlayWidget* QmitkMultiNodeSelectionWidget::m_Overlay
protected

Definition at line 70 of file QmitkMultiNodeSelectionWidget.h.

Referenced by QmitkMultiNodeSelectionWidget(), and UpdateInfo().


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