Medical Imaging Interaction Toolkit  2022.04.99-3f7a773b
Medical Imaging Interaction Toolkit
QmitkMultiNodeSelectionWidget.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_MULTI_NODE_SELECTION_WIDGET_H
14 #define QMITK_MULTI_NODE_SELECTION_WIDGET_H
15 
16 #include <mitkDataStorage.h>
17 #include <mitkWeakPointer.h>
18 #include <mitkNodePredicateBase.h>
19 
21 
23 
24 #include "ui_QmitkMultiNodeSelectionWidget.h"
25 
27 
29 class QAbstractItemVew;
30 
36 {
37  Q_OBJECT
38 
39 public:
40  explicit QmitkMultiNodeSelectionWidget(QWidget* parent = nullptr);
41 
43 
50  using SelectionCheckFunctionType = std::function<std::string(const NodeList &)>;
57  void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction);
58 
59 public Q_SLOTS:
60  void OnEditSelection();
61 
62 protected Q_SLOTS:
63  void OnClearSelection(const mitk::DataNode* node);
64 
65 protected:
66  void changeEvent(QEvent *event) override;
67 
68  void UpdateInfo() override;
69  void OnInternalSelectionChanged() override;
70 
71  bool AllowEmissionOfSelection(const NodeList& emissionCandidates) const override;
72 
74 
76  mutable std::string m_CheckResponse;
77 
78  Ui_QmitkMultiNodeSelectionWidget m_Controls;
79 };
80 
81 #endif // QMITK_MULTI_NODE_SELECTION_WIDGET_H
Ui_QmitkMultiNodeSelectionWidget m_Controls
QList< mitk::DataNode::Pointer > NodeList
virtual void OnInternalSelectionChanged()
SelectionCheckFunctionType m_CheckFunction
std::function< std::string(const NodeList &)> SelectionCheckFunctionType
Helper function that is used to check the given selection for consistency. Returning an empty string ...
Widget that allows to perform and represents a multiple node selection.
virtual bool AllowEmissionOfSelection(const NodeList &emissionCandidates) const
QmitkSimpleTextOverlayWidget * m_Overlay
#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