0024637: Visualization - clean up implementation of rendering in immediate mode
[occt.git] / src / Graphic3d / Graphic3d_GraphicDriver.cdl
old mode 100755 (executable)
new mode 100644 (file)
index ce6551c..710d2d1
@@ -1,35 +1,20 @@
+-- Created on: 1997-01-28
+-- Created by: CAL
+-- Copyright (c) 1997-1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
 --
--- File:    Graphic3d_GraphicDriver.cdl
--- Created: Mardi 28 janvier 1997
--- Author:  CAL
--- Modified:    01/08/97 ; PCT : ajout texture mapping
---              07/08/97 ; PCT : ajout texture environnante
---              27/08/97 ; PCT : ajout coordonnee texture
---              00/11/97 ; CAL : retrait de la dependance avec math
---              00/11/97 ; CAL : ajout polyline par 2 points
---      16-09-98 ; BGN : Points d'entree du Triedre (S3819, Phase 1)
---              22-09-98 ; BGN : S3989 (anciennement S3819)
---                               TypeOfTriedron* from Aspect(et pas Graphic3d)
---              03-11-98 ; CAL : Introduction de Visual3d_LayerManager.
---              07-10-99 : EUG : Degeneration support (G003)
---               Add DegenerateStructure() and
---                   SetBackFacingModel() methods.
---      10-11-99 ; GG  : PRO19603 Change Redraw( ) method
---      16-06-2000 : ATS,GG : G005 - method PrimitiveArray, which are interface of OpenGl
---                            package, and used to initialize internal fields
---                            of primitives (Convert high level data to internal presentation).
---      17/08/00 ; THA ; Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
---              -> Add Print methods (works only under Windows).
---      27/03/02 ; GG  ; RIC120302 Add new method Begin(Aspect_Display)
---              28/05/02 ; VSV : New trihedron
---      23/12/02 ; SAV : Added methods to set background image and its
---                       appearence style
---              20/01/09 ; ABD : Integration support of system fonts (using FTGL and FreeType)
+-- This file is part of Open CASCADE Technology software library.
 --
---              Copyright:  MatraDatavision 1997
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
 --
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
 
-deferred class GraphicDriver from Graphic3d inherits GraphicDriver from Aspect
+deferred class GraphicDriver from Graphic3d inherits TShared
 
     ---Version:
 
@@ -49,6 +34,7 @@ uses
     Array1OfReal        from TColStd,
     Array2OfReal        from TColStd,
 
+    AsciiString         from TCollection,
     ExtendedString      from TCollection,
 
     NameOfColor         from Quantity,
@@ -56,16 +42,16 @@ uses
 
     PlaneAngle          from Quantity,
 
-    AlienImage          from AlienImage,
+    PixMap              from Image,
 
     Array1OfEdge        from Aspect,
     CLayer2d            from Aspect,
-    GraphicDriver       from Aspect,
     TypeOfTriedronEcho  from Aspect,
     TypeOfTriedronPosition  from Aspect,
     Handle              from Aspect,
     Display             from Aspect,
     PrintAlgo           from Aspect,
+    DisplayConnection_Handle from Aspect,
 
     AspectLine3d        from Graphic3d,
     AspectMarker3d      from Graphic3d,
@@ -78,32 +64,19 @@ uses
     CPick               from Graphic3d,
     CPlane              from Graphic3d,
     CStructure          from Graphic3d,
+    CStructure_Handle   from Graphic3d,
     CView               from Graphic3d,
-    CRawBufferData      from Image,
+    BufferType          from Graphic3d,
     Structure           from Graphic3d,
+    StructureManager    from Graphic3d,
     TextPath            from Graphic3d,
     TypeOfComposition   from Graphic3d,
-    TypeOfPolygon       from Graphic3d,
     TypeOfPrimitive     from Graphic3d,
     Vector              from Graphic3d,
     Array1OfVertex      from Graphic3d,
     Array2OfVertex      from Graphic3d,
     Vertex              from Graphic3d,
-    Array1OfVertexC     from Graphic3d,
-    Array2OfVertexC     from Graphic3d,
-    VertexC             from Graphic3d,
-    Array1OfVertexN     from Graphic3d,
-    Array2OfVertexN     from Graphic3d,
-    VertexN             from Graphic3d,
-    Array1OfVertexNC    from Graphic3d,
-    Array2OfVertexNC    from Graphic3d,
-    VertexNC            from Graphic3d,
     VerticalTextAlignment   from Graphic3d,
