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

@@ -1287,6 +1287,52 @@ is
-- <theCGroup>. This method is internal and should be used
-- by Graphic3d_Group only.
AddZLayer( me : mutable;
theCView : CView from Graphic3d;
theLayerId : Integer from Standard )
is deferred;
---Purpose: Add a new top-level z layer with ID <theLayerId> for
-- the view. Z layers allow drawing structures in higher layers
-- in foreground of structures in lower layers. To add a structure
-- to desired layer on display it is necessary to set the layer
-- ID for the structure.
RemoveZLayer( me : mutable;
theCView : CView from Graphic3d;
theLayerId : Integer from Standard )
is deferred;
---Purpose: Remove Z layer from the specified view. All structures
-- displayed at the moment in layer will be displayed in default layer
-- ( the bottom-level z layer ). To unset layer ID from associated
-- structures use method UnsetZLayer (...).
UnsetZLayer( me : mutable;
theLayerId : Integer from Standard )
is deferred;
---Purpose: Unset Z layer ID for all structures. The structure
-- indexes will be set to default layer ( the bottom-level z layer
-- with ID = 0 ).
ChangeZLayer( me : mutable;
theCStructure : CStructure from Graphic3d;
theLayerId : Integer from Standard )
is deferred;
---Purpose: Change Z layer of a structure. The new z layer ID will
-- be used to define the associated layer for structure on display.
ChangeZLayer( me : mutable;
theCStructure : CStructure from Graphic3d;
theCView : CView from Graphic3d;
theNewLayerId : Integer from Standard )
is deferred;
---Purpose: Change Z layer of a structure already presented in view.
GetZLayer( me;
theCStructure : CStructure from Graphic3d )
returns Integer from Standard is deferred;
---Purpose: Get Z layer ID of structure. If the structure doesn't
-- exists in graphic driver, the method returns -1.
--------------------------
-- Category: Class methods
--------------------------

View File

@@ -241,6 +241,19 @@ is
-- Warning: If <me> is displayed then the SetDisplayPriority
-- method erase <me> and display <me> with the
-- previous priority.
SetZLayer ( me : mutable;
theLayerId : Integer from Standard )
is static;
---Purpose: Set Z layer ID for the structure. The Z layer mechanism
-- allows to display structures presented in higher layers in overlay
-- of structures in lower layers by switching off z buffer depth
-- test between layers
GetZLayer ( me )
returns Integer from Standard is static;
---Purpose: Get Z layer ID of displayed structure. The method
-- returns -1 if the structure has no ID (deleted from graphic driver).
SetPick ( me : mutable;
AValue : Boolean from Standard )

View File

@@ -2553,3 +2553,27 @@ Standard_Address Graphic3d_Structure::CStructure () const {
return Standard_Address (&MyCStructure);
}
//=======================================================================
//function : SetZLayer
//purpose :
//=======================================================================
void Graphic3d_Structure::SetZLayer (const Standard_Integer theLayerId)
{
// if the structure is not displayed, unable to change its display layer
if (IsDeleted ())
return;
MyStructureManager->ChangeZLayer (this, theLayerId);
}
//=======================================================================
//function : GetZLayer
//purpose :
//=======================================================================
Standard_Integer Graphic3d_Structure::GetZLayer () const
{
return MyStructureManager->GetZLayer (this);
}

View File

@@ -25,6 +25,7 @@ deferred class StructureManager from Graphic3d inherits TShared
uses
Array2OfReal from TColStd,
SequenceOfInteger from TColStd,
GenId from Aspect,
GraphicDevice from Aspect,
@@ -272,6 +273,43 @@ is
---Purpose: Changes the display priority of the structure <AStructure>.
---Category: Private methods
ChangeZLayer ( me : mutable;
theStructure : Structure from Graphic3d;
theLayerId : Integer from Standard )
is deferred;
---Purpose: Change Z layer for structure. The z layer mechanism allows
-- to display structures in higher layers in overlay of structures in
-- lower layers.
GetZLayer ( me;
theStructure : Structure from Graphic3d )
returns Integer from Standard is deferred;
---Purpose: Get Z layer ID assigned to structure. If the structure
-- has no layer ID (deleted from graphic driver), the method returns -1.
AddZLayer ( me : mutable;
theLayerId : in out Integer from Standard )
returns Boolean from Standard is deferred;
---Purpose: Add a new top-level Z layer and get its ID as
-- <theLayerId> value. The method returns Standard_False if the layer
-- can not be created. The z layer mechanism allows to display
-- structures in higher layers in overlay of structures in lower layers.
RemoveZLayer ( me : mutable;
theLayerId : Integer from Standard )
returns Boolean from Standard is deferred;
---Purpose: Remove Z layer with ID <theLayerId>. Method returns
-- Standard_False if the layer can not be removed or doesn't exists.
-- By default, there is always a default bottom-level layer that can't
-- be removed.
GetAllZLayers ( me;
theLayerSeq : out SequenceOfInteger from TColStd )
is deferred;
---Purpose: Return all Z layer ids in sequence ordered by level
-- from lowest layer to highest. The first layer ID in sequence is
-- the default layer that can't be removed.
CurrentId ( myclass )
returns Integer from Standard;
---Level: Internal