]> OCCT Git - occt.git/commitdiff
0032829: Visualization - dynamic highlight results are not cleared by AIS_Interactive... CR32829
authorkgv <kgv@opencascade.com>
Fri, 11 Feb 2022 12:29:35 +0000 (15:29 +0300)
committerkgv <kgv@opencascade.com>
Fri, 11 Feb 2022 13:35:44 +0000 (16:35 +0300)
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 a2130989aca6b162552aa28626e8dfd1ce782ff3..7525f7ef80525c1f1a5af36a1c80018a8ae025d9 100644 (file)
@@ -996,6 +996,7 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
     myMainVwr->Update();
   }
 }
+
 //=======================================================================
 //function : RecomputeSelectionOnly
 //purpose  : 
@@ -1007,9 +1008,20 @@ void AIS_InteractiveContext::RecomputeSelectionOnly (const Handle(AIS_Interactiv
     return;
   }
 
-  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)
   {
index 5b9ec24c2836b8f8b1f49d31f4449babf691f398..d2c6808482c5387354aa46488a8c2fd322685a62 100644 (file)
@@ -147,6 +147,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,
@@ -159,13 +160,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 recomputed" presentation and selection structures.
index 533ffb7a4a8b244a81663a7035e44e67dab9de2d..4a4b81857d52f08e6f3ba1da27ade169232283d8 100644 (file)
@@ -5238,6 +5238,8 @@ static int VDisplay2 (Draw_Interpretor& theDI,
     }
   }
 
+  // invalidate picking cache
+  ViewerTest::CurrentEventManager()->ResetPreviousMoveTo();
   return 0;
 }