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 63d7cab..710d2d1
@@ -1,22 +1,18 @@
 -- Created on: 1997-01-28
 -- Created by: CAL
 -- Copyright (c) 1997-1999 Matra Datavision
--- Copyright (c) 1999-2012 OPEN CASCADE SAS
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
 --
--- 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.
+-- This file is part of Open CASCADE Technology software library.
 --
--- 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.
+-- 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.
 --
--- 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.
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
 
 deferred class GraphicDriver from Graphic3d inherits TShared
 
@@ -68,9 +64,11 @@ uses
     CPick               from Graphic3d,
     CPlane              from Graphic3d,
     CStructure          from Graphic3d,
+    CStructure_Handle   from Graphic3d,
     CView               from Graphic3d,
     BufferType          from Graphic3d,
     Structure           from Graphic3d,
+    StructureManager    from Graphic3d,
     TextPath            from Graphic3d,
     TypeOfComposition   from Graphic3d,
     TypeOfPrimitive     from Graphic3d,
@@ -91,7 +89,8 @@ uses
     NListOfHAsciiString from Graphic3d,
     FontAspect          from Font,
     CGraduatedTrihedron from Graphic3d,
-    ClipPlane           from Graphic3d
+    ClipPlane           from Graphic3d,
+    Ax2                 from gp
 
 raises
 
@@ -126,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;
@@ -143,36 +135,6 @@ is
         is deferred;
     ---Purpose: call_togl_inquireview
 
-    ------------------------------
-    -- 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
     -------------------------------------
@@ -220,50 +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 )
+    Structure (me : mutable;
+               theManager : StructureManager from Graphic3d)
+        returns CStructure_Handle from Graphic3d
         is deferred;
-    ---Purpose: call_togl_structure
+    ---Purpose: Creates new empty graphic structure
 
     ------------------------------------
     -- Category: Structured mode methods
@@ -328,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 )
@@ -402,50 +310,27 @@ is
     SetClipPlanes (me : mutable; theCView : CView from Graphic3d) is deferred;
     ---Purpose: Pass clip planes to the associated graphic driver view.
 
-    SetClipPlanes (me : mutable; theCStructure : CStructure from Graphic3d) is deferred;
-    ---Purpose: Pass clip planes to the associated graphic driver structure.
+    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
-
     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;
@@ -456,6 +341,13 @@ is
                             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
@@ -597,21 +489,7 @@ is
     is deferred;
 
     ----------------------------------
-    -- Category: Ajout 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
+    -- Category: Immediate mode methods
     ----------------------------------
 
     SetImmediateModeDrawToFront (me                   : mutable;
@@ -631,30 +509,17 @@ is
     --    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.
 
-    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
-
-    ClearImmediatMode ( me  : mutable; ACView       : CView from Graphic3d;
-                  aFlush        : Boolean from Standard = Standard_True)
-        is deferred;
-    ---Purpose: call_togl_clear_immediat_mode
-
-    DrawStructure ( me          : mutable;
-                    ACStructure : CStructure from Graphic3d )
-        is deferred;
-    ---Purpose: call_togl_draw_structure
+    DisplayImmediateStructure ( me            : mutable;
+                                theCView      : CView      from Graphic3d;
+                                theCStructure : CStructure from Graphic3d )
+    is deferred;
+    ---Purpose: Display structure in immediate mode on top of general presentation
 
-    EndImmediatMode ( me            : mutable;
-                      Synchronize   : Integer from Standard )
-        is deferred;
-    ---Purpose: call_togl_end_immediat_mode
+    EraseImmediateStructure ( me            : mutable;
+                              theCView      : CView      from Graphic3d;
+                              theCStructure : CStructure from Graphic3d )
+    is deferred;
+    ---Purpose: Erases immediate structure
 
     -------------------------------
     -- Category: Layer mode methods