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

Method OnNodeModified

Modules/QtWidgets/src/QmitkAbstractNodeSelectionWidget.cpp:356–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356void QmitkAbstractNodeSelectionWidget::OnNodeModified(const itk::Object* caller, const itk::EventObject& event)
357{
358 if (itk::ModifiedEvent().CheckEvent(&event))
359 {
360 auto node = dynamic_cast<const mitk::DataNode*>(caller);
361
362 if (node)
363 {
364 if (m_NodePredicate.IsNotNull() && !m_NodePredicate->CheckNode(node))
365 {
366 this->RemoveNodeFromInternalSelection(node);
367 }
368 else
369 {
370 auto oldAllowance = m_LastEmissionAllowance;
371 auto newEmission = this->CompileEmitSelection();
372 auto nonConstNode = const_cast<mitk::DataNode*>(node);
373 if (newEmission.contains(nonConstNode) && (oldAllowance != this->AllowEmissionOfSelection(newEmission)))
374 {
375 this->EmitSelection(newEmission);
376 this->UpdateInfo();
377 }
378 }
379 }
380 }
381}
382
383QmitkAbstractNodeSelectionWidget::NodeList QmitkAbstractNodeSelectionWidget::CompileEmitSelection() const
384{

Callers

nothing calls this directly

Calls 9

CompileEmitSelectionMethod · 0.95
EmitSelectionMethod · 0.95
IsNotNullMethod · 0.80
containsMethod · 0.80
CheckEventMethod · 0.45
CheckNodeMethod · 0.45
UpdateInfoMethod · 0.45

Tested by

no test coverage detected