-    CInitTexture        from Graphic3d,
-    TypeOfTexture       from Graphic3d,
-    VertexNT            from Graphic3d,
-    Array1OfVertexNT    from Graphic3d,
-    Array2OfVertexNT    from Graphic3d,
     PrimitiveArray      from Graphic3d,
     PtrFrameBuffer      from Graphic3d,
     HArray1OfByte       from TColStd,
@@ -114,8 +87,10 @@ uses
     HArray1OfReal       from TColStd,
     CUserDraw           from Graphic3d,
     NListOfHAsciiString from Graphic3d,
-    FontAspect          from OSD,
-    CGraduatedTrihedron from Graphic3d
+    FontAspect          from Font,
+    CGraduatedTrihedron from Graphic3d,
+    ClipPlane           from Graphic3d,
+    Ax2                 from gp
 
 raises
 
@@ -131,17 +106,11 @@ is
     -- Category: Init methods
     -------------------------
 
-    Begin ( me          : mutable;
-            ADisplay    : CString from Standard )
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_begin
-
-        Begin ( me              : mutable;
-                ADisplay        : Display from Aspect )
-                returns Boolean from Standard
-                is deferred;
-        ---Purpose: call_togl_begin_display
+    Begin (me: mutable;
+           theDisplayConnection: DisplayConnection_Handle from Aspect)
+       returns Boolean from Standard
+       is deferred;
+    ---Purpose: Starts graphic driver with given connection
 
     End ( me    : mutable )
         is deferred;
@@ -156,13 +125,6 @@ is
         is deferred;
     ---Purpose: call_togl_inquirelight
 
-    InquireMat ( me     : mutable;
-                 ACView : CView from Graphic3d;
-                 AMatO  : out Array2OfReal from TColStd;
-                 AMatM  : out Array2OfReal from TColStd )
-        is deferred;
-    ---Purpose: call_togl_inquiremat
-
     InquirePlaneLimit ( me  : mutable )
         returns Integer from Standard
         is deferred;
@@ -173,42 +135,6 @@ is
         is deferred;
     ---Purpose: call_togl_inquireview
 
