]> OCCT Git - occt.git/commitdiff
0033112: Visualization - AIS_InteractiveContext::RecomputeSelectionOnly() may should...
authormzernova <mzernova@opencascade.com>
Fri, 2 Sep 2022 07:43:19 +0000 (10:43 +0300)
committersmoskvin <smoskvin@opencascade.com>
Mon, 5 Sep 2022 16:21:50 +0000 (19:21 +0300)
src/AIS/AIS_InteractiveContext.cxx

index 8bd2d868c474127a40a7dfb6369ce9d16f00621e..04d50baf789849eff221050bae5c15d40774fb43 100644 (file)
@@ -1,4 +1,4 @@
-// Created on: 1997-01-17
+// Created on: 1997-01-17
 // Created by: Robert COUBLANC
 // Copyright (c) 1997-1999 Matra Datavision
 // Copyright (c) 1999-2014 OPEN CASCADE SAS
@@ -1001,6 +1001,14 @@ void AIS_InteractiveContext::RecomputeSelectionOnly (const Handle(AIS_Interactiv
     return;
   }
 
+  TColStd_ListOfInteger aModes;
+  ActivatedModes (theIO, aModes);
+
+  for (TColStd_ListIteratorOfListOfInteger aModesIter (aModes); aModesIter.More(); aModesIter.Next())
+  {
+    mgrSelector->Deactivate (theIO, aModesIter.Value());
+  }
+
   mgrSelector->RecomputeSelection (theIO);
 
   const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIO);
@@ -1010,10 +1018,7 @@ void AIS_InteractiveContext::RecomputeSelectionOnly (const Handle(AIS_Interactiv
     return;
   }
 
-  TColStd_ListOfInteger aModes;
-  ActivatedModes (theIO, aModes);
-  TColStd_ListIteratorOfListOfInteger aModesIter (aModes);
-  for (; aModesIter.More(); aModesIter.Next())
+  for (TColStd_ListIteratorOfListOfInteger aModesIter (aModes); aModesIter.More(); aModesIter.Next())
   {
     mgrSelector->Activate (theIO, aModesIter.Value());
   }