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

Method UpdateButtonsEnabledState

Modules/SegmentationUI/src/QmitkToolSelectionBox.cpp:331–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void QmitkToolSelectionBox::UpdateButtonsEnabledState()
332{
333 auto buttons = m_ToolButtonGroup->buttons();
334
335 const auto refDataNode = m_ToolManager->GetReferenceData(0);
336 const mitk::BaseData* refData = nullptr;
337 if (nullptr != refDataNode)
338 {
339 refData = refDataNode->GetData();
340 }
341
342 const auto workingDataNode = m_ToolManager->GetWorkingData(0);
343 const mitk::BaseData* workingData = nullptr;
344 if (nullptr != workingDataNode)
345 {
346 workingData = workingDataNode->GetData();
347 }
348
349 for (const auto& button : std::as_const(buttons))
350 {
351 const auto buttonID = m_ToolButtonGroup->id(button);
352 const auto toolID = m_ToolIDForButtonID[buttonID];
353 const auto tool = m_ToolManager->GetToolById(toolID);
354
355 button->setEnabled(tool->CanHandle(refData, workingData));
356 }
357}
358
359void QmitkToolSelectionBox::RecreateButtons()
360{

Calls 7

GetToolByIdMethod · 0.80
GetReferenceDataMethod · 0.45
GetDataMethod · 0.45
GetWorkingDataMethod · 0.45
idMethod · 0.45
setEnabledMethod · 0.45
CanHandleMethod · 0.45

Tested by

no test coverage detected