Medical Imaging Interaction Toolkit  2025.12.02
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);
58 
60  void SetToolManager(mitk::ToolManager &); // no nullptr pointer allowed here, a manager is required
61 
71  void SetDisplayedToolGroups(const std::string &toolGroups = nullptr);
72 
76 
78  void OnToolErrorMessage(std::string s);
79  void OnGeneralToolMessage(std::string s);
80 
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);
106 
107 protected:
108 
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
#define MITKSEGMENTATIONUI_EXPORT
Base class for GUIs belonging to mitk::Tool classes.
Definition: QmitkToolGUI.h:34
Display the tool selection state of a mitk::ToolManager.
void OnToolGUIProcessEventsMessage()
mitk::ToolManager::Pointer m_ToolManager
std::map< int, int > m_ButtonIDForToolID
stores relationship between button IDs of the Qt widget and tool IDs of ToolManager
~QmitkToolSelectionBox() override
void OnGeneralToolMessage(std::string s)
std::map< int, int > m_ToolIDForButtonID
stores relationship between button IDs of the Qt widget and tool IDs of ToolManager
virtual void SetToolGUIArea(QWidget *parentWidget)
void OnToolManagerReferenceDataModified()
void UpdateButtonsEnabledState()
void SetOrUnsetButtonForActiveTool()
mitk::ToolManager * GetToolManager()
void ToolSelected(int id)
QmitkToolSelectionBox(QWidget *parent=nullptr, mitk::DataStorage *storage=nullptr)
void SetToolManager(mitk::ToolManager &)
void SetDisplayedToolGroups(const std::string &toolGroups=nullptr)
virtual void setEnabled(bool)
void OnToolErrorMessage(std::string s)
void OnToolManagerToolModified()
virtual void SetShowNames(bool)
virtual void SetLayoutColumns(int)
virtual void SetGenerateAccelerators(bool)
void toolButtonClicked(int id)
void OnToolManagerWorkingDataModified()
Data management class that handles 'was created by' relations.
Manages and coordinates instances of mitk::Tool.