From: nds Date: Wed, 4 Sep 2019 06:47:42 +0000 (+0300) Subject: 0030728: Visualization - using one implementation of highlight/unhighlight in context X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=fd448091bf5655e2b3b37f3933e50e702f2e8d5b;p=occt-copy.git 0030728: Visualization - using one implementation of highlight/unhighlight in context #fix regression found by DRAW tests --- diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx index 0d7cbde177..96c8509c77 100644 --- a/src/AIS/AIS_InteractiveContext_1.cxx +++ b/src/AIS/AIS_InteractiveContext_1.cxx @@ -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); }