Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _QMITKBOUNDINGOBJECTWIDGET_H_INCLUDED
18 #define _QMITKBOUNDINGOBJECTWIDGET_H_INCLUDED
19 
20 // includes
22 #include <QComboBox>
23 #include <QPushButton>
24 #include <QTreeWidget>
25 #include <mitkBoundingObject.h>
27 #include <mitkDataNode.h>
28 #include <mitkDataStorage.h>
29 #include <qwidget.h>
30 
32 {
33  Q_OBJECT
34 
35 public:
36  QmitkBoundingObjectWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
38 
39  void SetDataStorage(mitk::DataStorage *dataStorage);
41  mitk::BoundingObject::Pointer GetSelectedBoundingObject();
42  mitk::DataNode::Pointer GetSelectedBoundingObjectNode();
43 
44  mitk::DataNode::Pointer GetAllBoundingObjects();
45 
46  void setEnabled(bool flag);
47 
48  void OnBoundingObjectModified(const itk::EventObject &e);
49 
50  void RemoveAllItems();
51 
52 signals:
53  // signal when bo has changed
54  void BoundingObjectsChanged();
55 
56 protected slots:
57  void CreateBoundingObject(int type);
58  void OnDelButtonClicked();
59  void SelectionChanged();
60  void OnItemDoubleClicked(QTreeWidgetItem *item, int col);
61  void OnItemDataChanged(QTreeWidgetItem *item, int col);
62 
63 protected:
64  void AddItem(mitk::DataNode *node);
65  void RemoveItem();
66 
68  QTreeWidget *m_TreeWidget;
69  QComboBox *m_addComboBox;
70  QPushButton *m_DelButton;
71  QPushButton *m_SaveButton;
72  QPushButton *m_LoadButton;
73  QTreeWidgetItem *m_lastSelectedItem;
74  unsigned long m_lastAffineObserver;
75 
76  typedef std::map<QTreeWidgetItem *, mitk::DataNode *> ItemNodeMapType;
77  ItemNodeMapType m_ItemNodeMap;
78 
80 
82  {
87  };
88 };
89 #endif
std::map< QTreeWidgetItem *, mitk::DataNode * > ItemNodeMapType
Data management class that handles 'was created by' relations.
#define MITKQTWIDGETSEXT_EXPORT
static mitk::DataStorage::Pointer GetDataStorage()
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66