Medical Imaging Interaction Toolkit  2023.12.99-5f0d6a86
Medical Imaging Interaction Toolkit
QmitkBoundingObjectWidget.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 QmitkBoundingObjectWidget_h
14 #define QmitkBoundingObjectWidget_h
15 
16 // includes
18 #include <QComboBox>
19 #include <QPushButton>
20 #include <QTreeWidget>
21 #include <mitkBoundingObject.h>
23 #include <mitkDataNode.h>
24 #include <mitkDataStorage.h>
25 #include <qwidget.h>
26 
28 {
29  Q_OBJECT
30 
31 public:
32  QmitkBoundingObjectWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
33  ~QmitkBoundingObjectWidget() override;
34 
35  void SetDataStorage(mitk::DataStorage *dataStorage);
36  mitk::DataStorage *GetDataStorage();
37  mitk::BoundingObject::Pointer GetSelectedBoundingObject();
38  mitk::DataNode::Pointer GetSelectedBoundingObjectNode();
39 
40  mitk::DataNode::Pointer GetAllBoundingObjects();
41 
42  void setEnabled(bool flag);
43 
44  void OnBoundingObjectModified(const itk::EventObject &e);
45 
46  void RemoveAllItems();
47 
48 signals:
49  // signal when bo has changed
50  void BoundingObjectsChanged();
51 
52 protected slots:
53  void CreateBoundingObject(int type);
54  void OnDelButtonClicked();
55  void SelectionChanged();
56  void OnItemDoubleClicked(QTreeWidgetItem *item, int col);
57  void OnItemDataChanged(QTreeWidgetItem *item, int col);
58 
59 protected:
60  void AddItem(mitk::DataNode *node);
61  void RemoveItem();
62 
64  QTreeWidget *m_TreeWidget;
65  QComboBox *m_addComboBox;
66  QPushButton *m_DelButton;
67  QPushButton *m_SaveButton;
68  QPushButton *m_LoadButton;
69  QTreeWidgetItem *m_lastSelectedItem;
70  unsigned long m_lastAffineObserver;
71 
72  typedef std::map<QTreeWidgetItem *, mitk::DataNode *> ItemNodeMapType;
74 
76 
78  {
83  };
84 };
85 #endif
QmitkBoundingObjectWidget::ItemNodeMapType
std::map< QTreeWidgetItem *, mitk::DataNode * > ItemNodeMapType
Definition: QmitkBoundingObjectWidget.h:72
MITKQTWIDGETSEXT_EXPORT
#define MITKQTWIDGETSEXT_EXPORT
Definition: MitkQtWidgetsExtExports.h:15
mitkDataStorage.h
QmitkBoundingObjectWidget::ELLIPSOID
@ ELLIPSOID
Definition: QmitkBoundingObjectWidget.h:81
QmitkBoundingObjectWidget::BoundingObjectType
BoundingObjectType
Definition: QmitkBoundingObjectWidget.h:77
itk::SmartPointer< Self >
QmitkBoundingObjectWidget::m_TreeWidget
QTreeWidget * m_TreeWidget
Definition: QmitkBoundingObjectWidget.h:64
QmitkBoundingObjectWidget
Definition: QmitkBoundingObjectWidget.h:27
QmitkBoundingObjectWidget::m_BoundingObjectCounter
unsigned int m_BoundingObjectCounter
Definition: QmitkBoundingObjectWidget.h:75
QmitkBoundingObjectWidget::m_lastAffineObserver
unsigned long m_lastAffineObserver
Definition: QmitkBoundingObjectWidget.h:70
QmitkBoundingObjectWidget::m_DataStorage
mitk::DataStorage * m_DataStorage
Definition: QmitkBoundingObjectWidget.h:63
QmitkBoundingObjectWidget::m_LoadButton
QPushButton * m_LoadButton
Definition: QmitkBoundingObjectWidget.h:68
QmitkBoundingObjectWidget::m_ItemNodeMap
ItemNodeMapType m_ItemNodeMap
Definition: QmitkBoundingObjectWidget.h:73
QmitkBoundingObjectWidget::CYLINDER
@ CYLINDER
Definition: QmitkBoundingObjectWidget.h:82
QmitkBoundingObjectWidget::m_DelButton
QPushButton * m_DelButton
Definition: QmitkBoundingObjectWidget.h:66
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitkDataNode.h
MitkQtWidgetsExtExports.h
QmitkBoundingObjectWidget::m_SaveButton
QPushButton * m_SaveButton
Definition: QmitkBoundingObjectWidget.h:67
mitkBoundingObject.h
QmitkBoundingObjectWidget::CUBOID
@ CUBOID
Definition: QmitkBoundingObjectWidget.h:79
QmitkBoundingObjectWidget::m_lastSelectedItem
QTreeWidgetItem * m_lastSelectedItem
Definition: QmitkBoundingObjectWidget.h:69
mitkBoundingObjectGroup.h
QmitkBoundingObjectWidget::m_addComboBox
QComboBox * m_addComboBox
Definition: QmitkBoundingObjectWidget.h:65
QmitkBoundingObjectWidget::CONE
@ CONE
Definition: QmitkBoundingObjectWidget.h:80
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63