| 1483 | } |
| 1484 | |
| 1485 | void QmitkMultiLabelInspector::OnClearLabel(bool /*value*/) |
| 1486 | { |
| 1487 | auto currentLabel = GetFirstSelectedLabelObject(); |
| 1488 | QString question = "Do you really want to clear the contents of label \"" + QString::fromStdString(currentLabel->GetName())+"\"?"; |
| 1489 | |
| 1490 | QMessageBox::StandardButton answerButton = |
| 1491 | QMessageBox::question(this, "Clear label", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes); |
| 1492 | |
| 1493 | if (answerButton == QMessageBox::Yes) |
| 1494 | { |
| 1495 | this->WaitCursorOn(); |
| 1496 | |
| 1497 | mitk::SegGroupModifyUndoRedoHelper undoRedoGenerator(m_Segmentation, { m_Segmentation->GetGroupIndexOfLabel(currentLabel->GetValue()) }, true, 0, true, false, true); |
| 1498 | |
| 1499 | m_Segmentation->EraseLabel(currentLabel->GetValue()); |
| 1500 | |
| 1501 | undoRedoGenerator.RegisterUndoRedoOperationEvent("Clear label \"" + mitk::LabelSetImageHelper::CreateDisplayLabelName(m_Segmentation, currentLabel) + "\""); |
| 1502 | |
| 1503 | this->WaitCursorOff(); |
| 1504 | |
| 1505 | // this is needed as workaround for (T27307). It circumvents the fact that modifications |
| 1506 | // of data (here the segmentation) does not directly trigger the modification of the |
| 1507 | // owning node (see T27307). Therefore other code (like renderers or model views) that e.g. |
| 1508 | // listens to the datastorage for modification would not get notified. |
| 1509 | if (m_SegmentationNode.IsNotNull()) |
| 1510 | { |
| 1511 | m_SegmentationNode->Modified(); |
| 1512 | mitk::RenderingManager::GetInstance()->RequestUpdateAll(); |
| 1513 | } |
| 1514 | } |
| 1515 | } |
| 1516 | |
| 1517 | void QmitkMultiLabelInspector::OnRenameGroup() |
| 1518 | { |
nothing calls this directly
no test coverage detected