Skip to content

Commit

Permalink
BUG: Fix unnecessary confirmation popup after hovering over markups
Browse files Browse the repository at this point in the history
When the mouse hovers over markups, active component (that is shown highlighted with different color) temporarily changes.
These changes also triggered MTime update in the display node, which resulted in unnecessary confirmation popups at scene close or exit.

Updated vtkMRMLMarkupsDisplayNode to invoke a modified event if active component is changed, but do not update its MTime to prevent unnecessary warning popups.
  • Loading branch information
lassoan committed Oct 19, 2024
1 parent e6fad7e commit 18eec9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Modules/Loadable/Markups/MRML/vtkMRMLMarkupsDisplayNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,9 @@ void vtkMRMLMarkupsDisplayNode::SetActiveComponent(int componentType, int compon
}
this->ActiveComponents[context].Index = componentIndex;
this->ActiveComponents[context].Type = componentType;
this->Modified();
// Let observers know about node modification, but do not change the modified timestamp, as this is transient event
// (we do not want the application to display a warning popup on scene close exit if the mouse has hovered over a control point)
this->InvokeCustomModifiedEvent(vtkCommand::ModifiedEvent);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -785,7 +787,9 @@ int vtkMRMLMarkupsDisplayNode::UpdateActiveControlPointWorld(

if (activeComponentChanged)
{
this->Modified();
// Let observers know about node modification, but do not change the modified timestamp, as this is transient event
// (we do not want the application to display a warning popup on scene close exit if the mouse has hovered over a control point)
this->InvokeCustomModifiedEvent(vtkCommand::ModifiedEvent);
}

return controlPointIndex;
Expand Down

0 comments on commit 18eec9e

Please sign in to comment.