MCPcopy Create free account
hub / github.com/MITK/MITK / SetToolManager

Method SetToolManager

Modules/SegmentationUI/src/QmitkToolSelectionBox.cpp:99–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void QmitkToolSelectionBox::SetToolManager(
100 mitk::ToolManager &newManager) // no nullptr pointer allowed here, a manager is required
101{
102 // say bye to the old manager
103 m_ToolManager->ActiveToolChanged -=
104 mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerToolModified);
105 m_ToolManager->ReferenceDataChanged -=
106 mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerReferenceDataModified);
107 m_ToolManager->WorkingDataChanged -=
108 mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerWorkingDataModified);
109
110 if (QWidget::isEnabled())
111 {
112 m_ToolManager->UnregisterClient();
113 }
114
115 m_ToolManager = &newManager;
116 RecreateButtons();
117
118 // greet the new one
119 m_ToolManager->ActiveToolChanged +=
120 mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerToolModified);
121 m_ToolManager->ReferenceDataChanged +=
122 mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerReferenceDataModified);
123 m_ToolManager->WorkingDataChanged +=
124 mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerWorkingDataModified);
125
126 if (QWidget::isEnabled())
127 {
128 m_ToolManager->RegisterClient();
129 }
130
131 // ask the new one what the situation is like
132 SetOrUnsetButtonForActiveTool();
133}
134
135void QmitkToolSelectionBox::toolButtonClicked(int id)
136{

Callers

nothing calls this directly

Calls 2

UnregisterClientMethod · 0.80
RegisterClientMethod · 0.80

Tested by

no test coverage detected