]> OCCT Git - occt.git/commitdiff
0032829: Visualization - dynamic highlight results are not cleared by AIS_Interactive... CR32829_1
authorkgv <kgv@opencascade.com>
Fri, 11 Feb 2022 12:29:35 +0000 (15:29 +0300)
committermzernova <mzernova@opencascade.com>
Sat, 1 Feb 2025 18:09:47 +0000 (18:09 +0000)
AIS_InteractiveContext::RecomputeSelectionOnly() now removes old Owners of recomputed object from selection results.
vdisplay command now resets AIS_ViewController::ResetPreviousMoveTo() cache.

src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveContext.hxx
src/ViewerTest/ViewerTest.cxx

index 030fd67623b27c56b9bf1978bc3446bf7bec010b..67e4bed881e3ff42eb5ded314cbf63cfb77dad57 100644 (file)
@@ -956,9 +956,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;
index e3194bdebdc5896178935391dd9c2a284c7d9394..c2aab708d5b2b32c96eb0ba2b3152c9470ad2a9d 100644 (file)
@@ -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,
@@ -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
index 705939d64597bd9f0884ac12a05b2dea3ab4738e..fe5917b4e6f17ee349aef973b88e585a1628c7ae 100644 (file)
@@ -5193,6 +5193,8 @@ static int VDisplay2(Draw_Interpretor& theDI, Standard_Integer theArgNb, const c
     }
   }
 
+  // invalidate picking cache
+  ViewerTest::CurrentEventManager()->ResetPreviousMoveTo();
   return 0;
 }