Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
QmitkNodeSelectionDialog Class Reference

A customized QDialog that displays different data storage inspectors and allows to set and get a current selection by selecting data nodes in the data storage inspectors. More...

#include <QmitkNodeSelectionDialog.h>

Inheritance diagram for QmitkNodeSelectionDialog:
Collaboration diagram for QmitkNodeSelectionDialog:

Public Types

using NodeList = QList< mitk::DataNode::Pointer >
 
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. More...
 
using SelectionMode = QAbstractItemView::SelectionMode
 

Public Slots

void SetSelectOnlyVisibleNodes (bool selectOnlyVisibleNodes)
 Set the selection modus to (not) include invisible nodes in the selection. The function iterates over the dialog's panels and sets the selection modus of each panel accordingly. Each panel is a concrete data storage inspector. More...
 
void SetCurrentSelection (NodeList selectedNodes)
 Set the currently selected nodes given a list of data nodes. The function iterates over the dialog's panels and sets the current selection of each panel accordingly. Each panel is a concrete data storage inspector. More...
 

Signals

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

Public Member Functions

 QmitkNodeSelectionDialog (QWidget *parent=nullptr, QString caption="", QString hint="")
 
void SetDataStorage (mitk::DataStorage *dataStorage)
 Set the data storage that will be used. The function iterates over the dialog's panels and sets the data storage of each panel accordingly. Each panel is a specific data storage inspector. More...
 
virtual void SetNodePredicate (const mitk::NodePredicateBase *nodePredicate)
 Set the node predicate that will be used. The function iterates over the dialog's panels and sets the node predicate of each panel accordingly. Each panel is a specific data storage inspector. More...
 
const mitk::NodePredicateBaseGetNodePredicate () const
 
NodeList GetSelectedNodes () const
 
void SetSelectionCheckFunction (const SelectionCheckFunctionType &checkFunction)
 A selection check function can be set. If set the dialog uses this function to check the made/set selection. If the selection is valid, everything is fine. If the selection is indicated as invalid, the dialog will display the selection check function error message. More...
 
bool GetSelectOnlyVisibleNodes () const
 
void SetSelectionMode (SelectionMode mode)
 Set the Qt selection mode (e.g. Single selection, multi selection). The function iterates over the dialog's panels and sets the Qt selection mode of each panel accordingly. Each panel is a concrete data storage inspector. More...
 
SelectionMode GetSelectionMode () const
 

Protected Types

using PanelVectorType = std::vector< QmitkAbstractDataStorageInspector * >
 

Protected Slots

void OnSelectionChanged (NodeList selectedNodes)
 
void OnFavoriteNodesButtonClicked ()
 
void OnOK ()
 
void OnCancel ()
 
void OnDoubleClicked (const QModelIndex &index)
 

Protected Member Functions

void SetErrorText (const std::string &checkResponse)
 
void AddPanel (const mitk::IDataStorageInspectorProvider *provider, const mitk::IDataStorageInspectorProvider::InspectorIDType &preferredID, bool &preferredFound, int &preferredIndex)
 

Protected Attributes

mitk::WeakPointer< mitk::DataStoragem_DataStorage
 
mitk::NodePredicateBase::ConstPointer m_NodePredicate
 
bool m_SelectOnlyVisibleNodes
 
NodeList m_SelectedNodes
 
SelectionCheckFunctionType m_CheckFunction
 
SelectionMode m_SelectionMode
 
PanelVectorType m_Panels
 
QPushButton * m_FavoriteNodesButton
 
Ui_QmitkNodeSelectionDialog m_Controls
 

Detailed Description

A customized QDialog that displays different data storage inspectors and allows to set and get a current selection by selecting data nodes in the data storage inspectors.

Definition at line 35 of file QmitkNodeSelectionDialog.h.

Member Typedef Documentation

◆ NodeList

◆ PanelVectorType

◆ SelectionCheckFunctionType

using QmitkNodeSelectionDialog::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.

Definition at line 70 of file QmitkNodeSelectionDialog.h.

◆ SelectionMode

using QmitkNodeSelectionDialog::SelectionMode = QAbstractItemView::SelectionMode

Definition at line 80 of file QmitkNodeSelectionDialog.h.

Constructor & Destructor Documentation

◆ QmitkNodeSelectionDialog()

QmitkNodeSelectionDialog::QmitkNodeSelectionDialog ( QWidget *  parent = nullptr,
QString  caption = "",
QString  hint = "" 
)
explicit

Member Function Documentation

◆ AddPanel()

void QmitkNodeSelectionDialog::AddPanel ( const mitk::IDataStorageInspectorProvider provider,
const mitk::IDataStorageInspectorProvider::InspectorIDType preferredID,
bool &  preferredFound,
int &  preferredIndex 
)
protected

◆ CurrentSelectionChanged

void QmitkNodeSelectionDialog::CurrentSelectionChanged ( NodeList  nodes)
signal

A signal that will be emitted if the selected node has changed.

Parameters
nodesA list of data nodes that are newly selected.

◆ GetNodePredicate()

const mitk::NodePredicateBase* QmitkNodeSelectionDialog::GetNodePredicate ( ) const

◆ GetSelectedNodes()

