mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +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:
parent
6a2ee09493
commit
95081657f1
@ -1023,16 +1023,20 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
|
|||||||
void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
|
void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
|
||||||
const Standard_Boolean theToUpdateViewer)
|
const Standard_Boolean theToUpdateViewer)
|
||||||
{
|
{
|
||||||
if (!theObject->HasInteractiveContext())
|
if (theObject.IsNull())
|
||||||
theObject->SetContext (this);
|
return;
|
||||||
|
|
||||||
if (HasOpenedContext())
|
if (HasOpenedContext())
|
||||||
return myLocalContexts (myCurLocalIndex)->AddOrRemoveSelected (theObject, theToUpdateViewer);
|
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;
|
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())
|
if (aSel->IsEmpty())
|
||||||
return;
|
return;
|
||||||
@ -1139,10 +1143,10 @@ Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(AIS_Interactiv
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated)
|
if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated || theObj->GlobalSelOwner().IsNull())
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
|
|
||||||
return myObjects (theObj)->IsHilighted();
|
return theObj->GlobalSelOwner()->State() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user