Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 
14 #ifndef QMITK_SINGLE_NODE_SELECTION_WIDGET_H
15 #define QMITK_SINGLE_NODE_SELECTION_WIDGET_H
16 
17 #include <mitkDataStorage.h>
18 #include <mitkWeakPointer.h>
19 #include <mitkNodePredicateBase.h>
20 
22 
23 #include "ui_QmitkSingleNodeSelectionWidget.h"
24 
27 
29 
36 {
37  Q_OBJECT
38 
39 public:
40  explicit QmitkSingleNodeSelectionWidget(QWidget* parent = nullptr);
41 
42  mitk::DataNode::Pointer GetSelectedNode() const;
43  bool GetAutoSelectNewNodes() const;
44 
46 
47 public Q_SLOTS:
48  void SetCurrentSelectedNode(mitk::DataNode* selectedNode);
49 
56  void SetAutoSelectNewNodes(bool autoSelect);
57 
58 protected Q_SLOTS:
59  virtual void OnClearSelection();
60 
61 protected:
62  void ReviseSelectionChanged(const NodeList& oldInternalSelection, NodeList& newInternalSelection) override;
63 
64  bool eventFilter(QObject *obj, QEvent *ev) override;
65  void EditSelection();
66  void UpdateInfo() override;
67 
68  void OnNodeAddedToStorage(const mitk::DataNode* node) override;
69 
72  mitk::DataNode::Pointer DetermineAutoSelectNode(const NodeList& ignoreNodes = {});
73 
76 
77  Ui_QmitkSingleNodeSelectionWidget m_Controls;
78 };
79 
80 #endif // QmitkSingleNodeSelectionWidget_H
Ui_QmitkSingleNodeSelectionWidget m_Controls
QList< mitk::DataNode::Pointer > NodeList
virtual void ReviseSelectionChanged(const NodeList &oldInternalSelection, NodeList &newInternalSelection)
virtual void OnNodeAddedToStorage(const mitk::DataNode *node)
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:57