mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0030725: Visualization - remove Display calling from SetSelected methods of context
AIS_InteractiveContext::Load/ClearGlobal is modified for correct processing SetSelected for child objects. As Display/Erase of object with children displays/erases these children, then the children status inside context should also be updated.
This commit is contained in:
parent
49582f9dbf
commit
13c556d9de
@ -424,8 +424,7 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
|
||||
setContextToObject (theIObj);
|
||||
if (!myObjects.IsBound (theIObj))
|
||||
{
|
||||
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
|
||||
myObjects.Bind (theIObj, aStatus);
|
||||
setObjectStatus (theIObj, AIS_DS_Displayed, theDispMode, theSelectionMode);
|
||||
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
||||
myMainPM->Display(theIObj, theDispMode);
|
||||
if (theSelectionMode != -1)
|
||||
@ -502,8 +501,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
{
|
||||
Standard_Integer aDispMode, aHiMod, aSelModeDef;
|
||||
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
|
||||
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
|
||||
myObjects.Bind (theIObj, aStatus);
|
||||
setObjectStatus (theIObj, AIS_DS_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
|
||||
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
||||
}
|
||||
|
||||
@ -2056,7 +2054,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
||||
const Handle(SelectMgr_SelectableObject)& anObj = theIObj; // to avoid ambiguity
|
||||
mgrSelector->Remove (anObj);
|
||||
|
||||
myObjects.UnBind (theIObj);
|
||||
setObjectStatus (theIObj, AIS_DS_None, -1, -1);
|
||||
myMainVwr->StructureManager()->UnregisterObject (theIObj);
|
||||
|
||||
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
|
||||
@ -2533,3 +2531,29 @@ gp_Pnt AIS_InteractiveContext::GravityPoint (const Handle(V3d_View)& theView) co
|
||||
{
|
||||
return theView->GravityPoint();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : setObjectStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const AIS_DisplayStatus theStatus,
|
||||
const Standard_Integer theDispMode,
|
||||
const Standard_Integer theSelectionMode)
|
||||
{
|
||||
if (theStatus != AIS_DS_None)
|
||||
{
|
||||
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
|
||||
myObjects.Bind (theIObj, aStatus);
|
||||
}
|
||||
else
|
||||
myObjects.UnBind (theIObj);
|
||||
|
||||
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theIObj->Children()); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
|
||||
if (aChild.IsNull())
|
||||
continue;
|
||||
|
||||
setObjectStatus (aChild, theStatus, theDispMode, theSelectionMode);
|
||||
}
|
||||
}
|
||||
|
@ -1364,6 +1364,14 @@ protected: //! @name internal methods
|
||||
}
|
||||
}
|
||||
|
||||
//! Bind/Unbind status to object and its children
|
||||
//! @param theObj [in] the object to change status
|
||||
//! @param theStatus status, if NULL, unbind object
|
||||
Standard_EXPORT void setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const AIS_DisplayStatus theStatus,
|
||||
const Standard_Integer theDispyMode,
|
||||
const Standard_Integer theSelectionMode);
|
||||
|
||||
protected: //! @name internal fields
|
||||
|
||||
AIS_DataMapOfIOStatus myObjects;
|
||||
|
@ -811,7 +811,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
|
||||
|
||||
if (!myObjects.IsBound (theObject))
|
||||
{
|
||||
Display (theObject, Standard_False);
|
||||
return;
|
||||
}
|
||||
|
||||
Handle(SelectMgr_EntityOwner) anOwner = theObject->GlobalSelOwner();
|
||||
@ -903,7 +903,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
|
||||
}
|
||||
|
||||
if (!myObjects.IsBound (anObject))
|
||||
Display (anObject, Standard_False);
|
||||
return;
|
||||
|
||||
if (myAutoHilight)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user