1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026566: Visualization - incorrect highlight after selection of owners with auto-highlight disabled

Unhighlight of previously selected owners was corrected
This commit is contained in:
vpa
2015-08-18 14:49:43 +03:00
committed by ski
parent 82314bdf8c
commit 5212bbb005
2 changed files with 56 additions and 2 deletions

View File

@@ -1014,16 +1014,32 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
AIS_Selection::SetCurrentSelection (myCurrentName.ToCString());
Handle(AIS_Selection) aCurSel = AIS_Selection::Selection (myCurrentName.ToCString());
NCollection_IndexedMap<Handle(AIS_InteractiveObject)> anObjToClear;
for (aCurSel->Init(); aCurSel->More(); aCurSel->Next())
{
const Handle(SelectMgr_EntityOwner) anOwner =
Handle(SelectMgr_EntityOwner)::DownCast (aCurSel->Value());
if (!anOwner->HasSelectable())
continue;
const Standard_Integer aHiMode = anObject->HasHilightMode() ? anObject->HilightMode() : 0;
anOwner->Unhilight (myMainPM, aHiMode);
const Handle(AIS_InteractiveObject) anInteractive =
Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anOwner->IsAutoHilight())
{
const Standard_Integer aHiMode = anInteractive->HasHilightMode() ? anInteractive->HilightMode() : 0;
anOwner->Unhilight (myMainPM, aHiMode);
}
else
{
if (!anObjToClear.Contains (anInteractive))
anObjToClear.Add (anInteractive);
}
anOwner->State (0);
}
while (!anObjToClear.IsEmpty())
{
anObjToClear.FindKey (anObjToClear.Size())->ClearSelected();
anObjToClear.RemoveLast();
}
AIS_Selection::ClearAndSelect (theOwner);
theOwner->State (1);