1
0
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:
kgv
2012-03-06 15:03:34 +04:00
committed by bugmaster
parent f8b2ed3650
commit 59f45b7cef
43 changed files with 1596 additions and 40 deletions

View File

@@ -307,3 +307,42 @@ Handle(Prs3d_Presentation) SelectMgr_SelectableObject::GetSelectPresentation( co
return mySelectionPrs;
}
//=======================================================================
//function : SetZLayer
//purpose :
//=======================================================================
void SelectMgr_SelectableObject::SetZLayer
(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Standard_Integer theLayerId)
{
if (thePrsMgr.IsNull())
return;
// update own presentations
PrsMgr_PresentableObject::SetZLayer (thePrsMgr, theLayerId);
// update selection presentations
if (!mySelectionPrs.IsNull())
mySelectionPrs->SetZLayer (theLayerId);
if (!myHilightPrs.IsNull())
myHilightPrs->SetZLayer (theLayerId);
// update all entity owner presentations
for (Init (); More () ;Next ())
{
const Handle(SelectMgr_Selection)& aSel = CurrentSelection();
for (aSel->Init (); aSel->More (); aSel->Next ())
{
Handle(Select3D_SensitiveEntity) aEntity =
Handle(Select3D_SensitiveEntity)::DownCast (aSel->Sensitive());
if (!aEntity.IsNull())
{
Handle(SelectMgr_EntityOwner) aOwner =
Handle(SelectMgr_EntityOwner)::DownCast (aEntity->OwnerId());
if (!aOwner.IsNull())
aOwner->SetZLayer (thePrsMgr, theLayerId);
}
}
}
}