Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkAbstractDataStorageInspector Class Referenceabstract

This abstract class is a convenient base class for easy implementation of widgets that offer a specific view onto a given DataStorage instance to inspect its contents. One may also get the selection in this inspector of the data storage. More...

#include <QmitkAbstractDataStorageInspector.h>

Inheritance diagram for QmitkAbstractDataStorageInspector:
Collaboration diagram for QmitkAbstractDataStorageInspector:

Public Types

using NodeList = QList< mitk::DataNode::Pointer >
 
using SelectionMode = QAbstractItemView::SelectionMode
 

Public Slots

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 into a model selection and set this as a new selection of the selection model of the private member item view. More...
 

Signals

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

Public Member Functions

 ~QmitkAbstractDataStorageInspector () override
 
void SetDataStorage (mitk::DataStorage *dataStorage)
 Sets the data storage that will be used /monitored by the widget. More...
 
virtual void SetNodePredicate (const mitk::NodePredicateBase *nodePredicate)
 Sets the node predicate and updates the widget, according to the node predicate. More...
 
const mitk::NodePredicateBaseGetNodePredicate () const
 
NodeList GetSelectedNodes () const
 
virtual QAbstractItemView * GetView ()=0
 
virtual const QAbstractItemView * GetView () const =0
 
bool GetSelectOnlyVisibleNodes () const
 
virtual void SetSelectionMode (SelectionMode mode)=0
 
virtual SelectionMode GetSelectionMode () const =0
 

Protected Slots

void OnSelectionChanged (NodeList selectedNodes)
 

Protected Member Functions

virtual void Initialize ()=0
 
 QmitkAbstractDataStorageInspector (QWidget *parent=nullptr)
 

Protected Attributes

mitk::WeakPointer< mitk::DataStoragem_DataStorage
 
mitk::NodePredicateBase::ConstPointer m_NodePredicate
 
std::unique_ptr< QmitkModelViewSelectionConnectorm_Connector
 

Detailed Description

This abstract class is a convenient base class for easy implementation of widgets that offer a specific view onto a given DataStorage instance to inspect its contents. One may also get the selection in this inspector of the data storage.

Definition at line 32 of file QmitkAbstractDataStorageInspector.h.

Member Typedef Documentation

◆ NodeList

◆ SelectionMode

using QmitkAbstractDataStorageInspector::SelectionMode = QAbstractItemView::SelectionMode

Definition at line 68 of file QmitkAbstractDataStorageInspector.h.

Constructor & Destructor Documentation

◆ ~QmitkAbstractDataStorageInspector()

QmitkAbstractDataStorageInspector::~QmitkAbstractDataStorageInspector ( )
override

◆ QmitkAbstractDataStorageInspector()

QmitkAbstractDataStorageInspector::QmitkAbstractDataStorageInspector ( QWidget *  parent = nullptr)
protected

Member Function Documentation

◆ CurrentSelectionChanged

void QmitkAbstractDataStorageInspector::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* QmitkAbstractDataStorageInspector::GetNodePredicate ( ) const

◆ GetSelectedNodes()

NodeList QmitkAbstractDataStorageInspector::GetSelectedNodes ( ) const

Returns the list of currently selected nodes.

◆ GetSelectionMode()

◆ GetSelectOnlyVisibleNodes()

bool QmitkAbstractDataStorageInspector::GetSelectOnlyVisibleNodes ( ) const

Returns the setting of the internal connector. It can be changed by SetSelectOnlyVisibleNodes()

◆ GetView() [1/2]

virtual const QAbstractItemView* QmitkAbstractDataStorageInspector::GetView ( ) const
pure virtual

◆ GetView() [2/2]

virtual QAbstractItemView* QmitkAbstractDataStorageInspector::GetView ( )
pure virtual

◆ Initialize()

virtual void QmitkAbstractDataStorageInspector::Initialize ( )
protectedpure virtual

Helper function is called if data storage or predicate is changed to (re) initialize the widget correctly. Implement the function in derived classes.

Implemented in QmitkDataStorageSelectionHistoryInspector, QmitkDataStorageTreeInspector, and QmitkDataStorageListInspector.

◆ OnSelectionChanged

void QmitkAbstractDataStorageInspector::OnSelectionChanged ( NodeList  selectedNodes)
protectedslot

◆ SetCurrentSelection

void QmitkAbstractDataStorageInspector::SetCurrentSelection ( NodeList  selectedNodes)
slot

Transform a list of data nodes into a model selection and set this as a new selection of the selection model of the private member item view.

The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').

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

◆ SetDataStorage()

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

Sets the data storage that will be used /monitored by the widget.

Parameters
dataStorageA pointer to the data storage to set.

◆ SetNodePredicate()

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

Sets the node predicate and updates the widget, according to the node predicate.

Parameters
nodePredicateA pointer to node predicate.

Reimplemented in QmitkDataStorageFavoriteNodesInspector.

◆ SetSelectionMode()

virtual void QmitkAbstractDataStorageInspector::SetSelectionMode ( SelectionMode  mode)
pure virtual

◆ SetSelectOnlyVisibleNodes

void QmitkAbstractDataStorageInspector::SetSelectOnlyVisibleNodes ( bool  selectOnlyVisibleNodes)
slot

Change the selection modus of the item view's selection model.

If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view. An outgoing selection can then at most contain the filtered nodes. If false, the incoming non-visible selection will be stored and later added to the outgoing selection, to include the original selection that could not be modified. The part of the original selection, that is non-visible are the nodes that are not

Parameters
selectOnlyVisibleNodesThe bool value to define the selection modus.

Member Data Documentation

◆ m_Connector

std::unique_ptr<QmitkModelViewSelectionConnector> QmitkAbstractDataStorageInspector::m_Connector
protected

Definition at line 121 of file QmitkAbstractDataStorageInspector.h.

◆ m_DataStorage

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

Definition at line 118 of file QmitkAbstractDataStorageInspector.h.

◆ m_NodePredicate

mitk::NodePredicateBase::ConstPointer QmitkAbstractDataStorageInspector::m_NodePredicate
protected

Definition at line 119 of file QmitkAbstractDataStorageInspector.h.


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