From fd448091bf5655e2b3b37f3933e50e702f2e8d5b Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 4 Sep 2019 09:47:42 +0300 Subject: [PATCH] 0030728: Visualization - using one implementation of highlight/unhighlight in context #fix regression found by DRAW tests --- src/AIS/AIS_InteractiveContext_1.cxx | 38 ++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) 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); } -- 2.39.5