mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0022795: Make possible to display some presentable objects in overlay of others, groupped by display priority
This commit is contained in:
@@ -406,6 +406,26 @@ is
|
||||
---Purpose: Sets the display priority aPriority of the seen parts
|
||||
-- presentation of the entity anIobj.
|
||||
|
||||
SetZLayer( me : mutable;
|
||||
theIObj : InteractiveObject from AIS;
|
||||
theLayerId : Integer from Standard );
|
||||
---Purpose: Set Z layer id for interactive object. The layer can be
|
||||
-- specified for displayed object only. The Z layers can be used to display
|
||||
-- temporarily presentations of some object in front of the other objects
|
||||
-- in the scene. The ids for Z layers are generated by V3d_Viewer.
|
||||
-- Note that Z layers differ from under-/overlayer in V3d_View:
|
||||
-- under-/overlayer are intended for specific 2D drawings that appear
|
||||
-- behind/in front of all 3D presentations, while SetZLayer() method
|
||||
-- applies to regular 3D presentations and does not imply any specific
|
||||
-- drawing methods.
|
||||
|
||||
GetZLayer( me;
|
||||
theIObj : InteractiveObject from AIS )
|
||||
returns Integer from Standard;
|
||||
---Purpose: Get Z layer id set for displayed interactive object.
|
||||
-- If the object doesn't exists in context or has no computed presentations,
|
||||
-- the method returns -1.
|
||||
|
||||
Redisplay(me : mutable;
|
||||
aniobj : InteractiveObject from AIS;
|
||||
updateviewer : Boolean from Standard = Standard_True;
|
||||
|
@@ -3147,3 +3147,54 @@ Standard_Boolean AIS_InteractiveContext::GetAutoActivateSelection() const
|
||||
{
|
||||
return myIsAutoActivateSelMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetZLayer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveContext::SetZLayer (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Standard_Integer theLayerId)
|
||||
{
|
||||
if (theIObj.IsNull ())
|
||||
return;
|
||||
|
||||
if (myObjects.IsBound (theIObj))
|
||||
{
|
||||
switch (myObjects (theIObj)->GraphicStatus ())
|
||||
{
|
||||
case AIS_DS_Displayed:
|
||||
{
|
||||
theIObj->SetZLayer (myMainPM, theLayerId);
|
||||
break;
|
||||
}
|
||||
case AIS_DS_Erased:
|
||||
{
|
||||
theIObj->SetZLayer (myCollectorPM, theLayerId);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (HasOpenedContext ())
|
||||
{
|
||||
myLocalContexts (myCurLocalIndex)->SetZLayer (theIObj, theLayerId);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetZLayer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AIS_InteractiveContext::GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const
|
||||
{
|
||||
if (theIObj.IsNull ())
|
||||
return -1;
|
||||
|
||||
if (myObjects.IsBound (theIObj))
|
||||
return theIObj->GetZLayer (myMainPM);
|
||||
|
||||
return myLocalContexts (myCurLocalIndex)->GetZLayer (theIObj);
|
||||
}
|
||||
|
@@ -373,6 +373,26 @@ is
|
||||
anObject: InteractiveObject from AIS;
|
||||
Prior : Integer from Standard);
|
||||
|
||||
SetZLayer( me : mutable;
|
||||
theIObj : InteractiveObject from AIS;
|
||||
theLayerId : Integer from Standard );
|
||||
---Purpose: Set Z layer id for interactive object. The layer can be
|
||||
-- specified for displayed object only. The Z layers can be used to display
|
||||
-- temporarily presentations of some object in front of the other objects
|
||||
-- in the scene. The ids for Z layers are generated by V3d_Viewer.
|
||||
-- Note that Z layers differ from under-/overlayer in V3d_View:
|
||||
-- under-/overlayer are intended for specific 2D drawings that appear
|
||||
-- behind/in front of all 3D presentations, while SetZLayer() method
|
||||
-- applies to regular 3D presentations and does not imply any specific
|
||||
-- drawing methods.
|
||||
|
||||
GetZLayer( me;
|
||||
theIObj : InteractiveObject from AIS )
|
||||
returns Integer from Standard;
|
||||
---Purpose: Get Z layer id set for displayed interactive object.
|
||||
-- If the object doesn't exists in context or has no computed presentations,
|
||||
-- the method returns -1.
|
||||
|
||||
DisplayedObjects(me;theMapToFill : in out MapOfTransient from TColStd)
|
||||
returns Integer from Standard;
|
||||
|
||||
|
@@ -881,7 +881,6 @@ void AIS_LocalContext::SetDisplayPriority(const Handle(AIS_InteractiveObject)& a
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DisplayedObjects
|
||||
//purpose :
|
||||
@@ -1220,3 +1219,34 @@ void AIS_LocalContext::SetSensitivity(const Standard_Integer aPrecision) {
|
||||
myMainVS->Set(aPrecision);
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : SetZLayer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_LocalContext::SetZLayer (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Standard_Integer theLayerId)
|
||||
{
|
||||
if (!myActiveObjects.IsBound (theIObj))
|
||||
return;
|
||||
|
||||
const Handle(AIS_LocalStatus)& aStatus = myActiveObjects (theIObj);
|
||||
if (aStatus->DisplayMode () == -1)
|
||||
return;
|
||||
|
||||
theIObj->SetZLayer (myMainPM, theLayerId);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetZLayer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AIS_LocalContext::GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const
|
||||
{
|
||||
if (!myActiveObjects.IsBound (theIObj))
|
||||
return -1;
|
||||
|
||||
return theIObj->GetZLayer (myMainPM);
|
||||
}
|
||||
|
Reference in New Issue
Block a user