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