Skip to content

Commit

Permalink
0032829: Visualization - dynamic highlight results are not cleared by…
Browse files Browse the repository at this point in the history
… AIS_InteractiveContext::Redisplay()

AIS_InteractiveContext::RecomputeSelectionOnly() now removes old Owners of recomputed object from selection results.
vdisplay command now resets AIS_ViewController::ResetPreviousMoveTo() cache.
  • Loading branch information
gkv311 authored and mzernova committed Feb 2, 2025
1 parent 68a9da9 commit 67fbf45
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/AIS/AIS_InteractiveContext.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,19 @@ void AIS_InteractiveContext::RecomputeSelectionOnly(const Handle(AIS_Interactive
mgrSelector->Deactivate(theIO, aModesIter.Value());
}

mgrSelector->RecomputeSelection(theIO);

const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek(theIO);
if (aStatus != NULL)
{
if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable(theIO))
{
clearDynamicHighlight();
myLastPicked.Nullify();
}

unselectOwners(theIO);
}

mgrSelector->RecomputeSelection(theIO);
if (aStatus == NULL || theIO->DisplayStatus() != PrsMgr_DisplayStatus_Displayed)
{
return;
Expand Down
4 changes: 3 additions & 1 deletion src/AIS/AIS_InteractiveContext.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public: //! @name object display management
Standard_EXPORT void RemoveAll(const Standard_Boolean theToUpdateViewer);

//! Recomputes the seen parts presentation of the Object.
//! The object will be also unhighlighted and removed from selection.
//! If theAllModes equals true, all presentations are present in the object even if unseen.
Standard_EXPORT void Redisplay(const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer,
Expand All @@ -175,13 +176,14 @@ public: //! @name object display management
const Standard_Boolean theToUpdateViewer);

//! Recomputes the displayed presentations, flags the others.
//! Doesn't update presentations.
//! Doesn't update selections.
Standard_EXPORT void RecomputePrsOnly(const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer,
const Standard_Boolean theAllModes = Standard_False);

//! Recomputes the active selections, flags the others.
//! Doesn't update presentations.
//! The object will be also unhighlighted and removed from selection.
Standard_EXPORT void RecomputeSelectionOnly(const Handle(AIS_InteractiveObject)& anIObj);

//! Updates displayed interactive object by checking and recomputing its flagged as "to be
Expand Down
2 changes: 2 additions & 0 deletions src/ViewerTest/ViewerTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5193,6 +5193,8 @@ static int VDisplay2(Draw_Interpretor& theDI, Standard_Integer theArgNb, const c
}
}

// invalidate picking cache
ViewerTest::CurrentEventManager()->ResetPreviousMoveTo();
return 0;
}

Expand Down

0 comments on commit 67fbf45

Please sign in to comment.