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

Method UpdateNode

Modules/Multilabel/src/mitkLabelHighlightGuard.cpp:75–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void 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}

Callers

nothing calls this directly

Calls 9

NewFunction · 0.50
GetNonConstPropertyMethod · 0.45
SetPropertyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
SetValueMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected