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

Method OnNodeModified

Modules/QtWidgets/src/QmitkSynchronizedNodeSelectionWidget.cpp:396–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396void QmitkSynchronizedNodeSelectionWidget::OnNodeModified(const itk::Object* caller, const itk::EventObject& event)
397{
398 auto baseRenderer = m_BaseRenderer.Lock();
399 if (baseRenderer.IsNull())
400 {
401 return;
402 }
403
404 if (!itk::ModifiedEvent().CheckEvent(&event))
405 {
406 return;
407 }
408
409 auto node = dynamic_cast<const mitk::DataNode*>(caller);
410
411 if (m_NodePredicate.IsNull() || m_NodePredicate->CheckNode(node))
412 {
413 auto currentSelection = this->GetCurrentInternalSelection();
414 // check if the node to be modified is part of the current selection
415 auto finding = std::find(std::begin(currentSelection), std::end(currentSelection), node);
416 if (finding == std::end(currentSelection)) // node not found
417 {
418 // node not part of the selection
419 return;
420 }
421
422 // We know that the node is relevant, but we don't know if the node modification was relevant
423 // for the rendering. We just request an update here.
424 // Explicitly request an update since a renderer-specific property change does not mark the node as modified.
425 // see https://phabricator.mitk.org/T22322
426 mitk::RenderingManager::GetInstance()->RequestUpdate(baseRenderer->GetRenderWindow());
427 m_StorageModel->UpdateModelData();
428 }
429}
430
431void QmitkSynchronizedNodeSelectionWidget::ReinitNode(const mitk::DataNode* dataNode)
432{

Callers

nothing calls this directly

Calls 9

beginFunction · 0.85
endFunction · 0.85
LockMethod · 0.45
IsNullMethod · 0.45
CheckEventMethod · 0.45
CheckNodeMethod · 0.45
RequestUpdateMethod · 0.45
GetRenderWindowMethod · 0.45
UpdateModelDataMethod · 0.45

Tested by

no test coverage detected