Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkToolSelectionBox.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 QmitkToolSelectionBox_h
14 #define QmitkToolSelectionBox_h
15 
16 #include "QmitkToolGUIArea.h"
18 
19 #include "mitkToolManager.h"
20 
21 #include <QButtonGroup>
22 #include <QGridLayout>
23 #include <QWidget>
24 
25 #include <map>
26 
27 class QmitkToolGUI;
28 
52 {
53  Q_OBJECT
54 
55 public:
56  QmitkToolSelectionBox(QWidget *parent = nullptr, mitk::DataStorage *storage = nullptr);
57  ~QmitkToolSelectionBox() override;
58 
59  mitk::ToolManager *GetToolManager();
60  void SetToolManager(mitk::ToolManager &); // no nullptr pointer allowed here, a manager is required
61 
71  void SetDisplayedToolGroups(const std::string &toolGroups = nullptr);
72 
73  void OnToolManagerToolModified();
74  void OnToolManagerReferenceDataModified();
75  void OnToolManagerWorkingDataModified();
76 
77  void OnToolGUIProcessEventsMessage();
78  void OnToolErrorMessage(std::string s);
79  void OnGeneralToolMessage(std::string s);
80 
81  void RecreateButtons();
82 
83 signals:
84 
90  void ToolSelected(int id);
91 
92 public slots:
93 
94  virtual void setEnabled(bool);
95 
96  virtual void SetLayoutColumns(int);
97  virtual void SetShowNames(bool);
98  virtual void SetGenerateAccelerators(bool);
99 
100  virtual void SetToolGUIArea(QWidget *parentWidget);
101 
102 protected slots:
103 
104  void toolButtonClicked(int id);
105  void UpdateButtonsEnabledState();
106 
107 protected:
108 
109  void SetOrUnsetButtonForActiveTool();
110 
111  mitk::ToolManager::Pointer m_ToolManager;
112 
114 
115  std::string m_DisplayedGroups;
116 
118  std::map<int, int> m_ButtonIDForToolID;
120  std::map<int, int> m_ToolIDForButtonID;
121 
125 
126  QWidget *m_ToolGUIWidget;
128 
129  // store buttons in this group
130  QButtonGroup *m_ToolButtonGroup;
131  QGridLayout *m_ButtonLayout;
132 };
133 
134 #endif
QmitkToolSelectionBox::m_ToolButtonGroup
QButtonGroup * m_ToolButtonGroup
Definition: QmitkToolSelectionBox.h:130
MITKSEGMENTATIONUI_EXPORT
#define MITKSEGMENTATIONUI_EXPORT
Definition: MitkSegmentationUIExports.h:15
QmitkToolGUI
Base class for GUIs belonging to mitk::Tool classes.
Definition: QmitkToolGUI.h:33
QmitkToolGUIArea.h
QmitkToolSelectionBox::m_SelfCall
bool m_SelfCall
Definition: QmitkToolSelectionBox.h:113
QmitkToolSelectionBox::m_LastToolGUI
QmitkToolGUI * m_LastToolGUI
Definition: QmitkToolSelectionBox.h:127
QmitkToolSelectionBox
Display the tool selection state of a mitk::ToolManager.
Definition: QmitkToolSelectionBox.h:50
mitk::ToolManager
Manages and coordinates instances of mitk::Tool.
Definition: mitkToolManager.h:78
QmitkToolSelectionBox::m_ShowNames
bool m_ShowNames
Definition: QmitkToolSelectionBox.h:123
QmitkToolSelectionBox::m_ButtonIDForToolID
std::map< int, int > m_ButtonIDForToolID
stores relationship between button IDs of the Qt widget and tool IDs of ToolManager
Definition: QmitkToolSelectionBox.h:118
QmitkToolSelectionBox::m_ToolIDForButtonID
std::map< int, int > m_ToolIDForButtonID
stores relationship between button IDs of the Qt widget and tool IDs of ToolManager
Definition: QmitkToolSelectionBox.h:120
QmitkToolSelectionBox::m_GenerateAccelerators
bool m_GenerateAccelerators
Definition: QmitkToolSelectionBox.h:124
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
QmitkToolSelectionBox::m_LayoutColumns
int m_LayoutColumns
Definition: QmitkToolSelectionBox.h:122
QmitkToolSelectionBox::m_ToolGUIWidget
QWidget * m_ToolGUIWidget
Definition: QmitkToolSelectionBox.h:126
MitkSegmentationUIExports.h
QmitkToolSelectionBox::m_ToolManager
mitk::ToolManager::Pointer m_ToolManager
Definition: QmitkToolSelectionBox.h:111
QmitkToolSelectionBox::m_ButtonLayout
QGridLayout * m_ButtonLayout
Definition: QmitkToolSelectionBox.h:131
QmitkToolSelectionBox::m_DisplayedGroups
std::string m_DisplayedGroups
Definition: QmitkToolSelectionBox.h:115
mitkToolManager.h