Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 
54  const mitk::NodePredicateBase* GetNodePredicate() const;
55 
56  using NodeList = QList<mitk::DataNode::Pointer>;
57 
59  NodeList GetSelectedNodes() const;
60 
62  virtual QAbstractItemView* GetView() = 0;
63  virtual const QAbstractItemView* GetView() const = 0;
64 
66  bool GetSelectOnlyVisibleNodes() const;
67 
68  using SelectionMode = QAbstractItemView::SelectionMode;
69 
71  virtual void SetSelectionMode(SelectionMode mode) = 0;
72  virtual SelectionMode GetSelectionMode() const = 0;
73 
74 Q_SIGNALS:
80  void CurrentSelectionChanged(NodeList nodes);
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 
120 
121  std::unique_ptr<QmitkModelViewSelectionConnector> m_Connector;
122 
123  QmitkAbstractDataStorageInspector(QWidget* parent = nullptr);
124 
125 };
126 
127 #endif
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
mitkDataStorage.h
QmitkModelViewSelectionConnector.h
QmitkAbstractDataStorageInspector::SelectionMode
QAbstractItemView::SelectionMode SelectionMode
Definition: QmitkAbstractDataStorageInspector.h:68
itk::SmartPointer< const Self >
mitk::NodePredicateBase
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
Definition: mitkNodePredicateBase.h:35
mitkNodePredicateBase.h
QmitkAbstractDataStorageInspector::m_NodePredicate
mitk::NodePredicateBase::ConstPointer m_NodePredicate
Definition: QmitkAbstractDataStorageInspector.h:119
QmitkAbstractDataStorageInspector::m_DataStorage
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
Definition: QmitkAbstractDataStorageInspector.h:118
QmitkAbstractDataStorageInspector::NodeList
QList< mitk::DataNode::Pointer > NodeList
Definition: QmitkAbstractDataStorageInspector.h:56
QmitkAbstractDataStorageInspector::m_Connector
std::unique_ptr< QmitkModelViewSelectionConnector > m_Connector
Definition: QmitkAbstractDataStorageInspector.h:121
MitkQtWidgetsExports.h
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
QmitkAbstractDataStorageInspector
This abstract class is a convenient base class for easy implementation of widgets that offer a specif...
Definition: QmitkAbstractDataStorageInspector.h:32
mitk::WeakPointer< mitk::DataStorage >
AbstractDataNodeAction::GetSelectedNodes
MITK_QT_APP QList< mitk::DataNode::Pointer > GetSelectedNodes(berry::IWorkbenchPartSite::Pointer workbenchPartSite)