Medical Imaging Interaction Toolkit  2023.12.99-ed252ae7
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 Slots

virtual void setEnabled (bool)
 
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=nullptr, mitk::DataStorage *storage=nullptr)
 
 ~QmitkToolSelectionBox () override
 
mitk::ToolManagerGetToolManager ()
 
void SetToolManager (mitk::ToolManager &)
 
void SetDisplayedToolGroups (const std::string &toolGroups=nullptr)
 
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 UpdateButtonsEnabledState ()
 

Protected Member Functions

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
 

Detailed Description

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

See also
mitk::ToolManager

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 50 of file QmitkToolSelectionBox.h.

Constructor & Destructor Documentation

◆ QmitkToolSelectionBox()

QmitkToolSelectionBox::QmitkToolSelectionBox ( QWidget *  parent = nullptr,
mitk::DataStorage storage = nullptr 
)

◆ ~QmitkToolSelectionBox()

QmitkToolSelectionBox::~QmitkToolSelectionBox ( )
override

Member Function Documentation

◆ GetToolManager()

mitk::ToolManager* QmitkToolSelectionBox::GetToolManager ( )

◆ OnGeneralToolMessage()

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

◆ OnToolErrorMessage()

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

◆ OnToolGUIProcessEventsMessage()

void QmitkToolSelectionBox::OnToolGUIProcessEventsMessage ( )

◆ OnToolManagerReferenceDataModified()

void QmitkToolSelectionBox::OnToolManagerReferenceDataModified ( )

◆ OnToolManagerToolModified()

void QmitkToolSelectionBox::OnToolManagerToolModified ( )

◆ OnToolManagerWorkingDataModified()

void QmitkToolSelectionBox::OnToolManagerWorkingDataModified ( )

◆ RecreateButtons()

void QmitkToolSelectionBox::RecreateButtons ( )

◆ SetDisplayedToolGroups()

void QmitkToolSelectionBox::SetDisplayedToolGroups ( const std::string &  toolGroups = nullptr)

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 toolGroups . If there is a match, the tool is displayed. Effectively, you can provide a human readable list like "default, lymphnodevolumetry, oldERISstuff".

Parameters
toolGroups

◆ setEnabled

virtual void QmitkToolSelectionBox::setEnabled ( bool  )
virtualslot

◆ SetGenerateAccelerators

virtual void QmitkToolSelectionBox::SetGenerateAccelerators ( bool  )
virtualslot

◆ SetLayoutColumns

virtual void QmitkToolSelectionBox::SetLayoutColumns ( int  )
virtualslot

◆ SetOrUnsetButtonForActiveTool()

void QmitkToolSelectionBox::SetOrUnsetButtonForActiveTool ( )
protected

◆ SetShowNames

virtual void QmitkToolSelectionBox::SetShowNames ( bool  )
virtualslot

◆ SetToolGUIArea

virtual void QmitkToolSelectionBox::SetToolGUIArea ( QWidget *  parentWidget)
virtualslot

◆ SetToolManager()

void QmitkToolSelectionBox::SetToolManager ( mitk::ToolManager )

◆ toolButtonClicked

void QmitkToolSelectionBox::toolButtonClicked ( int  id)
protectedslot

◆ ToolSelected

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

◆ UpdateButtonsEnabledState

void QmitkToolSelectionBox::UpdateButtonsEnabledState ( )
protectedslot

Member Data Documentation

◆ m_ButtonIDForToolID

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 118 of file QmitkToolSelectionBox.h.

◆ m_ButtonLayout

QGridLayout* QmitkToolSelectionBox::m_ButtonLayout
protected

Definition at line 131 of file QmitkToolSelectionBox.h.

◆ m_DisplayedGroups

std::string QmitkToolSelectionBox::m_DisplayedGroups
protected

Definition at line 115 of file QmitkToolSelectionBox.h.

◆ m_GenerateAccelerators

bool QmitkToolSelectionBox::m_GenerateAccelerators
protected

Definition at line 124 of file QmitkToolSelectionBox.h.

◆ m_LastToolGUI

QmitkToolGUI* QmitkToolSelectionBox::m_LastToolGUI
protected

Definition at line 127 of file QmitkToolSelectionBox.h.

◆ m_LayoutColumns

int QmitkToolSelectionBox::m_LayoutColumns
protected

Definition at line 122 of file QmitkToolSelectionBox.h.

◆ m_SelfCall

bool QmitkToolSelectionBox::m_SelfCall
protected

Definition at line 113 of file QmitkToolSelectionBox.h.

◆ m_ShowNames

bool QmitkToolSelectionBox::m_ShowNames
protected

Definition at line 123 of file QmitkToolSelectionBox.h.

◆ m_ToolButtonGroup

QButtonGroup* QmitkToolSelectionBox::m_ToolButtonGroup
protected

Definition at line 130 of file QmitkToolSelectionBox.h.

◆ m_ToolGUIWidget

QWidget* QmitkToolSelectionBox::m_ToolGUIWidget
protected

Definition at line 126 of file QmitkToolSelectionBox.h.

◆ m_ToolIDForButtonID

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 120 of file QmitkToolSelectionBox.h.

◆ m_ToolManager

mitk::ToolManager::Pointer QmitkToolSelectionBox::m_ToolManager
protected

Definition at line 111 of file QmitkToolSelectionBox.h.


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