mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0030726: Visualization - change Selected state of owner in AIS_Selection
AIS_InteractiveContext::IsHilighted() behavior has been changed. It should use the same logic for owner processing like when it is highlighted. IsSelected of owner is used for selection state, not highlight. Without this correction, object is never shown as selected by click (Select(bool)): if (!HighlightStyle (theOwner, aCustomStyle) || (!aCustomStyle.IsNull() && aCustomStyle != anObjSelStyle)) IsSelected is already true, so the highlight style is equal to selection style, nothing to do.
This commit is contained in:
@@ -39,6 +39,11 @@ AIS_Selection::AIS_Selection()
|
||||
//=======================================================================
|
||||
void AIS_Selection::Clear()
|
||||
{
|
||||
for (AIS_NListOfEntityOwner::Iterator aSelIter (Objects()); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner) anObject = aSelIter.Value();
|
||||
anObject->SetSelected (Standard_False);
|
||||
}
|
||||
myresult.Clear();
|
||||
myResultMap.Clear();
|
||||
myIterator = AIS_NListOfEntityOwner::Iterator();
|
||||
@@ -61,6 +66,7 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
|
||||
AIS_NListOfEntityOwner::Iterator aListIter;
|
||||
myresult.Append (theObject, aListIter);
|
||||
myResultMap.Bind (theObject, aListIter);
|
||||
theObject->SetSelected (Standard_True);
|
||||
return AIS_SS_Added;
|
||||
}
|
||||
|
||||
@@ -87,6 +93,7 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
|
||||
|
||||
myresult.Remove (aListIter);
|
||||
myResultMap.UnBind (theObject);
|
||||
theObject->SetSelected (Standard_False);
|
||||
|
||||
// update list iterator for next object in <myresult> list if any
|
||||
if (aListIter.More())
|
||||
@@ -120,5 +127,6 @@ AIS_SelectStatus AIS_Selection::AddSelect (const Handle(SelectMgr_EntityOwner)&
|
||||
AIS_NListOfEntityOwner::Iterator aListIter;
|
||||
myresult.Append (theObject, aListIter);
|
||||
myResultMap.Bind (theObject, aListIter);
|
||||
theObject->SetSelected (Standard_True);
|
||||
return AIS_SS_Added;
|
||||
}
|
||||
|
Reference in New Issue
Block a user