| 73 | } |
| 74 | |
| 75 | void mitk::LabelHighlightGuard::UpdateNode(DataNode* node, MultiLabelSegmentation::LabelValueVectorType labels, bool highlightInvisible) |
| 76 | { |
| 77 | if (nullptr == node) |
| 78 | return; |
| 79 | |
| 80 | mitk::IntVectorProperty::Pointer labelProperty = dynamic_cast<mitk::IntVectorProperty*>(node->GetNonConstProperty(PROPERTY_NAME_LABELS_HIGHLIGHTED())); |
| 81 | if (nullptr == labelProperty) |
| 82 | { |
| 83 | labelProperty = mitk::IntVectorProperty::New(); |
| 84 | node->SetProperty(PROPERTY_NAME_LABELS_HIGHLIGHTED(), labelProperty); |
| 85 | } |
| 86 | |
| 87 | mitk::IntVectorProperty::VectorType intValues(labels.begin(), labels.end()); |
| 88 | labelProperty->SetValue(intValues); |
| 89 | labelProperty->Modified(); //see T30386; needed because VectorProperty::SetValue does currently trigger no modified |
| 90 | |
| 91 | mitk::BoolProperty::Pointer invisibleProperty = dynamic_cast<mitk::BoolProperty*>(node->GetNonConstProperty(PROPERTY_NAME_HIGHLIGHT_INVISIBLE())); |
| 92 | if (nullptr == invisibleProperty) |
| 93 | { |
| 94 | invisibleProperty = mitk::BoolProperty::New(); |
| 95 | node->SetProperty(PROPERTY_NAME_HIGHLIGHT_INVISIBLE(), invisibleProperty); |
| 96 | } |
| 97 | |
| 98 | invisibleProperty->SetValue(highlightInvisible); |
| 99 | invisibleProperty->Modified(); //see T30386; needed because VectorProperty::SetValue does currently trigger no modified |
| 100 | } |
nothing calls this directly
no test coverage detected