0023654: Problem with displaying vertices in OCC view after closing all OCC views...
[occt.git] / src / Graphic3d / Graphic3d_StructureManager.cdl
index 4821b91..f9678f5 100755 (executable)
@@ -1,12 +1,25 @@
+-- Created on: 1991-09-05
+-- Created by: NW,JPB,CAL
+-- Copyright (c) 1991-1999 Matra Datavision
+-- Copyright (c) 1999-2012 OPEN CASCADE SAS
 --
--- File:       Graphic3d_StructureManager.cdl
--- Created:    Jeudi 5 Septembre 1991
--- Author:     NW,JPB,CAL
---              11/97 ; CAL : gestion du GraphicClear
---              05/98 ; CAL : gestion du GraphicConnect et Disconnect
+-- The content of this file is subject to the Open CASCADE Technology Public
+-- License Version 6.5 (the "License"). You may not use the content of this file
+-- except in compliance with the License. Please obtain a copy of the License
+-- at http://www.opencascade.org and read it completely before using this file.
 --
----Copyright:  MatraDatavision 1991,1992,1993,1994
+-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
+-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
 --
+-- The Original Code and all software distributed under the License is
+-- distributed on an "AS IS" basis, without warranty of any kind, and the
+-- Initial Developer hereby disclaims all such warranties, including without
+-- limitation, any warranties of merchantability, fitness for a particular
+-- purpose or non-infringement. Please see the License for the specific terms
+-- and conditions governing the rights and limitations under the License.
+
+--              11/97 ; CAL : gestion du GraphicClear
+--              05/98 ; CAL : gestion du GraphicConnect et Disconnect
 
 deferred class StructureManager from Graphic3d inherits TShared
 
@@ -25,9 +38,9 @@ deferred class StructureManager from Graphic3d inherits TShared
 uses
 
        Array2OfReal            from TColStd,
+        SequenceOfInteger       from TColStd,
 
        GenId                   from Aspect,
-       GraphicDevice           from Aspect,
        TypeOfHighlightMethod   from Aspect,
        TypeOfUpdate            from Aspect,
 
@@ -38,7 +51,8 @@ uses
        AspectText3d            from Graphic3d,
        Structure               from Graphic3d,
        MapOfStructure          from Graphic3d,
-       SequenceOfStructure     from Graphic3d
+       SequenceOfStructure     from Graphic3d,
+    GraphicDriver    from Graphic3d
 
 raises
 
@@ -46,9 +60,13 @@ raises
 
 is
 
-       Initialize ( aDevice    : GraphicDevice from Aspect )
+       Initialize ( theDriver: GraphicDriver from Graphic3d )
        ---Level: Public
-       ---Purpose: Initialise the constructor of the ViewManager.
+       ---Purpose: Initialises the ViewManager.
+       --  Currently creating of more than 100 viewer instances 
+       --  is not supported and leads to InitializationError and 
+       --  initialisation failure.
+       --  This limitation might be addressed in some future OCCT releases.   
        --  Warning: Raises InitialisationError if the initialisation
        --          of the ViewManager failed.
        raises InitialisationError from Graphic3d;
@@ -184,13 +202,6 @@ is
        --          in a visualiser <me>.
        ---Category: Inquire methods, MapOfStructure
 
-       VisibleStructures ( me; SG: in out MapOfStructure from Graphic3d )
-               is static;
-       ---Level: Internal
-       ---Purpose: Returns the set of visible structures
-       --          in a visualiser <me>.
-       ---Category: Inquire methods, MapOfStructure
-
        ----------------------------
        -- Category: Inquire methods
        ----------------------------
@@ -272,6 +283,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
@@ -356,18 +404,12 @@ is
        ---Purpose: Transforms the structure <AStructure>.
        ---Category: Private methods
 
-       GraphicDevice ( me )
-               returns GraphicDevice from Aspect;
-       ---Level: Internal
-       ---Purpose: Returns the graphic device of <me>.
-       ---Category: Private methods
-
-       Invisible ( me          : mutable;
-                   AStructure  : Structure from Graphic3d )
-               is static private;
+       GraphicDriver ( me )
+               returns GraphicDriver from Graphic3d;
        ---Level: Internal
-       ---Purpose: Sets invisible the structure <AStructure>.
+       ---Purpose: Returns the graphic driver of <me>.
        ---Category: Private methods
+  ---C++: return const &
 
        Identification ( me )
                returns Integer from Standard
@@ -421,13 +463,10 @@ is
        ---Purpose: Suppress the highlighting on the structure <AStructure>.
        ---Category: Private methods
 
-       Visible ( me            : mutable;
-                 AStructure    : Structure from Graphic3d )
-               is static private;
-       ---Level: Internal
-       ---Purpose: Sets visible the structure <AStructure>.
-       --          in the manager.
-       ---Category: Private methods
+  ReComputeStructures (me: mutable);
+  -- Purpose: Recomputes all displayed structures. Used to recompute GL
+  -- resources after the last view has been closed without removing objects.
+
 --\f
 
 fields
@@ -463,10 +502,6 @@ fields
        MyHighlightedStructure  :       MapOfStructure from Graphic3d
                                                                is protected;
 
-       -- the visible structures
-       MyVisibleStructure      :       MapOfStructure from Graphic3d
-                                                               is protected;
-
        -- the pickable structures
        MyPickStructure         :       MapOfStructure from Graphic3d
                                                                is protected;
@@ -475,7 +510,7 @@ fields
        MyStructGenId           :       GenId from Aspect is protected;
 
 
-       MyGraphicDevice         :       GraphicDevice from Aspect is protected;
+       MyGraphicDriver         :       GraphicDriver from Graphic3d is protected;
 
 friends