Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkToolSelectionBox Class Reference

Display the tool selection state of a mitk::ToolManager. More...

#include <QmitkToolSelectionBox.h>

Inheritance diagram for QmitkToolSelectionBox:
Collaboration diagram for QmitkToolSelectionBox:

Public Types

enum  EnabledMode { EnabledWithReferenceAndWorkingDataVisible, EnabledWithReferenceData, EnabledWithWorkingData, AlwaysEnabled }
 

Public Slots

virtual void setEnabled (bool)
 
virtual void SetEnabledMode (EnabledMode mode)
 
virtual void SetLayoutColumns (int)
 
virtual void SetShowNames (bool)
 
virtual void SetGenerateAccelerators (bool)
 
virtual void SetToolGUIArea (QWidget *parentWidget)
 

Signals

void ToolSelected (int id)
 

Public Member Functions

 QmitkToolSelectionBox (QWidget *parent=0, mitk::DataStorage *storage=0)
 
virtual ~QmitkToolSelectionBox ()
 
mitk::ToolManagerGetToolManager ()
 
void SetToolManager (mitk::ToolManager &)
 
void setTitle (const QString &title)
 
void SetDisplayedToolGroups (const std::string &toolGroups=0)
 
void OnToolManagerToolModified ()
 
void OnToolManagerReferenceDataModified ()
 
void OnToolManagerWorkingDataModified ()
 
void OnToolGUIProcessEventsMessage ()
 
void OnToolErrorMessage (std::string s)
 
void OnGeneralToolMessage (std::string s)
 
void RecreateButtons ()
 

Protected Slots

void toolButtonClicked (int id)
 
void SetGUIEnabledAccordingToToolManagerState ()
 

Protected Member Functions

void showEvent (QShowEvent *) override
 
void hideEvent (QHideEvent *) override
 
void SetOrUnsetButtonForActiveTool ()
 

Protected Attributes

mitk::ToolManager::Pointer m_ToolManager
 
bool m_SelfCall
 
std::string m_DisplayedGroups
 
std::map< int, int > m_ButtonIDForToolID
 stores relationship between button IDs of the Qt widget and tool IDs of ToolManager More...
 
std::map< int, int > m_ToolIDForButtonID
 stores relationship between button IDs of the Qt widget and tool IDs of ToolManager More...
 
int m_LayoutColumns
 
bool m_ShowNames
 
bool m_GenerateAccelerators
 
QWidget * m_ToolGUIWidget
 
QmitkToolGUIm_LastToolGUI
 
QButtonGroup * m_ToolButtonGroup
 
QGridLayout * m_ButtonLayout
 
EnabledMode m_EnabledMode
 

Detailed Description

Display the tool selection state of a mitk::ToolManager.

See also
mitk::ToolManager

There is a separate page describing the general design of QmitkInteractiveSegmentation: QmitkInteractiveSegmentationTechnicalPage

This widget graphically displays the active tool of a mitk::ToolManager as a set of toggle buttons. Each button show the identification of a Tool (icon and name). When a button's toggle state is "down", the tool is activated. When a different button is clicked, the active tool is switched. When you click an already active button, the associated tool is deactivated with no replacement, which means that no tool is active then.

When this widget is enabled/disabled it (normally) also enables/disables the tools. There could be cases where two QmitkToolSelectionBox widgets are associated to the same ToolManager, but if this happens, please look deeply into the code.

Last contributor:

Author
maleike

Definition at line 57 of file QmitkToolSelectionBox.h.

Constructor & Destructor Documentation

QmitkToolSelectionBox::~QmitkToolSelectionBox ( )
virtual

Member Function Documentation

mitk::ToolManager * QmitkToolSelectionBox::GetToolManager ( )

Definition at line 104 of file QmitkToolSelectionBox.cpp.

References m_ToolManager.

void QmitkToolSelectionBox::hideEvent ( QHideEvent *  e)
overrideprotected
void QmitkToolSelectionBox::OnGeneralToolMessage ( std::string  s)

Definition at line 636 of file QmitkToolSelectionBox.cpp.

Referenced by RecreateButtons().

void QmitkToolSelectionBox::OnToolErrorMessage ( std::string  s)

Definition at line 630 of file QmitkToolSelectionBox.cpp.

Referenced by RecreateButtons().

void QmitkToolSelectionBox::OnToolGUIProcessEventsMessage ( )

Definition at line 625 of file QmitkToolSelectionBox.cpp.

Referenced by RecreateButtons().

void QmitkToolSelectionBox::OnToolManagerReferenceDataModified ( )
void QmitkToolSelectionBox::OnToolManagerToolModified ( )
void QmitkToolSelectionBox::OnToolManagerWorkingDataModified ( )
void QmitkToolSelectionBox::SetDisplayedToolGroups ( const std::string &  toolGroups = 0)

