Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
Medical Imaging Interaction Toolkit
QmitkToolSelectionBox.cpp
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 //#define MBILOG_ENABLE_DEBUG 1
14 
15 #include <QmitkStyleManager.h>
16 #include "QmitkToolSelectionBox.h"
17 #include "QmitkToolGUI.h"
18 #include "mitkBaseRenderer.h"
19 
20 #include <QList>
21 #include <qapplication.h>
22 #include <qlayout.h>
23 #include <qmessagebox.h>
24 #include <qtoolbutton.h>
25 #include <qtooltip.h>
26 
27 #include <queue>
28 
29 #include "usModuleResource.h"
30 #include "usModuleResourceStream.h"
31 
33 
35  : QWidget(parent),
36  m_SelfCall(false),
37  m_DisplayedGroups("default"),
38  m_LayoutColumns(2),
39  m_ShowNames(true),
40  m_GenerateAccelerators(false),
41  m_ToolGUIWidget(nullptr),
42  m_LastToolGUI(nullptr),
43  m_ToolButtonGroup(nullptr),
44  m_ButtonLayout(nullptr),
45  m_EnabledMode(EnabledWithReferenceAndWorkingDataVisible)
46 {
47  QFont currentFont = QWidget::font();
48  currentFont.setBold(true);
49  QWidget::setFont(currentFont);
50 
52 
53  // muellerm
54  // QButtonGroup
55  m_ToolButtonGroup = new QButtonGroup(this);
56  // some features of QButtonGroup
57  m_ToolButtonGroup->setExclusive(false); // mutually exclusive toggle buttons
58 
60 
61  QWidget::setContentsMargins(0, 0, 0, 0);
62  if (layout() != nullptr)
63  {
64  layout()->setContentsMargins(0, 0, 0, 0);
65  }
66 
67  // reactions to signals
68  connect(m_ToolButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(toolButtonClicked(int)));
69 
70  // reactions to ToolManager events
71 
72  m_ToolManager->ActiveToolChanged +=
74  m_ToolManager->ReferenceDataChanged +=
76  m_ToolManager->WorkingDataChanged +=
78 
79  // show active tool
81 
82  QWidget::setEnabled(false);
83 }
84 
86 {
87  m_ToolManager->ActiveToolChanged -=
89  m_ToolManager->ReferenceDataChanged -=
91  m_ToolManager->WorkingDataChanged -=
93 }
94 
96 {
97  m_EnabledMode = mode;
99 }
100 
102 {
103  return m_ToolManager;
104 }
105 
107  mitk::ToolManager &newManager) // no nullptr pointer allowed here, a manager is required
108 {
109  // say bye to the old manager
110  m_ToolManager->ActiveToolChanged -=
112  m_ToolManager->ReferenceDataChanged -=
114  m_ToolManager->WorkingDataChanged -=
116 
117  if (QWidget::isEnabled())
118  {
119  m_ToolManager->UnregisterClient();
120  }
121 
122  m_ToolManager = &newManager;
123  RecreateButtons();
124 
125  // greet the new one
126  m_ToolManager->ActiveToolChanged +=
128  m_ToolManager->ReferenceDataChanged +=
130  m_ToolManager->WorkingDataChanged +=
132 
133  if (QWidget::isEnabled())
134  {
135  m_ToolManager->RegisterClient();
136  }
137 
138  // ask the new one what the situation is like
140 }
141 
143 {
144  if (!QWidget::isEnabled())
145  return; // this method could be triggered from the constructor, when we are still disabled
146 
147  MITK_DEBUG << "toolButtonClicked(" << id << "): id translates to tool ID " << m_ToolIDForButtonID[id];
148 
149  // QToolButton* toolButton = dynamic_cast<QToolButton*>( Q3ButtonGroup::find(id) );
150  QToolButton *toolButton = dynamic_cast<QToolButton *>(m_ToolButtonGroup->buttons().at(id));
151  if (toolButton)
152  {
153  if ((m_ButtonIDForToolID.find(m_ToolManager->GetActiveToolID()) !=
154  m_ButtonIDForToolID.end()) // if we have this tool in our box
155  &&
156  (m_ButtonIDForToolID[m_ToolManager->GetActiveToolID()] ==
157  id)) // the tool corresponding to this button is already active
158  {
159  // disable this button, disable all tools
160  // mmueller
161  toolButton->setChecked(false);
162  m_ToolManager->ActivateTool(-1); // disable everything
163  }
164  else
165  {
166  // enable the corresponding tool
167  m_SelfCall = true;
168 
169  m_ToolManager->ActivateTool(m_ToolIDForButtonID[id]);
170 
171  m_SelfCall = false;
172  }
173  }
174 }
175 
177 {
179 }
180 
182 {
183  // we want to emit a signal in any case, whether we selected ourselves or somebody else changes "our" tool manager.
184  // --> emit before check on m_SelfCall
185  int id = m_ToolManager->GetActiveToolID();
186 
187  // don't emit signal for shape model tools
188  bool emitSignal = true;
189  mitk::Tool *tool = m_ToolManager->GetActiveTool();
190  if (tool && std::string(tool->GetGroup()) == "organ_segmentation")
191  emitSignal = false;
192 
193  if (emitSignal)
194  emit ToolSelected(id);
195 
196  // delete old GUI (if any)
198  {
199  if (m_ToolGUIWidget->layout())
200  {
201  m_ToolGUIWidget->layout()->removeWidget(m_LastToolGUI);
202  }
203 
204  // m_LastToolGUI->reparent(nullptr, QPoint(0,0));
205  // TODO: reparent <-> setParent, Daniel fragen
206  m_LastToolGUI->setParent(nullptr);
207  delete m_LastToolGUI; // will hopefully notify parent and layouts
208  m_LastToolGUI = nullptr;
209 
210  QLayout *layout = m_ToolGUIWidget->layout();
211  if (layout)
212  {
213  layout->activate();
214  }
215  }
216 
217  QToolButton *toolButton(nullptr);
218  // mitk::Tool* tool = m_ToolManager->GetActiveTool();
219 
220  if (m_ButtonIDForToolID.find(id) != m_ButtonIDForToolID.end()) // if this tool is in our box
221  {
222  // toolButton = dynamic_cast<QToolButton*>( Q3ButtonGroup::find( m_ButtonIDForToolID[id] ) );
223  toolButton = dynamic_cast<QToolButton *>(m_ToolButtonGroup->buttons().at(m_ButtonIDForToolID[id]));
224  }
225 
226  if (toolButton)
227  {
228  // mmueller
229  // uncheck all other buttons
230  QAbstractButton *tmpBtn = nullptr;
231  QList<QAbstractButton *>::iterator it;
232  for (int i = 0; i < m_ToolButtonGroup->buttons().size(); ++i)
233  {
234  tmpBtn = m_ToolButtonGroup->buttons().at(i);
235  if (tmpBtn != toolButton)
236  dynamic_cast<QToolButton *>(tmpBtn)->setChecked(false);
237  }
238 
239  toolButton->setChecked(true);
240 
241  if (m_ToolGUIWidget && tool)
242  {
243  // create and reparent new GUI (if any)
244  itk::Object::Pointer possibleGUI = tool->GetGUI("Qmitk", "GUI").GetPointer(); // prefix and postfix
245 
246  if (possibleGUI.IsNull())
247  possibleGUI = tool->GetGUI("", "GUI").GetPointer();
248 
249  QmitkToolGUI *gui = dynamic_cast<QmitkToolGUI *>(possibleGUI.GetPointer());
250 
252  m_LastToolGUI = gui;
253  if (gui)
254  {
255  gui->SetTool(tool);
256 
257  // mmueller
258  // gui->reparent(m_ToolGUIWidget, gui->geometry().topLeft(), true );
259  gui->setParent(m_ToolGUIWidget);
260  gui->move(gui->geometry().topLeft());
261  gui->show();
262 
263  QLayout *layout = m_ToolGUIWidget->layout();
264  if (!layout)
265  {
266  layout = new QVBoxLayout(m_ToolGUIWidget);
267  }
268  if (layout)
269  {
270  // mmueller
271  layout->addWidget(gui);
272  // layout->add( gui );
273  layout->activate();
274  }
275  }
276  }
277  }
278  else
279  {
280  // disable all buttons
281  QToolButton *selectedToolButton = dynamic_cast<QToolButton *>(m_ToolButtonGroup->checkedButton());
282  // QToolButton* selectedToolButton = dynamic_cast<QToolButton*>( Q3ButtonGroup::find( Q3ButtonGroup::selectedId() )
283  // );
284  if (selectedToolButton)
285  {
286  // mmueller
287  selectedToolButton->setChecked(false);
288  // selectedToolButton->setOn(false);
289  }
290  }
291 }
292 
294 {
295  if (m_SelfCall)
296  return;
297 
298  MITK_DEBUG << "OnToolManagerReferenceDataModified()";
299 
301 }
302 
304 {
305  if (m_SelfCall)
306  return;
307 
308  MITK_DEBUG << "OnToolManagerWorkingDataModified()";
309 
311 }
312 
317 {
318  mitk::DataNode *referenceNode = m_ToolManager->GetReferenceData(0);
319  mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
320 
321  // MITK_DEBUG << this->name() << ": SetGUIEnabledAccordingToToolManagerState: referenceNode " << (void*)referenceNode
322  // << " workingNode " << (void*)workingNode << " isVisible() " << isVisible();
323 
324  bool enabled = true;
325 
326  switch (m_EnabledMode)
327  {
328  default:
330  enabled = referenceNode && workingNode &&
331  referenceNode->IsVisible(
333  workingNode->IsVisible(
335  isVisible();
336  break;
338  enabled = referenceNode && isVisible();
339  break;
341  enabled = workingNode && isVisible();
342  break;
343  case AlwaysEnabled:
344  enabled = isVisible();
345  break;
346  }
347 
348  if (QWidget::isEnabled() == enabled)
349  return; // nothing to change
350 
351  QWidget::setEnabled(enabled);
352  if (enabled)
353  {
354  m_ToolManager->RegisterClient();
355 
356  int id = m_ToolManager->GetActiveToolID();
357  emit ToolSelected(id);
358  }
359  else
360  {
361  m_ToolManager->ActivateTool(-1);
362  m_ToolManager->UnregisterClient();
363 
364  emit ToolSelected(-1);
365  }
366 }
367 
372 {
374 }
375 
377 {
378  if (m_ToolManager.IsNull())
379  return;
380 
381  /*
382  // remove all buttons that are there
383  QObjectList *l = Q3ButtonGroup::queryList( "QButton" );
384  QObjectListIt it( *l ); // iterate over all buttons
385  QObject *obj;
386 
387  while ( (obj = it.current()) != 0 )
388  {
389  ++it;
390  QButton* button = dynamic_cast<QButton*>(obj);
391  if (button)
392  {
393  Q3ButtonGroup::remove(button);
394  delete button;
395  }
396  }
397  delete l; // delete the list, not the objects
398  */
399 
400  // mmueller Qt impl
401  QList<QAbstractButton *> l = m_ToolButtonGroup->buttons();
402  // remove all buttons that are there
403  QList<QAbstractButton *>::iterator it;
404  QAbstractButton *btn;
405 
406  for (it = l.begin(); it != l.end(); ++it)
407  {
408  btn = *it;
409  m_ToolButtonGroup->removeButton(btn);
410  // this->removeChild(btn);
411  delete btn;
412  }
413  // end mmueller Qt impl
414 
415  mitk::ToolManager::ToolVectorTypeConst allPossibleTools = m_ToolManager->GetTools();
417 
418  typedef std::pair<std::string::size_type, const mitk::Tool *> SortPairType;
419  typedef std::priority_queue<SortPairType> SortedToolQueueType;
420  SortedToolQueueType toolPositions;
421 
422  // clear and sort all tools
423  // step one: find name/group of all tools in m_DisplayedGroups string. remember these positions for all tools.
424  for (mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = allPossibleTools.begin();
425  iter != allPossibleTools.end();
426  ++iter)
427  {
428  const mitk::Tool *tool = *iter;
429 
430  std::string::size_type namePos = m_DisplayedGroups.find(std::string("'") + tool->GetName() + "'");
431  std::string::size_type groupPos = m_DisplayedGroups.find(std::string("'") + tool->GetGroup() + "'");
432 
433  if (!m_DisplayedGroups.empty() && namePos == std::string::npos && groupPos == std::string::npos)
434  continue; // skip
435 
436  if (m_DisplayedGroups.empty() && std::string(tool->GetName()).length() > 0)
437  {
438  namePos = static_cast<std::string::size_type>(tool->GetName()[0]);
439  }
440 
441  SortPairType thisPair = std::make_pair(namePos < groupPos ? namePos : groupPos, *iter);
442  toolPositions.push(thisPair);
443  }
444 
445  // step two: sort tools according to previously found positions in m_DisplayedGroups
446  MITK_DEBUG << "Sorting order of tools (lower number --> earlier in button group)";
447  while (!toolPositions.empty())
448  {
449  SortPairType thisPair = toolPositions.top();
450  MITK_DEBUG << "Position " << thisPair.first << " : " << thisPair.second->GetName();
451 
452  allTools.push_back(thisPair.second);
453  toolPositions.pop();
454  }
455  std::reverse(allTools.begin(), allTools.end());
456 
457  MITK_DEBUG << "Sorted tools:";
458  for (mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = allTools.begin(); iter != allTools.end(); ++iter)
459  {
460  MITK_DEBUG << (*iter)->GetName();
461  }
462 
463  // try to change layout... bad?
464  // Q3GroupBox::setColumnLayout ( m_LayoutColumns, Qt::Horizontal );
465  // mmueller using gridlayout instead of Q3GroupBox
466  // this->setLayout(0);
467  if (m_ButtonLayout == nullptr)
468  m_ButtonLayout = new QGridLayout;
469  /*else
470  delete m_ButtonLayout;*/
471 
472  int row(0);
473  int column(-1);
474 
475  int currentButtonID(0);
476  m_ButtonIDForToolID.clear();
477  m_ToolIDForButtonID.clear();
478  QToolButton *button = nullptr;
479 
480  MITK_DEBUG << "Creating buttons for tools";
481  // fill group box with buttons
482  for (mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = allTools.begin(); iter != allTools.end(); ++iter)
483  {
484  const mitk::Tool *tool = *iter;
485  int currentToolID(m_ToolManager->GetToolID(tool));
486 
487  ++column;
488  // new line if we are at the maximum columns
489  if (column == m_LayoutColumns)
490  {
491  ++row;
492  column = 0;
493  }
494 
495  button = new QToolButton;
496  button->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
497  // add new button to the group
498  MITK_DEBUG << "Adding button with ID " << currentToolID;
499  m_ToolButtonGroup->addButton(button, currentButtonID);
500  // ... and to the layout
501  MITK_DEBUG << "Adding button in row/column " << row << "/" << column;
502  m_ButtonLayout->addWidget(button, row, column);
503 
504  if (m_LayoutColumns == 1)
505  {
506  // button->setTextPosition( QToolButton::BesideIcon );
507  // mmueller
508  button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
509  }
510  else
511  {
512  // button->setTextPosition( QToolButton::BelowIcon );
513  // mmueller
514  button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
515  }
516 
517  // button->setToggleButton( true );
518  // mmueller
519  button->setCheckable(true);
520 
521  if (currentToolID == m_ToolManager->GetActiveToolID())
522  button->setChecked(true);
523 
524  QString label;
526  {
527  label += "&";
528  }
529  label += tool->GetName();
530  QString tooltip = tool->GetName();
531  MITK_DEBUG << tool->GetName() << ", " << label.toLocal8Bit().constData() << ", '"
532  << tooltip.toLocal8Bit().constData();
533 
534  if (m_ShowNames)
535  {
536  /*
537  button->setUsesTextLabel(true);
538  button->setTextLabel( label ); // a label
539  QToolTip::add( button, tooltip );
540  */
541  // mmueller Qt
542  button->setText(label); // a label
543  button->setToolTip(tooltip);
544  // mmueller
545 
546  QFont currentFont = button->font();
547  currentFont.setBold(false);
548  button->setFont(currentFont);
549  }
550 
551  us::ModuleResource iconResource = tool->GetIconResource();
552 
553  if (!iconResource.IsValid())
554  {
555  button->setIcon(QIcon(QPixmap(tool->GetXPM())));
556  }
557  else
558  {
559  auto isSVG = "svg" == iconResource.GetSuffix();
560  auto openmode = isSVG ? std::ios_base::in : std::ios_base::binary;
561 
562  us::ModuleResourceStream resourceStream(iconResource, openmode);
563  resourceStream.seekg(0, std::ios::end);
564  std::ios::pos_type length = resourceStream.tellg();
565  resourceStream.seekg(0, std::ios::beg);
566 
567  char *data = new char[length];
568  resourceStream.read(data, length);
569 
570  if (isSVG)
571  {
572  button->setIcon(QmitkStyleManager::ThemeIcon(QByteArray::fromRawData(data, length)));
573  }
574  else
575  {
576  QPixmap pixmap;
577  pixmap.loadFromData(QByteArray::fromRawData(data, length));
578  button->setIcon(QIcon(pixmap));
579  }
580 
581  delete[] data;
582 
583  if (m_ShowNames)
584  {
585  if (m_LayoutColumns == 1)
586  button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
587  else
588  button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
589 
590  button->setIconSize(QSize(24, 24));
591  }
592  else
593  {
594  button->setToolButtonStyle(Qt::ToolButtonIconOnly);
595  button->setIconSize(QSize(32, 32));
596  button->setToolTip(tooltip);
597  }
598  }
599 
601  {
602  QString firstLetter = QString(tool->GetName());
603  firstLetter.truncate(1);
604  button->setShortcut(
605  firstLetter); // a keyboard shortcut (just the first letter of the given name w/o any CTRL or something)
606  }
607 
608  mitk::DataNode *dataNode = m_ToolManager->GetReferenceData(0);
609 
610  if (dataNode != nullptr && !tool->CanHandle(dataNode->GetData()))
611  button->setEnabled(false);
612 
613  m_ButtonIDForToolID[currentToolID] = currentButtonID;
614  m_ToolIDForButtonID[currentButtonID] = currentToolID;
615 
616  MITK_DEBUG << "m_ButtonIDForToolID[" << currentToolID << "] == " << currentButtonID;
617  MITK_DEBUG << "m_ToolIDForButtonID[" << currentButtonID << "] == " << currentToolID;
618 
620  this, &QmitkToolSelectionBox::OnToolGUIProcessEventsMessage); // will never add a listener twice, so we don't have
621  // to check here
623  this,
624  &QmitkToolSelectionBox::OnToolErrorMessage); // will never add a listener twice, so we don't have to check here
625  tool->GeneralMessage +=
627 
628  ++currentButtonID;
629  }
630  // setting grid layout for this groupbox
631  this->setLayout(m_ButtonLayout);
632 
633  // this->update();
634 }
635 
637 {
638  qApp->processEvents();
639 }
640 
642 {
643  QMessageBox::critical(
644  this, "MITK", QString(s.c_str()), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);
645 }
646 
648 {
649  QMessageBox::information(
650  this, "MITK", QString(s.c_str()), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);
651 }
652 
653 void QmitkToolSelectionBox::SetDisplayedToolGroups(const std::string &toolGroups)
654 {
655  if (m_DisplayedGroups != toolGroups)
656  {
657  QString q_DisplayedGroups = toolGroups.c_str();
658  // quote all unquoted single words
659  q_DisplayedGroups = q_DisplayedGroups.replace(QRegExp("\\b(\\w+)\\b|'([^']+)'"), "'\\1\\2'");
660  MITK_DEBUG << "m_DisplayedGroups was \"" << toolGroups << "\"";
661 
662  m_DisplayedGroups = q_DisplayedGroups.toLocal8Bit().constData();
663  MITK_DEBUG << "m_DisplayedGroups is \"" << m_DisplayedGroups << "\"";
664 
665  RecreateButtons();
667  }
668 }
669 
671 {
672  if (columns > 0 && columns != m_LayoutColumns)
673  {
674  m_LayoutColumns = columns;
675  RecreateButtons();
676  }
677 }
678 
680 {
681  if (show != m_ShowNames)
682  {
683  m_ShowNames = show;
684  RecreateButtons();
685  }
686 }
687 
689 {
690  if (accel != m_GenerateAccelerators)
691  {
692  m_GenerateAccelerators = accel;
693  RecreateButtons();
694  }
695 }
696 
697 void QmitkToolSelectionBox::SetToolGUIArea(QWidget *parentWidget)
698 {
699  m_ToolGUIWidget = parentWidget;
700 }
701 
702 void QmitkToolSelectionBox::setTitle(const QString & /*title*/)
703 {
704 }
705 
707 {
708  QWidget::showEvent(e);
710 }
711 
713 {
714  QWidget::hideEvent(e);
716 }
virtual void SetGenerateAccelerators(bool)
virtual const char * GetName() const =0
Returns the name of this tool. Make it short!
std::vector< Tool::ConstPointer > ToolVectorTypeConst
Message GUIProcessEventsMessage
To let GUI process new events (e.g. qApp->processEvents() )
Definition: mitkTool.h:94
virtual const char * GetGroup() const
Name of a group.
Definition: mitkTool.cpp:108
std::map< int, int > m_ToolIDForButtonID
stores relationship between button IDs of the Qt widget and tool IDs of ToolManager ...
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:86
Data management class that handles &#39;was created by&#39; relations.
void ToolSelected(int id)
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
static vtkRenderWindow * GetRenderWindowByName(const std::string &name)
virtual void SetLayoutColumns(int)
virtual void SetEnabledMode(EnabledMode mode)
#define MITK_DEBUG
Definition: mitkLogMacros.h:22
Message1< std::string > ErrorMessage
To send error messages (to be shown by some GUI)
Definition: mitkTool.h:99
mitk::ToolManager::Pointer m_ToolManager
virtual bool CanHandle(BaseData *referenceData) const
Definition: mitkTool.cpp:62
virtual const char ** GetXPM() const =0
Returns an icon in the XPM format.
void hideEvent(QHideEvent *) override
void showEvent(QShowEvent *) override
virtual us::ModuleResource GetIconResource() const
Returns the tool button icon of the tool wrapped by a usModuleResource.
Definition: mitkTool.cpp:320
void setTitle(const QString &title)
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
bool IsVisible(const mitk::BaseRenderer *renderer, const char *propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
Definition: mitkDataNode.h:461
void OnGeneralToolMessage(std::string s)
QmitkToolSelectionBox(QWidget *parent=nullptr, mitk::DataStorage *storage=nullptr)
void SetDisplayedToolGroups(const std::string &toolGroups=nullptr)
void SetTool(mitk::Tool *tool)
Base class for GUIs belonging to mitk::Tool classes.
Definition: QmitkToolGUI.h:32
Message1< std::string > GeneralMessage
To send general messages (to be shown by some GUI)
Definition: mitkTool.h:109
std::string GetSuffix() const
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
Definition: jsoncpp.cpp:244
mitk::ToolManager * GetToolManager()
void OnToolErrorMessage(std::string s)
virtual void SetToolGUIArea(QWidget *parentWidget)
void SetToolManager(mitk::ToolManager &)
virtual itk::Object::Pointer GetGUI(const std::string &toolkitPrefix, const std::string &toolkitPostfix)
Interface for GUI creation.
Definition: mitkTool.cpp:175
virtual void SetShowNames(bool)
virtual mitk::ToolManager * GetToolManager(const std::string &context=SEGMENTATION)
Returns ToolManager object.
static QIcon ThemeIcon(const QByteArray &originalSVG)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
static mitk::ToolManagerProvider * GetInstance()
Returns an instance of ToolManagerProvider service.
std::map< int, int > m_ButtonIDForToolID
stores relationship between button IDs of the Qt widget and tool IDs of ToolManager ...
Manages and coordinates instances of mitk::Tool.