Medical Imaging Interaction Toolkit  2022.04.99-3f7a773b
Medical Imaging Interaction Toolkit
QmitkSingleNodeSelectionWidget.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 QMITK_SINGLE_NODE_SELECTION_WIDGET_H
14 #define QMITK_SINGLE_NODE_SELECTION_WIDGET_H
15 
16 #include <mitkDataStorage.h>
17 #include <mitkWeakPointer.h>
18 #include <mitkNodePredicateBase.h>
19 
21 
22 #include "ui_QmitkSingleNodeSelectionWidget.h"
23 
26 
28 
41 {
42  Q_OBJECT
43 
44 public:
45  explicit QmitkSingleNodeSelectionWidget(QWidget* parent = nullptr);
46 
47  mitk::DataNode::Pointer GetSelectedNode() const;
48  bool GetAutoSelectNewNodes() const;
49 
51 
52 public Q_SLOTS:
53  void SetCurrentSelectedNode(mitk::DataNode* selectedNode);
54 
70  void SetAutoSelectNewNodes(bool autoSelect);
71 
72 protected Q_SLOTS:
73  virtual void OnClearSelection();
74 
75 protected:
76  void ReviseSelectionChanged(const NodeList& oldInternalSelection, NodeList& newInternalSelection) override;
77 
78  bool eventFilter(QObject *obj, QEvent *ev) override;
79  void EditSelection();
80  void UpdateInfo() override;
81 
82  void OnDataStorageChanged() override;
83  void OnNodeAddedToStorage(const mitk::DataNode* node) override;
84 
85  void AutoSelectNodes();
86 
89  mitk::DataNode::Pointer DetermineAutoSelectNode(const NodeList& ignoreNodes = {});
90 
93 
94  Ui_QmitkSingleNodeSelectionWidget m_Controls;
95 };
96 
97 #endif // QMITK_SINGLE_NODE_SELECTION_WIDGET_H
virtual void OnNodeAddedToStorage(const mitk::DataNode *node)
Ui_QmitkSingleNodeSelectionWidget m_Controls
QList< mitk::DataNode::Pointer > NodeList
virtual void ReviseSelectionChanged(const NodeList &oldInternalSelection, NodeList &newInternalSelection)
Widget that represents a node selection of (max) one node. It acts like a button. Clicking on it allo...
#define MITK_QT_COMMON
Abstract base class for the selection of data from a data storage.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63