You may specify a list of tool "groups" that should be displayed in this widget. Every Tool can report its group as a string. This method will try to find the tool's group inside the supplied string

Parameters
toolGroups.If there is a match, the tool is displayed. Effectively, you can provide a human readable list like "default, lymphnodevolumetry, oldERISstuff".

Definition at line 642 of file QmitkToolSelectionBox.cpp.

References m_DisplayedGroups, MITK_DEBUG, RecreateButtons(), and SetOrUnsetButtonForActiveTool().

void QmitkToolSelectionBox::setEnabled ( bool  )
virtualslot

External enableization...

Definition at line 370 of file QmitkToolSelectionBox.cpp.

References SetGUIEnabledAccordingToToolManagerState().

void QmitkToolSelectionBox::SetEnabledMode ( EnabledMode  mode)
virtualslot
void QmitkToolSelectionBox::SetGenerateAccelerators ( bool  accel)
virtualslot

Definition at line 677 of file QmitkToolSelectionBox.cpp.

References m_GenerateAccelerators, and RecreateButtons().

void QmitkToolSelectionBox::SetLayoutColumns ( int  columns)
virtualslot

Definition at line 659 of file QmitkToolSelectionBox.cpp.

References m_LayoutColumns, and RecreateButtons().

void QmitkToolSelectionBox::SetShowNames ( bool  show)
virtualslot

Definition at line 668 of file QmitkToolSelectionBox.cpp.

References m_ShowNames, and RecreateButtons().

void QmitkToolSelectionBox::setTitle ( const QString &  title)

Definition at line 691 of file QmitkToolSelectionBox.cpp.

void QmitkToolSelectionBox::SetToolGUIArea ( QWidget *  parentWidget)
virtualslot

Definition at line 686 of file QmitkToolSelectionBox.cpp.

References m_ToolGUIWidget.

void QmitkToolSelectionBox::showEvent ( QShowEvent *  e)
overrideprotected
void QmitkToolSelectionBox::toolButtonClicked ( int  id)
protectedslot
void QmitkToolSelectionBox::ToolSelected ( int  id)
signal

Whenever a tool is activated. id is the index of the active tool. Counting starts at 0, -1 indicates "no tool selected" This signal is also emitted, when the whole QmitkToolSelectionBox get disabled. Then it will claim ToolSelected(-1) When it is enabled again, there will be another ToolSelected event with the tool that is currently selected

Referenced by SetGUIEnabledAccordingToToolManagerState(), and SetOrUnsetButtonForActiveTool().

Member Data Documentation

std::map<int, int> QmitkToolSelectionBox::m_ButtonIDForToolID
protected

stores relationship between button IDs of the Qt widget and tool IDs of ToolManager

Definition at line 136 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons(), SetOrUnsetButtonForActiveTool(), and toolButtonClicked().

QGridLayout* QmitkToolSelectionBox::m_ButtonLayout
protected

Definition at line 149 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons().

std::string QmitkToolSelectionBox::m_DisplayedGroups
protected

Definition at line 133 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons(), and SetDisplayedToolGroups().

EnabledMode QmitkToolSelectionBox::m_EnabledMode
protected
bool QmitkToolSelectionBox::m_GenerateAccelerators
protected

Definition at line 142 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons(), and SetGenerateAccelerators().

QmitkToolGUI* QmitkToolSelectionBox::m_LastToolGUI
protected

Definition at line 145 of file QmitkToolSelectionBox.h.

Referenced by SetOrUnsetButtonForActiveTool().

int QmitkToolSelectionBox::m_LayoutColumns
protected

Definition at line 140 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons(), and SetLayoutColumns().

bool QmitkToolSelectionBox::m_SelfCall
protected
bool QmitkToolSelectionBox::m_ShowNames
protected

Definition at line 141 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons(), and SetShowNames().

QButtonGroup* QmitkToolSelectionBox::m_ToolButtonGroup
protected
QWidget* QmitkToolSelectionBox::m_ToolGUIWidget
protected

Definition at line 144 of file QmitkToolSelectionBox.h.

Referenced by SetOrUnsetButtonForActiveTool(), and SetToolGUIArea().

std::map<int, int> QmitkToolSelectionBox::m_ToolIDForButtonID
protected

stores relationship between button IDs of the Qt widget and tool IDs of ToolManager

Definition at line 138 of file QmitkToolSelectionBox.h.

Referenced by RecreateButtons(), and toolButtonClicked().


The documentation for this class was generated from the following files: