| 329 | } |
| 330 | |
| 331 | void 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 | |
| 359 | void QmitkToolSelectionBox::RecreateButtons() |
| 360 | { |
no test coverage detected