]> OCCT Git - occt-copy.git/commitdiff
0030784: Visualization - check if selectable of owner in internal container in AIS_In...
authornds <nds@opencascade.com>
Wed, 12 Feb 2020 22:55:17 +0000 (01:55 +0300)
committersnn <sergey.nikonov@opencascade.com>
Tue, 16 Mar 2021 15:14:45 +0000 (18:14 +0300)
(cherry picked from commit 707e554dba56681d110b164cb4ea8b47723e7007)

# Conflicts:
# src/AIS/AIS_InteractiveContext_1.cxx

src/AIS/AIS_InteractiveContext_1.cxx

index 5b73bb26c270fd3b09beb60bb79883baa805802b..f448ece0b7049fb4004cfa9a0a1d2bc8b8055086 100644 (file)
@@ -123,7 +123,12 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
     return;
   }
 
-  const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, theDispMode);
+  Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (theObj);
+  if (!aStatusPtr)
+  {
+    return;
+  }
+  const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, (*aStatusPtr)->DisplayMode());
   const Handle(SelectMgr_EntityOwner)& aGlobOwner = theObj->GlobalSelOwner();
 
   if (aGlobOwner.IsNull())
@@ -194,7 +199,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
     {
       anObjToClear.Add (anInteractive);
     }
-    if (anOwner == anInteractive->GlobalSelOwner())
+    if (aStatusPtr && anOwner == anInteractive->GlobalSelOwner())
     {
       (*aStatusPtr)->SetHilightStatus (Standard_False);
     }
@@ -575,7 +580,16 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_SelectionScheme theSe
   }*/
 
   AIS_NListOfEntityOwner aPickedOwners;
-  aPickedOwners.Append (myLastPicked);
+  if (!myLastPicked.IsNull() &&
+      myLastPicked->HasSelectable())
+  {
+    Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(myLastPicked->Selectable());
+    if (!anIO.IsNull() &&
+        myObjects.IsBound(anIO))
+    {
+      aPickedOwners.Append (myLastPicked);
+    }
+  }
 
   return Select (aPickedOwners, theSelScheme);
 }