]> OCCT Git - occt-copy.git/commitdiff
0025661: Visualization - AIS_InteractiveContext::Load() is not symmetric to the local...
authorsan <san@opencascade.com>
Thu, 25 Dec 2014 16:13:18 +0000 (19:13 +0300)
committersan <san@opencascade.com>
Thu, 25 Dec 2014 16:13:18 +0000 (19:13 +0300)
Register theIObj in the selection manager to prepare further activation of selection

src/AIS/AIS_InteractiveContext.cxx

index f220dbab6fb2bee8d9c420b0c4fa7e51dd25bccd..d07350ba5bbb512e90ae23ef8bed1ad358f497da 100644 (file)
@@ -558,13 +558,21 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
   }
 
   if (theSelMode == -1
-  && !theToAllowDecomposition
-  && !myObjects.IsBound (theIObj))
+  && !theToAllowDecomposition)
   {
-    Standard_Integer aDispMode, aHiMod, aSelModeDef;
-    GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
-    Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Erased, aDispMode, aSelModeDef);
-    myObjects.Bind (theIObj, aStatus);
+    if (!myObjects.IsBound (theIObj))
+    {
+      Standard_Integer aDispMode, aHiMod, aSelModeDef;
+      GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
+      Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Erased, aDispMode, aSelModeDef);
+      myObjects.Bind (theIObj, aStatus);
+    }
+
+    // Register theIObj in the selection manager to prepare further activation of selection
+    if (!mgrSelector->Contains (theIObj))
+    {
+      mgrSelector->Load (theIObj);
+    }
   }
 }