Medical Imaging Interaction Toolkit  2022.04.99-3f7a773b
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 
27 class QAbstractItemVew;
28 
35 {
36  Q_OBJECT
37 
38 public:
39 
41 
47  void SetDataStorage(mitk::DataStorage* dataStorage);
48 
54  virtual void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
55 
56  const mitk::NodePredicateBase* GetNodePredicate() const;
57 
58  using NodeList = QList<mitk::DataNode::Pointer>;
59 
61  NodeList GetSelectedNodes() const;
62 
64  virtual QAbstractItemView* GetView() = 0;
65  virtual const QAbstractItemView* GetView() const = 0;
66 
68  bool GetSelectOnlyVisibleNodes() const;
69 
70  using SelectionMode = QAbstractItemView::SelectionMode;
71 
73  virtual void SetSelectionMode(SelectionMode mode) = 0;
74  virtual SelectionMode GetSelectionMode() const = 0;
75 
76 Q_SIGNALS:
82  void CurrentSelectionChanged(NodeList nodes);
83 
84  public Q_SLOTS:
96  void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
97 
110  void SetCurrentSelection(NodeList selectedNodes);
111 
112 protected Q_SLOTS:
113  void OnSelectionChanged(NodeList selectedNodes);
114 
115 protected:
118  virtual void Initialize() = 0;
119 
122 
123  std::unique_ptr<QmitkModelViewSelectionConnector> m_Connector;
124 
125  QmitkAbstractDataStorageInspector(QWidget* parent = nullptr);
126 
127 };
128 
129 #endif // QMITKABSTRACTDATASTORAGEMODEL_H
Data management class that handles &#39;was created by&#39; relations.
mitk::NodePredicateBase::ConstPointer m_NodePredicate
#define MITKQTWIDGETS_EXPORT
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
QAbstractItemView::SelectionMode SelectionMode
std::unique_ptr< QmitkModelViewSelectionConnector > m_Connector
This abstract class is a convenient base class for easy implementation of widgets that offer a specif...
MITK_QT_APP QList< mitk::DataNode::Pointer > GetSelectedNodes(berry::IWorkbenchPartSite::Pointer workbenchPartSite)