-    InquireTextureAvailable ( me    : mutable )
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: Returns Standard_True if texture is
-    --      supported by the graphic driver
-
-    ------------------------------
-    -- Category: Highlight methods
-    ------------------------------
-
-    Blink ( me          : mutable;
-            ACStructure : CStructure from Graphic3d;
-            Create      : Boolean from Standard )
-        is deferred;
-    ---Purpose: call_togl_blink
-
-    BoundaryBox ( me            : mutable;
-                  ACStructure   : CStructure from Graphic3d;
-                  Create        : Boolean from Standard )
-        is deferred;
-    ---Purpose: call_togl_boundarybox
-
-    HighlightColor ( me             : mutable;
-                     ACStructure    : CStructure from Graphic3d;
-                     R              : ShortReal from Standard;
-                     G              : ShortReal from Standard;
-                     B              : ShortReal from Standard;
-                     Create         : Boolean from Standard )
-        is deferred;
-    ---Purpose: call_togl_highlightcolor
-
-    NameSetStructure ( me       : mutable;
-               ACStructure  : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_namesetstructure
-
     -------------------------------------
     -- Category: Group management methods
     -------------------------------------
@@ -218,11 +144,6 @@ is
         is deferred;
     ---Purpose: call_togl_cleargroup
 
-    CloseGroup ( me     : mutable;
-             ACGroup    : CGroup from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_closegroup
-
     FaceContextGroup ( me       : mutable;
                        ACGroup  : CGroup from Graphic3d;
                        NoInsert : Integer from Standard )
@@ -246,20 +167,6 @@ is
         is deferred;
     ---Purpose: call_togl_markercontextgroup
 
-    MarkerContextGroup ( me         : mutable;
-                         ACGroup    : CGroup from Graphic3d;
-                         NoInsert   : Integer from Standard;
-                         AMarkWidth : Integer from Standard;
-                         AMarkHeight: Integer from Standard;
-                         ATexture   : HArray1OfByte from TColStd )
-                is deferred;
-    ---Purpose: call_togl_markercontextgroup
-
-    OpenGroup ( me      : mutable;
-                ACGroup : CGroup from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_opengroup
-
     RemoveGroup ( me        : mutable;
                   ACGroup   : CGroup from Graphic3d )
         is deferred;
@@ -275,103 +182,29 @@ is
     -- Category: Structure management methods
     -----------------------------------------
 
-    ClearStructure ( me             : mutable;
-                     ACStructure    : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_clearstructure
-
-    Connect ( me        : mutable;
-              AFather   : CStructure from Graphic3d;
-              ASon      : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_connect
-
-    ContextStructure ( me           : mutable;
-                       ACStructure  : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_contextstructure
-
-    Disconnect ( me         : mutable;
-                 AFather    : CStructure from Graphic3d;
-                 ASon       : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_disconnect
-
-    DisplayStructure ( me           : mutable;
-                       ACView       : CView from Graphic3d;
-                       ACStructure  : CStructure from Graphic3d;
-                       APriority    : Integer from Standard )
+    DisplayStructure ( me            : mutable;
+                       theCView      : CView from Graphic3d;
+                       theCStructure : in out CStructure from Graphic3d;
+                       thePriority   : Integer from Standard )
         is deferred;
     ---Purpose: call_togl_displaystructure
 
-    EraseStructure ( me             : mutable;
-                     ACView         : CView from Graphic3d;
-                     ACStructure    : CStructure from Graphic3d )
+    EraseStructure ( me            : mutable;
+                     theCView      : CView from Graphic3d;
+                     theCStructure : in out CStructure from Graphic3d )
         is deferred;
     ---Purpose: call_togl_erasestructure
 
     RemoveStructure ( me            : mutable;
-                      ACStructure   : CStructure from Graphic3d )
+                      theCStructure : in out CStructure_Handle from Graphic3d )
         is deferred;
     ---Purpose: call_togl_removestructure
 
-    Structure ( me          : mutable;
-                ACStructure : in out CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_structure
-
-    --------------------------------
-    -- Category: Exploration methods
-    --------------------------------
-
-    DumpGroup ( me      : mutable;
-                ACGroup : CGroup from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_structure_exploration
-
-    DumpStructure ( me          : mutable;
-                    ACStructure : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_structure_exploration
-
-    DumpView ( me       : mutable;
-               ACView   : CView from Graphic3d )
+    Structure (me : mutable;
+               theManager : StructureManager from Graphic3d)
+        returns CStructure_Handle from Graphic3d
         is deferred;
-    ---Purpose: call_togl_view_exploration
-
-    ElementExploration ( me             : mutable;
-                         ACStructure    : CStructure from Graphic3d;
-                         ElementNumber  : Integer from Standard;
-                         AVertex        : out VertexNC from Graphic3d;
-                         AVector        : out Vector from Graphic3d )
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_element_exploration
-
-    ElementType ( me            : mutable;
-                  ACStructure   : CStructure from Graphic3d;
-                  ElementNumber : Integer from Standard )
-        returns TypeOfPrimitive from Graphic3d
-        is deferred;
-    ---Purpose: call_togl_element_type
-
-    ------------------------------------
-    -- Category: Pick management methods
-    ------------------------------------
-
-    InitPick ( me   : mutable )
-        is deferred;
-    ---Purpose: call_togl_init_pick
-
-    Pick ( me   : mutable;
-           ACPick   : out CPick from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_pick
-
-    PickId ( me         : mutable;
-             ACGroup    : CGroup from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_pickid
+    ---Purpose: Creates new empty graphic structure
 
     ------------------------------------
     -- Category: Structured mode methods
@@ -436,66 +269,33 @@ is
         is deferred;
     ---Purpose: call_togl_cliplimit
 
-    ProjectRaster ( me      : mutable;
-                    ACView  : CView from Graphic3d;
-                    AX      : ShortReal from Standard;
-                    AY      : ShortReal from Standard;
-                    AZ      : ShortReal from Standard;
-                    AU      : out Integer from Standard;
-                    AV      : out Integer from Standard )
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_unproject_raster
-
-    UnProjectRaster ( me        : mutable;
-                      ACView    : CView from Graphic3d;
-                      Axm       : Integer from Standard;
-                      Aym       : Integer from Standard;
-                      AXM       : Integer from Standard;
-                      AYM       : Integer from Standard;
-                      AU        : Integer from Standard;
-                      AV        : Integer from Standard;
-                      AX        : out ShortReal from Standard;
-                      AY        : out ShortReal from Standard;
-                      AZ        : out ShortReal from Standard )
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_unproject_raster
-
-    UnProjectRasterWithRay ( me        : mutable;
-                             ACView    : CView from Graphic3d;
-                             Axm       : Integer from Standard;
-                             Aym       : Integer from Standard;
-                             AXM       : Integer from Standard;
-                             AYM       : Integer from Standard;
-                             AU        : Integer from Standard;
-                             AV        : Integer from Standard;
-                             AX        : out ShortReal from Standard;
-                             AY        : out ShortReal from Standard;
-                             AZ        : out ShortReal from Standard;
-                             DX        : out ShortReal from Standard;
-                             DY        : out ShortReal from Standard;
-                             DZ        : out ShortReal from Standard )
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_unproject_raster_with_ray
-
     RatioWindow ( me        : mutable;
                   ACView    : CView from Graphic3d )
         is deferred;
     ---Purpose: call_togl_ratio_window
 
     Redraw ( me             : mutable;
-             ACView         : CView from Graphic3d;
-             ACUnderLayer   : CLayer2d from Aspect;
-             ACOverLayer    : CLayer2d from Aspect;
-             x              : Integer = 0;
-             y              : Integer = 0;
-             width              : Integer = 0;
-             height     : Integer = 0 )
-        is deferred;
-    ---Purpose: call_togl_redraw
-    --  Warning: when the redraw area has a null size, the full view is redrawn
+             theCView       : CView from Graphic3d;
+             theCUnderLayer : CLayer2d from Aspect;
+             theCOverLayer  : CLayer2d from Aspect;
+             theX           : Integer = 0;
+             theY           : Integer = 0;
+             theWidth       : Integer = 0;
+             theHeight      : Integer = 0 )
+    is deferred;
+    ---Purpose: Redraw content of the view
+
+    RedrawImmediate ( me               : mutable;
+                      theCView         : CView from Graphic3d;
+                      theCUnderLayer   : CLayer2d from Aspect;
+                      theCOverLayer    : CLayer2d from Aspect )
+    is deferred;
+    ---Purpose: Redraw layer of immediate presentations
+
+    Invalidate ( me       : mutable;
+                 theCView : CView from Graphic3d )
+    is deferred;
+    ---Purpose: Invalidates content of the view but does not redraw it
 
     RemoveView ( me     : mutable;
                 ACView  : CView from Graphic3d )
@@ -507,211 +307,47 @@ is
         is deferred;
     ---Purpose: call_togl_setlight
 
-    SetPlane ( me       : mutable;
-               ACView   : CView from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_setplane
+    SetClipPlanes (me : mutable; theCView : CView from Graphic3d) is deferred;
+    ---Purpose: Pass clip planes to the associated graphic driver view.
+
+    SetCamera (me : mutable; theCView : CView from Graphic3d)
+         is deferred;
+    ---Purpose: Inform graphic driver if camera assigned to view changes.
 
     SetVisualisation ( me       : mutable;
                        ACView   : CView from Graphic3d )
         is deferred;
     ---Purpose: call_togl_setvisualisation
 
-    TransformStructure ( me             : mutable;
-                         ACStructure    : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_transformstructure
-
-        DegenerateStructure ( me                        : mutable;
-                              ACStructure       : CStructure from Graphic3d )
-                is deferred;
-        ---Purpose: call_togl_degeneratestructure
-
     Transparency ( me       : mutable;
                    ACView   : CView from Graphic3d;
                    AFlag    : Boolean from Standard )
         is deferred;
     ---Purpose: call_togl_transparency
 
-    Update ( me             : mutable;
-             ACView         : CView from Graphic3d;
-             ACUnderLayer   : CLayer2d from Aspect;
-             ACOverLayer    : CLayer2d from Aspect )
-            is deferred;
-    ---Purpose: call_togl_update
-
     View ( me   : mutable;
            ACView   : in out CView from Graphic3d )
         returns Boolean from Standard
         is deferred;
     ---Purpose: call_togl_view
 
-    ViewMapping ( me        : mutable;
-                  ACView    : CView from Graphic3d;
-                  AWait : Boolean from Standard )
-        is deferred;
-    ---Purpose: call_togl_viewmapping
-
-    ViewOrientation ( me        : mutable;
-                      ACView    : CView from Graphic3d;
-                      AWait     : Boolean from Standard )
-        is deferred;
-    ---Purpose: call_togl_vieworientation
-
         Environment ( me        : mutable;
                       ACView    : CView from Graphic3d )
         is deferred;
     ---Purpose:
 
-    ----------------------------------------
-    -- Category: Methods to create Marker
-    -- for Purpose : see Graphic3d_Group.cdl
-    ----------------------------------------
-
-    Marker ( me         : mutable;
-             ACGroup    : CGroup from Graphic3d;
-             APoint     : Vertex from Graphic3d;
-             EvalMinMax : Boolean from Standard = Standard_True )
-        is deferred;
-
-    MarkerSet ( me          : mutable;
-                ACGroup     : CGroup from Graphic3d;
-                ListVertex  : Array1OfVertex from Graphic3d;
-                EvalMinMax  : Boolean from Standard = Standard_True )
-        is deferred;
-
-    ----------------------------------------
-    -- Category: Methods to create Polygon
-    -- for Purpose : see Graphic3d_Group.cdl
-    ----------------------------------------
-
-    Polygon ( me            : mutable;
-              ACGroup       : CGroup from Graphic3d;
-              ListVertex    : Array1OfVertex from Graphic3d;
-              AType         : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
-              EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon
-
-    Polygon ( me            : mutable;
-              ACGroup       : CGroup from Graphic3d;
-              ListVertex    : Array1OfVertex from Graphic3d;
-              Normal        : Vector from Graphic3d;
-              AType         : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
-              EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon
-
-    Polygon ( me            : mutable;
-              ACGroup       : CGroup from Graphic3d;
-              ListVertex    : Array1OfVertexN from Graphic3d;
-              AType         : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
-              EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon
-
-    Polygon ( me            : mutable;
-              ACGroup       : CGroup from Graphic3d;
-              ListVertex    : Array1OfVertexN from Graphic3d;
-              Normal        : Vector from Graphic3d;
-              AType         : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
-              EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon
-
-    Polygon ( me            : mutable;
-              ACGroup       : CGroup from Graphic3d;
-              ListVertex    : Array1OfVertexNT from Graphic3d;
-              AType         : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
-              EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon
-
-    PolygonHoles ( me          : mutable;
-                   ACGroup     : CGroup from Graphic3d;
-                   Bounds      : Array1OfInteger from TColStd;
-                   ListVertex  : Array1OfVertex from Graphic3d;
-                   EvalMinMax  : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_holes
-
-    PolygonHoles ( me          : mutable;
-                   ACGroup     : CGroup from Graphic3d;
-                   Bounds      : Array1OfInteger from TColStd;
-                   ListVertex  : Array1OfVertex from Graphic3d;
-                   Normal      : Vector from Graphic3d;
-                   EvalMinMax  : Boolean from Standard = Standard_True )
-                   is deferred;
-    ---Purpose: call_togl_polygon_holes
-
-    PolygonHoles ( me          : mutable;
-                   ACGroup     : CGroup from Graphic3d;
-                   Bounds      : Array1OfInteger from TColStd;
-                   ListVertex  : Array1OfVertexN from Graphic3d;
-                   EvalMinMax  : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_holes
-
-    PolygonHoles ( me          : mutable;
-                   ACGroup     : CGroup from Graphic3d;
-                   Bounds      : Array1OfInteger from TColStd;
-                   ListVertex  : Array1OfVertexN from Graphic3d;
-                   Normal      : Vector from Graphic3d;
-                   EvalMinMax  : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_holes
-
-    ----------------------------------------
-    -- Category: Methods to create Polyline
-    -- for Purpose : see Graphic3d_Group.cdl
-    ----------------------------------------
-
-    Polyline ( me                       : mutable;
-               ACGroup                  : CGroup from Graphic3d;
-               X1, Y1, Z1, X2, Y2, Z2   : Real from Standard;
-               EvalMinMax               : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polyline
-
-    Polyline ( me           : mutable;
-               ACGroup      : CGroup from Graphic3d;
-               ListVertex   : Array1OfVertex from Graphic3d;
-               EvalMinMax   : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polyline
-
-    Polyline ( me           : mutable;
-               ACGroup      : CGroup from Graphic3d;
-               ListVertex   : Array1OfVertexC from Graphic3d;
-               EvalMinMax   : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polyline
-
-    -----------------------------------------
-    -- Category: Methods to create Quadrangle
-    -- for Purpose : see Graphic3d_Group.cdl
-    -----------------------------------------
-
-    QuadrangleMesh ( me         : mutable;
-                     ACGroup    : CGroup from Graphic3d;
-                     ListVertex : Array2OfVertex from Graphic3d;
-                     EvalMinMax : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_quadrangle
-
-    QuadrangleMesh ( me         : mutable;
-                     ACGroup    : CGroup from Graphic3d;
-                     ListVertex : Array2OfVertexN from Graphic3d;
-                     EvalMinMax : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_quadrangle
-
-    QuadrangleMesh ( me         : mutable;
-                     ACGroup    : CGroup from Graphic3d;
-                     ListVertex : Array2OfVertexNT from Graphic3d;
-                     EvalMinMax : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_quadrangle
+    SetStencilTestOptions ( me          : mutable;
+                            theCGroup   : CGroup from Graphic3d;
+                            theIsEnabled: Boolean from Standard)
+    is deferred;
+    ---Purpose: sets the stencil test to theIsEnabled state;
+    
+    SetFlippingOptions (me          : mutable;
+                        theCGroup   : CGroup from Graphic3d;
+                        theIsEnabled: Boolean from Standard;
+                        theRefPlane : Ax2 from gp)
+    is deferred;
+    ---Purpose: sets the flipping to theIsEnabled state for the given graphic group.
 
     ----------------------------------------
     -- Category: Methods to create Text
@@ -767,67 +403,6 @@ is
     -- for Purpose : see Graphic3d_Group.cdl
     ----------------------------------------
 
-    TriangleMesh ( me           : mutable;
-                   ACGroup      : CGroup from Graphic3d;
-                   ListVertex   : Array1OfVertex from Graphic3d;
-                   EvalMinMax   : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_triangle
-
-    TriangleMesh ( me           : mutable;
-                   ACGroup      : CGroup from Graphic3d;
-                   ListVertex   : Array1OfVertexN from Graphic3d;
-                   EvalMinMax   : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_triangle
-
-    TriangleMesh ( me           : mutable;
-                   ACGroup      : CGroup from Graphic3d;
-                   ListVertex   : Array1OfVertexNT from Graphic3d;
-                   EvalMinMax   : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_triangle
-
-    TriangleSet ( me            : mutable;
-                  ACGroup       : CGroup from Graphic3d;
-                  ListVertex    : Array1OfVertex from Graphic3d;
-                  ListEdge      : Array1OfEdge from Aspect;
-                  EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_indices
-
-    TriangleSet ( me            : mutable;
-                  ACGroup       : CGroup from Graphic3d;
-                  ListVertex    : Array1OfVertexN from Graphic3d;
-                  ListEdge      : Array1OfEdge from Aspect;
-                  EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_indices
-
-    TriangleSet ( me            : mutable;
-                  ACGroup       : CGroup from Graphic3d;
-                  ListVertex    : Array1OfVertexNT from Graphic3d;
-                  ListEdge      : Array1OfEdge from Aspect;
-                  EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_indices
-
-    TriangleSet ( me            : mutable;
-                  ACGroup       : CGroup from Graphic3d;
-                  ListVertex    : Array1OfVertexC from Graphic3d;
-                  ListEdge      : Array1OfEdge from Aspect;
-                  EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_indices
-
-    TriangleSet ( me            : mutable;
-                  ACGroup       : CGroup from Graphic3d;
-                  ListVertex    : Array1OfVertexNC from Graphic3d;
-                  ListEdge      : Array1OfEdge from Aspect;
-                  EvalMinMax    : Boolean from Standard = Standard_True )
-        is deferred;
-    ---Purpose: call_togl_polygon_indices
-
     PrimitiveArray( me          : mutable;
                     ACGroup     : CGroup from Graphic3d;
                     parray      : PrimitiveArray from Graphic3d;
@@ -846,6 +421,11 @@ is
                is deferred;
     ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
 
+    MemoryInfo (me;
+                theFreeBytes : out Size from Standard;
+                theInfo      : out AsciiString from TCollection) returns Boolean from Standard is deferred;
+    ---Purpose: Returns information about GPU memory usage.
+
     ----------------------------------------
     ---Category: Methods to create Triedron
     -- for Purpose : see Graphic3d_Group.cdl
@@ -908,141 +488,38 @@ is
     ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
     is deferred;
 
-    ---------------------------
-    -- Category: Animation mode
-    ---------------------------
-
-    BeginAnimation ( me : mutable;
-             ACView : CView from Graphic3d)
-        is deferred;
-    ---Purpose: call_togl_begin_animation
-
-    EndAnimation ( me   : mutable;
-               ACView   : CView from Graphic3d)
-        is deferred;
-    ---Purpose: call_togl_end_animation
-
     ----------------------------------
-    -- Category: Ajout mode methods
+    -- Category: Immediate mode methods
     ----------------------------------
 
-    BeginAddMode ( me   : mutable;
-                ACView      : CView from Graphic3d)
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_begin_ajout_mode
-
-    EndAddMode ( me     : mutable)
-        is deferred;
-    ---Purpose: call_togl_end_ajout_mode
-
-    ----------------------------------
-    -- Category: Immediat mode methods
-    ----------------------------------
-
-    BeginImmediatMode ( me              : mutable;
-                        ACView          : CView from Graphic3d;
-                        ACUnderLayer    : CLayer2d from Aspect;
-                        ACOverLayer     : CLayer2d from Aspect;
-                        DoubleBuffer    : Boolean from Standard;
-                        RetainMode      : Boolean from Standard)
-        returns Boolean from Standard
-        is deferred;
-    ---Purpose: call_togl_begin_immediat_mode
-
-    BeginPolyline ( me  : mutable )
-        is deferred;
-    ---Purpose: call_togl_begin_polyline
-
-    ClearImmediatMode ( me  : mutable; ACView       : CView from Graphic3d;
-                  aFlush        : Boolean from Standard = Standard_True)
-        is deferred;
-    ---Purpose: call_togl_clear_immediat_mode
-
-    Draw ( me   : mutable;
-           X    : ShortReal from Standard;
-           Y    : ShortReal from Standard;
-           Z    : ShortReal from Standard )
-        is deferred;
-    ---Purpose: call_togl_draw
-
-    DrawStructure ( me          : mutable;
-                    ACStructure : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_draw_structure
-
-    EndImmediatMode ( me            : mutable;
-                      Synchronize   : Integer from Standard )
-        is deferred;
-    ---Purpose: call_togl_end_immediat_mode
-
-    EndPolyline ( me    : mutable )
-        is deferred;
-    ---Purpose: call_togl_end_polyline
-
-    Move ( me   : mutable;
-           X    : ShortReal from Standard;
-           Y    : ShortReal from Standard;
-           Z    : ShortReal from Standard )
-        is deferred;
-    ---Purpose: call_togl_move
-
-    SetLineColor ( me   : mutable;
-                   R    : ShortReal from Standard;
-                   G    : ShortReal from Standard;
-                   B    : ShortReal from Standard )
-        is deferred;
-    ---Purpose: call_togl_set_linecolor
-
-    SetLineType ( me    : mutable;
-                  Type  : Integer from Standard )
-        is deferred;
-    ---Purpose: call_togl_set_linetype
-
-    SetLineWidth ( me   : mutable;
-               Width    : ShortReal from Standard )
-        is deferred;
-    ---Purpose: call_togl_set_linewidth
-
-    SetMinMax ( me  : mutable;
-                X1  : ShortReal from Standard;
-                Y1  : ShortReal from Standard;
-                Z1  : ShortReal from Standard;
-                X2  : ShortReal from Standard;
-                Y2  : ShortReal from Standard;
-                Z2  : ShortReal from Standard )
-        is deferred;
-    ---Purpose: call_togl_set_minmax
-
-    Transform ( me      : mutable;
-                AMatrix : Array2OfReal from TColStd;
-                AType   : TypeOfComposition from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_transform
-
-    -----------------------------
-    -- Category: Textures methods
-    -----------------------------
-
-        CreateTexture ( me;
-                        Type            : TypeOfTexture from Graphic3d;
-                        Image           : AlienImage from AlienImage;
-                        FileName        : CString from Standard;
-                        TexUpperBounds  : HArray1OfReal from TColStd )
-        returns Integer from Standard
-        is deferred;
-    ---Purpose:
-
-    DestroyTexture ( me;
-                     TexId  : Integer from Standard )
-        is deferred;
-    ---Purpose:
+    SetImmediateModeDrawToFront (me                   : mutable;
+                                 theCView             : CView from Graphic3d;
+                                 theDrawToFrontBuffer : Boolean from Standard)
+    returns Boolean from Standard
+    is deferred;
+    ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
+    -- 1. TRUE.  Drawing immediate mode structures directly to the front buffer over the scene image.
+    --    Fast, so preferred for interactive work (used by default).
+    --    However these extra drawings will be missed in image dump since it is performed from back buffer.
+    --    Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
+    --    in run-time (in case of slow hardware) and/or tearing may appear.
+    --    So this is strongly recommended to draw only simple (fast) structures.
+    -- 2. FALSE. Drawing immediate mode structures to the back buffer.
+    --    The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
+    --    But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
+    -- @return previous mode.
+
+    DisplayImmediateStructure ( me            : mutable;
+                                theCView      : CView      from Graphic3d;
+                                theCStructure : CStructure from Graphic3d )
+    is deferred;
+    ---Purpose: Display structure in immediate mode on top of general presentation
 
-    ModifyTexture ( me;
-                    TexId   : Integer from Standard;
-                    AValue  : CInitTexture from Graphic3d )
-        is deferred;
-    ---Purpose:
+    EraseImmediateStructure ( me            : mutable;
+                              theCView      : CView      from Graphic3d;
+                              theCStructure : CStructure from Graphic3d )
+    is deferred;
+    ---Purpose: Erases immediate structure
 
     -------------------------------
     -- Category: Layer mode methods
@@ -1142,7 +619,11 @@ is
                         G       : ShortReal from Standard;
                         B       : ShortReal from Standard )
         is deferred;
-    ---Purpose: call_togl_set_text_attributes
+    ---Purpose: Set text attributes for under-/overlayer.
+    -- <Font> argument defines the name of the font to be used,
+    -- <Type> argument defines the display type of the text,
+    -- <R> <G> <B> values define the color of decal or subtitle background.
+    -- To set the color of the text you can use the SetColor method.
 
     Text ( me       : mutable;
            AText    : CString from Standard;
@@ -1219,8 +700,9 @@ is
     ---Purpose: Change offscreen FBO viewport.
 
         BufferDump( me            : mutable;
-                    view          : CView from Graphic3d;
-                    buffer        : in out CRawBufferData from Image )
+                    theCView      : CView from Graphic3d;
+                    theImage      : in out PixMap from Image;
+                    theBufferType : BufferType from Graphic3d )
                    returns Boolean from Standard
     is deferred;
     ---Purpose: Dump active rendering buffer into specified memory buffer.
@@ -1278,15 +760,6 @@ is
     -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
     -- Notice however that results may differ a lot and do not contain some elements.
 
-    RemovePrimitiveArray( me        : mutable;
-                          theCGroup : CGroup from Graphic3d;
-                          thePArray : PrimitiveArray from Graphic3d )
-        is deferred;
-        ---Purpose: Clear visualization data in graphical driver and
-        -- stop displaying the primitives array of the graphical group
-        -- <theCGroup>. This method is internal and should be used
-        -- by Graphic3d_Group only.
-
     AddZLayer( me         : mutable;
                theCView   : CView from Graphic3d;
                theLayerId : Integer from Standard )
@@ -1333,22 +806,6 @@ is
         ---Purpose: Get Z layer ID of structure. If the structure doesn't
         -- exists in graphic driver, the method returns -1.
 
-    --------------------------
-    -- Category: Class methods
-    --------------------------
-
-    Light ( myclass;
-        ACLight : CLight from Graphic3d;
-        Update  : Boolean from Standard )
-        returns Integer from Standard;
-    ---Purpose: call_togl_light
-
-    Plane ( myclass;
-        ACPlane : CPlane from Graphic3d;
-        Update  : Boolean from Standard )
-        returns Integer from Standard;
-    ---Purpose: call_togl_plane
-
     -----------------------------
     -- Category: Internal methods
     -----------------------------
@@ -1369,10 +826,6 @@ is
                  ACPick    : CPick from Graphic3d;
                  AField    : Integer from Standard );
 
-    PrintCPlane ( me;
-                  ACPlane   : CPlane from Graphic3d;
-                  AField    : Integer from Standard );
-
     PrintCStructure ( me;
                       ACStructure   : CStructure from Graphic3d;
                       AField    : Integer from Standard );
@@ -1421,9 +874,24 @@ is
     --            returns Standard_False if fails
     --  ABD Integration support of system fonts (using FTGL and FreeType)
 
+    GetDisplayConnection (me)
+       returns DisplayConnection_Handle from Aspect;
+    ---C++: return const &
+
+    ---Purpose: returns Handle to display connection
+
+    IsDeviceLost (me)
+      returns Boolean from Standard;
+    -- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
+
+    ResetDeviceLostFlag (me: mutable);
+    -- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
+
 fields
 
-    MyTraceLevel    : Integer from Standard is protected;
-    MySharedLibrary : SharedLibrary from OSD is protected;
+    MyTraceLevel       : Integer from Standard is protected;
+    MySharedLibrary    : SharedLibrary from OSD is protected;
+    myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
+    myDeviceLostFlag   : Boolean from Standard is protected;
 
 end GraphicDriver from Graphic3d;