Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
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>
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::NodePredicateBase * | GetNodePredicate () 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::DataStorage > | m_DataStorage |
mitk::NodePredicateBase::ConstPointer | m_NodePredicate |
std::unique_ptr< QmitkModelViewSelectionConnector > | m_Connector |
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.
Definition at line 56 of file QmitkAbstractDataStorageInspector.h.
using QmitkAbstractDataStorageInspector::SelectionMode = QAbstractItemView::SelectionMode |
Definition at line 68 of file QmitkAbstractDataStorageInspector.h.
|
override |
|
protected |
|
signal |
A signal that will be emitted if the selected node has changed.
nodes | A list of data nodes that are newly selected. |
const mitk::NodePredicateBase* QmitkAbstractDataStorageInspector::GetNodePredicate | ( | ) | const |
NodeList QmitkAbstractDataStorageInspector::GetSelectedNodes | ( | ) | const |
Returns the list of currently selected nodes.
|
pure virtual |
bool QmitkAbstractDataStorageInspector::GetSelectOnlyVisibleNodes | ( | ) | const |
Returns the setting of the internal connector. It can be changed by SetSelectOnlyVisibleNodes()
|
pure virtual |
|
pure virtual |
Returns an pointer to the view that is used in the inspector to show the content.
Implemented in QmitkRenderWindowContextDataStorageInspector, QmitkRenderWindowDataStorageInspector, QmitkDataStorageTreeInspector, QmitkDataStorageSelectionHistoryInspector, and QmitkDataStorageListInspector.
|
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.
|
protectedslot |
|
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').
selectedNodes | A list of data nodes that should be newly selected. |
void QmitkAbstractDataStorageInspector::SetDataStorage | ( | mitk::DataStorage * | dataStorage | ) |
Sets the data storage that will be used /monitored by the widget.
dataStorage | A pointer to the data storage to set. |
|
virtual |
Sets the node predicate and updates the widget, according to the node predicate.
nodePredicate | A pointer to node predicate. |
Reimplemented in QmitkDataStorageFavoriteNodesInspector.
|
pure virtual |
Sets the selection mode of the inspector.
Implemented in QmitkRenderWindowContextDataStorageInspector, QmitkRenderWindowDataStorageInspector, QmitkDataStorageTreeInspector, QmitkDataStorageSelectionHistoryInspector, and QmitkDataStorageListInspector.
|
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
selectOnlyVisibleNodes | The bool value to define the selection modus. |
|
protected |
Definition at line 121 of file QmitkAbstractDataStorageInspector.h.
|
protected |
Definition at line 118 of file QmitkAbstractDataStorageInspector.h.
|
protected |
Definition at line 119 of file QmitkAbstractDataStorageInspector.h.