| 394 | } |
| 395 | |
| 396 | void 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 | |
| 431 | void QmitkSynchronizedNodeSelectionWidget::ReinitNode(const mitk::DataNode* dataNode) |
| 432 | { |
nothing calls this directly
no test coverage detected