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

@@ -134,6 +134,12 @@ is
-- Hilight for SelectableObject when the owner is detected. By default
-- it always return FALSE.
SetZLayer ( me : mutable;
thePrsMgr : PresentationManager from PrsMgr;
theLayerId : Integer from Standard )
is virtual;
---Purpose: Set Z layer ID and update all presentations.
fields
mySelectable : SOPtr;

View File

@@ -134,3 +134,13 @@ Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
{
return Standard_False;
}
//=======================================================================
//function : SetZLayer
//purpose :
//=======================================================================
void SelectMgr_EntityOwner::SetZLayer
(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Standard_Integer theLayerId)
{
}

View File

@@ -26,6 +26,7 @@ uses
SequenceOfSelection from SelectMgr,
TypeOfPresentation3d from PrsMgr,
Presentation from Prs3d,
PresentationManager from PrsMgr,
PresentationManager3d from PrsMgr,
SequenceOfOwner from SelectMgr,
NameOfColor from Quantity,
@@ -169,7 +170,17 @@ is
GetSelectPresentation( me: mutable;
TheMgr: PresentationManager3d from PrsMgr ) returns Presentation from Prs3d is static;
SetZLayer ( me : mutable;
thePrsMgr : PresentationManager from PrsMgr;
theLayerId : Integer from Standard )
is redefined virtual;
---Purpose: Set Z layer ID and update all presentations of
-- the selectable object. The layer can be set only for displayed object.
-- If all object presentations are removed, the layer ID will be set to
-- default value when computing presentation. The layers mechanism allows
-- drawing objects in higher layers in overlay of objects in lower layers.
fields
myselections : SequenceOfSelection is protected;

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);
}
}
}
}