1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0026905: Visualization - cosmetic fixes in selection methods of AIS_InteractiveContext

- selection mode in AIS_InteractiveContext::AddOrRemoveSelected is corrected;
- AIS_InteractiveContext::IsSelected returns object's state instead of global status.
This commit is contained in:
vpa 2015-11-20 14:10:52 +03:00 committed by bugmaster
parent 6a2ee09493
commit 95081657f1

View File

@ -1023,16 +1023,20 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
const Standard_Boolean theToUpdateViewer)
{
if (!theObject->HasInteractiveContext())
theObject->SetContext (this);
if (theObject.IsNull())
return;
if (HasOpenedContext())
return myLocalContexts (myCurLocalIndex)->AddOrRemoveSelected (theObject, theToUpdateViewer);
if (theObject.IsNull() || !myObjects.IsBound (theObject) || !theObject->HasSelection (0))
const Standard_Integer aGlobalSelMode = theObject->GlobalSelectionMode();
if (!myObjects.IsBound (theObject) || !theObject->HasSelection (aGlobalSelMode))
return;
const Handle(SelectMgr_Selection)& aSel = theObject->Selection (0);
if (!theObject->HasInteractiveContext())
theObject->SetContext (this);
const Handle(SelectMgr_Selection)& aSel = theObject->Selection (aGlobalSelMode);
if (aSel->IsEmpty())
return;
@ -1139,10 +1143,10 @@ Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(AIS_Interactiv
break;
}
}
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated)
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated || theObj->GlobalSelOwner().IsNull())
return Standard_False;
return myObjects (theObj)->IsHilighted();
return theObj->GlobalSelOwner()->State() == 1;
}
//=======================================================================