Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkAbstractDataStorageInspector.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkAbstractDataStorageInspector_h
14 #define QmitkAbstractDataStorageInspector_h
15 
17 
18 #include <MitkQtWidgetsExports.h>
19 
20 // mitk core
21 #include <mitkDataStorage.h>
22 #include <mitkNodePredicateBase.h>
23 
24 // qt
25 #include <QWidget>
26 
44 {
45  Q_OBJECT
46 
47 public:
48 
50 
59  void SetDataStorage(mitk::DataStorage* dataStorage);
60 
69  virtual void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
70 
76 
78  using NodeList = QList<mitk::DataNode::Pointer>;
79 
85 
90  virtual QAbstractItemView* GetView() = 0;
91 
93  virtual const QAbstractItemView* GetView() const = 0;
94 
105 
107  using SelectionMode = QAbstractItemView::SelectionMode;
108 
113  virtual void SetSelectionMode(SelectionMode mode) = 0;
114 
119  virtual SelectionMode GetSelectionMode() const = 0;
120 
121 Q_SIGNALS:
127 
128  public Q_SLOTS:
143  void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
144 
157  void SetCurrentSelection(NodeList selectedNodes);
158 
159 protected Q_SLOTS:
160  void OnSelectionChanged(NodeList selectedNodes);
161 
162 protected:
165  virtual void Initialize() = 0;
166 
168  mitk::NodePredicateBase::ConstPointer m_NodePredicate;
169 
170  std::unique_ptr<QmitkModelViewSelectionConnector> m_Connector;
171 
172  QmitkAbstractDataStorageInspector(QWidget* parent = nullptr);
173 
174 };
175 
176 #endif
#define MITKQTWIDGETS_EXPORT
Abstract base class for widgets that inspect the contents of a DataStorage.
const mitk::NodePredicateBase * GetNodePredicate() const
Returns the currently set node predicate.
virtual void SetNodePredicate(const mitk::NodePredicateBase *nodePredicate)
Sets the node predicate and re-initializes the widget accordingly.
virtual QAbstractItemView * GetView()=0
Returns a pointer to the view used to display the data storage content.
virtual const QAbstractItemView * GetView() const =0
Returns a pointer to the view used to display the data storage content.
void CurrentSelectionChanged(NodeList nodes)
Emitted when the set of selected nodes has changed.
void SetDataStorage(mitk::DataStorage *dataStorage)
Sets the data storage that will be used and monitored by this widget.
virtual void SetSelectionMode(SelectionMode mode)=0
Sets the selection mode of the inspector's item view.
QAbstractItemView::SelectionMode SelectionMode
Convenience type alias for the Qt selection mode.
std::unique_ptr< QmitkModelViewSelectionConnector > m_Connector
mitk::NodePredicateBase::ConstPointer m_NodePredicate
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
bool GetSelectOnlyVisibleNodes() const
Returns whether only visible nodes can be selected.
virtual SelectionMode GetSelectionMode() const =0
Returns the current selection mode of the inspector's item view.
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes)
Controls whether selections are restricted to visible nodes only.
NodeList GetSelectedNodes() const
Returns the list of currently selected data nodes.
QList< mitk::DataNode::Pointer > NodeList
Convenience type alias for a list of data node pointers.
void OnSelectionChanged(NodeList selectedNodes)
QmitkAbstractDataStorageInspector(QWidget *parent=nullptr)
void SetCurrentSelection(NodeList selectedNodes)
Sets the given list of data nodes as the new selection.
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Abstract base class for predicates used to filter DataNode objects in DataStorage queries.