]> OCCT Git - occt-copy.git/commitdiff
0030728: Visualization - using one implementation of highlight/unhighlight in context
authornds <nds@opencascade.com>
Wed, 4 Sep 2019 06:47:42 +0000 (09:47 +0300)
committernds <nds@opencascade.com>
Wed, 4 Sep 2019 06:47:42 +0000 (09:47 +0300)
#fix regression found by DRAW tests

src/AIS/AIS_InteractiveContext_1.cxx

index 0d7cbde17793b4f82c9bb8aa51a9f9aa68324592..96c8509c77c3176dfb47b88803613426cf6ad304 100644 (file)
@@ -86,7 +86,27 @@ void AIS_InteractiveContext::highlightWithColor (const Handle(SelectMgr_EntityOw
 void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner)
 {
   AIS_NListOfEntityOwner anOwners;
-  anOwners.Append (theOwner);
+  const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
+  if (anObj.IsNull())
+  {
+    return;
+  }
+
+  if (!theOwner->IsAutoHilight())
+  {
+    SelectMgr_SequenceOfOwner aSeq;
+    for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
+    {
+      if (aSelIter.Value()->IsSameSelectable (anObj))
+      {
+        anOwners.Append (aSelIter.Value());
+      }
+    }
+  }
+  else
+  {
+    anOwners.Append (theOwner);
+  }
   highlightOwners (anOwners, Standard_False/*check if it is really important*/);
 }
 
@@ -114,7 +134,21 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
   }
 
   AIS_NListOfEntityOwner anOwners;
-  anOwners.Append (aGlobOwner);
+  if (!aGlobOwner->IsAutoHilight())
+  {
+    SelectMgr_SequenceOfOwner aSeq;
+    for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
+    {
+      if (aSelIter.Value()->IsSameSelectable (theObj))
+      {
+        anOwners.Append (aSelIter.Value());
+      }
+    }
+  }
+  else
+  {
+    anOwners.Append (aGlobOwner);
+  }
   highlightOwners (anOwners, Standard_True);
 }