Medical Imaging Interaction Toolkit  2025.12.02
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 
33 {
34  Q_OBJECT
35 
36 public:
37 
39 
45  void SetDataStorage(mitk::DataStorage* dataStorage);
46 
52  virtual void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
53 
55 
56  using NodeList = QList<mitk::DataNode::Pointer>;
57 
60 
62  virtual QAbstractItemView* GetView() = 0;
63  virtual const QAbstractItemView* GetView() const = 0;
64 
67 
68  using SelectionMode = QAbstractItemView::SelectionMode;
69 
71  virtual void SetSelectionMode(SelectionMode mode) = 0;
72  virtual SelectionMode GetSelectionMode() const = 0;
73 
74 Q_SIGNALS:
81 
82  public Q_SLOTS:
94  void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
95 
108  void SetCurrentSelection(NodeList selectedNodes);
109 
110 protected Q_SLOTS:
111  void OnSelectionChanged(NodeList selectedNodes);
112 
113 protected:
116  virtual void Initialize() = 0;
117 
119  mitk::NodePredicateBase::ConstPointer m_NodePredicate;
120 
121  std::unique_ptr<QmitkModelViewSelectionConnector> m_Connector;
122 
123  QmitkAbstractDataStorageInspector(QWidget* parent = nullptr);
124 
125 };
126 
127 #endif
#define MITKQTWIDGETS_EXPORT
This abstract class is a convenient base class for easy implementation of widgets that offer a specif...
const mitk::NodePredicateBase * GetNodePredicate() const
virtual void SetNodePredicate(const mitk::NodePredicateBase *nodePredicate)
Sets the node predicate and updates the widget, according to the node predicate.
virtual QAbstractItemView * GetView()=0
virtual const QAbstractItemView * GetView() const =0
void CurrentSelectionChanged(NodeList nodes)
A signal that will be emitted if the selected node has changed.
void SetDataStorage(mitk::DataStorage *dataStorage)
Sets the data storage that will be used /monitored by the widget.
virtual void SetSelectionMode(SelectionMode mode)=0
QAbstractItemView::SelectionMode SelectionMode
std::unique_ptr< QmitkModelViewSelectionConnector > m_Connector
mitk::NodePredicateBase::ConstPointer m_NodePredicate
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
virtual SelectionMode GetSelectionMode() const =0
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes)
Change the selection modus of the item view's selection model.
void OnSelectionChanged(NodeList selectedNodes)
QmitkAbstractDataStorageInspector(QWidget *parent=nullptr)
void SetCurrentSelection(NodeList selectedNodes)
Transform a list of data nodes into a model selection and set this as a new selection of the selectio...
Data management class that handles 'was created by' relations.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.