NodeList QmitkNodeSelectionDialog::GetSelectedNodes ( ) const

◆ GetSelectionMode()

SelectionMode QmitkNodeSelectionDialog::GetSelectionMode ( ) const

◆ GetSelectOnlyVisibleNodes()

bool QmitkNodeSelectionDialog::GetSelectOnlyVisibleNodes ( ) const

◆ OnCancel

void QmitkNodeSelectionDialog::OnCancel ( )
protectedslot

◆ OnDoubleClicked

void QmitkNodeSelectionDialog::OnDoubleClicked ( const QModelIndex &  index)
protectedslot

◆ OnFavoriteNodesButtonClicked

void QmitkNodeSelectionDialog::OnFavoriteNodesButtonClicked ( )
protectedslot

◆ OnOK

void QmitkNodeSelectionDialog::OnOK ( )
protectedslot

◆ OnSelectionChanged

void QmitkNodeSelectionDialog::OnSelectionChanged ( NodeList  selectedNodes)
protectedslot

◆ SetCurrentSelection

void QmitkNodeSelectionDialog::SetCurrentSelection ( NodeList  selectedNodes)
slot

Set the currently selected nodes given a list of data nodes. The function iterates over the dialog's panels and sets the current selection of each panel accordingly. Each panel is a concrete data storage inspector.

Parameters
selectedNodesA list of data nodes that should be newly selected.

◆ SetDataStorage()

void QmitkNodeSelectionDialog::SetDataStorage ( mitk::DataStorage dataStorage)

Set the data storage that will be used. The function iterates over the dialog's panels and sets the data storage of each panel accordingly. Each panel is a specific data storage inspector.

Parameters
dataStorageA pointer to the data storage to set.

◆ SetErrorText()

void QmitkNodeSelectionDialog::SetErrorText ( const std::string &  checkResponse)
protected

◆ SetNodePredicate()

virtual void QmitkNodeSelectionDialog::SetNodePredicate ( const mitk::NodePredicateBase nodePredicate)
virtual

Set the node predicate that will be used. The function iterates over the dialog's panels and sets the node predicate of each panel accordingly. Each panel is a specific data storage inspector.

Parameters
nodePredicateA pointer to node predicate.

◆ SetSelectionCheckFunction()

void QmitkNodeSelectionDialog::SetSelectionCheckFunction ( const SelectionCheckFunctionType checkFunction)

A selection check function can be set. If set the dialog uses this function to check the made/set selection. If the selection is valid, everything is fine. If the selection is indicated as invalid, the dialog will display the selection check function error message.

◆ SetSelectionMode()

void QmitkNodeSelectionDialog::SetSelectionMode ( SelectionMode  mode)

Set the Qt selection mode (e.g. Single selection, multi selection). The function iterates over the dialog's panels and sets the Qt selection mode of each panel accordingly. Each panel is a concrete data storage inspector.

Parameters
modeThe QAbstractItemView::SelectionMode to define the selection mode.

◆ SetSelectOnlyVisibleNodes

void QmitkNodeSelectionDialog::SetSelectOnlyVisibleNodes ( bool  selectOnlyVisibleNodes)
slot

Set the selection modus to (not) include invisible nodes in the selection. The function iterates over the dialog's panels and sets the selection modus of each panel accordingly. Each panel is a concrete data storage inspector.

Parameters
selectOnlyVisibleNodesThe bool value to define the selection modus.

Member Data Documentation

◆ m_CheckFunction

SelectionCheckFunctionType QmitkNodeSelectionDialog::m_CheckFunction
protected

Definition at line 135 of file QmitkNodeSelectionDialog.h.

◆ m_Controls

Ui_QmitkNodeSelectionDialog QmitkNodeSelectionDialog::m_Controls
protected

Definition at line 143 of file QmitkNodeSelectionDialog.h.

◆ m_DataStorage

mitk::WeakPointer<mitk::DataStorage> QmitkNodeSelectionDialog::m_DataStorage
protected

Definition at line 130 of file QmitkNodeSelectionDialog.h.

◆ m_FavoriteNodesButton

QPushButton* QmitkNodeSelectionDialog::m_FavoriteNodesButton
protected

Definition at line 142 of file QmitkNodeSelectionDialog.h.

◆ m_NodePredicate

mitk::NodePredicateBase::ConstPointer QmitkNodeSelectionDialog::m_NodePredicate
protected

Definition at line 131 of file QmitkNodeSelectionDialog.h.

◆ m_Panels

PanelVectorType QmitkNodeSelectionDialog::m_Panels
protected

Definition at line 140 of file QmitkNodeSelectionDialog.h.

◆ m_SelectedNodes

NodeList QmitkNodeSelectionDialog::m_SelectedNodes
protected

Definition at line 133 of file QmitkNodeSelectionDialog.h.

◆ m_SelectionMode

SelectionMode QmitkNodeSelectionDialog::m_SelectionMode
protected

Definition at line 137 of file QmitkNodeSelectionDialog.h.

◆ m_SelectOnlyVisibleNodes

bool QmitkNodeSelectionDialog::m_SelectOnlyVisibleNodes
protected

Definition at line 132 of file QmitkNodeSelectionDialog.h.


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