2301f2be0a5308223c2982a94922d9df5252cdf0
[occt.git] / src / Graphic3d / Graphic3d_GraphicDriver.cdl
1 -- Created on: 1997-01-28
2 -- Created by: CAL
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21 deferred class GraphicDriver from Graphic3d inherits TShared
22
23     ---Version:
24
25     ---Purpose: This class allows the definition of a graphic driver
26     --      (currently only OpenGl driver is used).
27
28     ---Keywords: OpenGl
29
30     ---Warning:
31     ---References:
32
33 uses
34
35     SharedLibrary       from OSD,
36
37     Array1OfInteger     from TColStd,
38     Array1OfReal        from TColStd,
39     Array2OfReal        from TColStd,
40
41     AsciiString         from TCollection,
42     ExtendedString      from TCollection,
43
44     NameOfColor         from Quantity,
45     Color               from Quantity,
46
47     PlaneAngle          from Quantity,
48
49     AlienImage          from AlienImage,
50     PixMap              from Image,
51
52     Array1OfEdge        from Aspect,
53     CLayer2d            from Aspect,
54     TypeOfTriedronEcho  from Aspect,
55     TypeOfTriedronPosition  from Aspect,
56     Handle              from Aspect,
57     Display             from Aspect,
58     PrintAlgo           from Aspect,
59     DisplayConnection_Handle from Aspect,
60
61     AspectLine3d        from Graphic3d,
62     AspectMarker3d      from Graphic3d,
63     AspectText3d        from Graphic3d,
64     AspectFillArea3d    from Graphic3d,
65     HorizontalTextAlignment from Graphic3d,
66     CBitFields20        from Graphic3d,
67     CGroup              from Graphic3d,
68     CLight              from Graphic3d,
69     CPick               from Graphic3d,
70     CPlane              from Graphic3d,
71     CStructure          from Graphic3d,
72     CView               from Graphic3d,
73     BufferType          from Graphic3d,
74     Structure           from Graphic3d,
75     TextPath            from Graphic3d,
76     TypeOfComposition   from Graphic3d,
77     TypeOfPrimitive     from Graphic3d,
78     Vector              from Graphic3d,
79     Array1OfVertex      from Graphic3d,
80     Array2OfVertex      from Graphic3d,
81     Vertex              from Graphic3d,
82     VerticalTextAlignment   from Graphic3d,
83     PrimitiveArray      from Graphic3d,
84     PtrFrameBuffer      from Graphic3d,
85     HArray1OfByte       from TColStd,
86     FillMethod          from Aspect,
87     GradientFillMethod  from Aspect,
88     ExportFormat        from Graphic3d,
89     SortType            from Graphic3d,
90     HArray1OfReal       from TColStd,
91     CUserDraw           from Graphic3d,
92     NListOfHAsciiString from Graphic3d,
93     FontAspect          from Font,
94     CGraduatedTrihedron from Graphic3d
95
96 raises
97
98     TransformError      from Graphic3d
99
100 is
101         Initialize ( AShrName       : CString from Standard )
102                 returns mutable GraphicDriver from Graphic3d;
103         ---Level: Public
104         ---Purpose: Initialises the Driver
105
106     -------------------------
107     -- Category: Init methods
108     -------------------------
109
110     Begin (me: mutable;
111            theDisplayConnection: DisplayConnection_Handle from Aspect)
112        returns Boolean from Standard
113        is deferred;
114     ---Purpose: Starts graphic driver with given connection
115
116     End ( me    : mutable )
117         is deferred;
118     ---Purpose: call_togl_end
119
120     ----------------------------
121     -- Category: Inquire methods
122     ----------------------------
123
124     InquireLightLimit ( me  : mutable )
125         returns Integer from Standard
126         is deferred;
127     ---Purpose: call_togl_inquirelight
128
129     InquireMat ( me     : mutable;
130                  ACView : CView from Graphic3d;
131                  AMatO  : out Array2OfReal from TColStd;
132                  AMatM  : out Array2OfReal from TColStd )
133         is deferred;
134     ---Purpose: call_togl_inquiremat
135
136     InquirePlaneLimit ( me  : mutable )
137         returns Integer from Standard
138         is deferred;
139     ---Purpose: call_togl_inquireplane
140
141     InquireViewLimit ( me   : mutable )
142         returns Integer from Standard
143         is deferred;
144     ---Purpose: call_togl_inquireview
145
146     ------------------------------
147     -- Category: Highlight methods
148     ------------------------------
149
150     Blink ( me          : mutable;
151             ACStructure : CStructure from Graphic3d;
152             Create      : Boolean from Standard )
153         is deferred;
154     ---Purpose: call_togl_blink
155
156     BoundaryBox ( me            : mutable;
157                   ACStructure   : CStructure from Graphic3d;
158                   Create        : Boolean from Standard )
159         is deferred;
160     ---Purpose: call_togl_boundarybox
161
162     HighlightColor ( me             : mutable;
163                      ACStructure    : CStructure from Graphic3d;
164                      R              : ShortReal from Standard;
165                      G              : ShortReal from Standard;
166                      B              : ShortReal from Standard;
167                      Create         : Boolean from Standard )
168         is deferred;
169     ---Purpose: call_togl_highlightcolor
170
171     NameSetStructure ( me       : mutable;
172                ACStructure  : CStructure from Graphic3d )
173         is deferred;
174     ---Purpose: call_togl_namesetstructure
175
176     -------------------------------------
177     -- Category: Group management methods
178     -------------------------------------
179
180     ClearGroup ( me     : mutable;
181              ACGroup    : CGroup from Graphic3d )
182         is deferred;
183     ---Purpose: call_togl_cleargroup
184
185     FaceContextGroup ( me       : mutable;
186                        ACGroup  : CGroup from Graphic3d;
187                        NoInsert : Integer from Standard )
188         is deferred;
189     ---Purpose: call_togl_facecontextgroup
190
191     Group ( me  : mutable;
192         ACGroup : in out CGroup from Graphic3d )
193         is deferred;
194     ---Purpose: call_togl_group
195
196     LineContextGroup ( me       : mutable;
197                        ACGroup  : CGroup from Graphic3d;
198                        NoInsert : Integer from Standard )
199         is deferred;
200     ---Purpose: call_togl_linecontextgroup
201
202     MarkerContextGroup ( me         : mutable;
203                          ACGroup    : CGroup from Graphic3d;
204                          NoInsert   : Integer from Standard )
205         is deferred;
206     ---Purpose: call_togl_markercontextgroup
207
208     MarkerContextGroup ( me         : mutable;
209                          ACGroup    : CGroup from Graphic3d;
210                          NoInsert   : Integer from Standard;
211                          AMarkWidth : Integer from Standard;
212                          AMarkHeight: Integer from Standard;
213                          ATexture   : HArray1OfByte from TColStd )
214                 is deferred;
215     ---Purpose: call_togl_markercontextgroup
216
217     RemoveGroup ( me        : mutable;
218                   ACGroup   : CGroup from Graphic3d )
219         is deferred;
220     ---Purpose: call_togl_removegroup
221
222     TextContextGroup ( me       : mutable;
223                        ACGroup  : CGroup from Graphic3d;
224                        NoInsert : Integer from Standard )
225         is deferred;
226     ---Purpose: call_togl_textcontextgroup
227
228     -----------------------------------------
229     -- Category: Structure management methods
230     -----------------------------------------
231
232     ClearStructure ( me             : mutable;
233                      ACStructure    : CStructure from Graphic3d )
234         is deferred;
235     ---Purpose: call_togl_clearstructure
236
237     Connect ( me        : mutable;
238               AFather   : CStructure from Graphic3d;
239               ASon      : CStructure from Graphic3d )
240         is deferred;
241     ---Purpose: call_togl_connect
242
243     ContextStructure ( me           : mutable;
244                        ACStructure  : CStructure from Graphic3d )
245         is deferred;
246     ---Purpose: call_togl_contextstructure
247
248     Disconnect ( me         : mutable;
249                  AFather    : CStructure from Graphic3d;
250                  ASon       : CStructure from Graphic3d )
251         is deferred;
252     ---Purpose: call_togl_disconnect
253
254     DisplayStructure ( me           : mutable;
255                        ACView       : CView from Graphic3d;
256                        ACStructure  : CStructure from Graphic3d;
257                        APriority    : Integer from Standard )
258         is deferred;
259     ---Purpose: call_togl_displaystructure
260
261     EraseStructure ( me             : mutable;
262                      ACView         : CView from Graphic3d;
263                      ACStructure    : CStructure from Graphic3d )
264         is deferred;
265     ---Purpose: call_togl_erasestructure
266
267     RemoveStructure ( me            : mutable;
268                       ACStructure   : CStructure from Graphic3d )
269         is deferred;
270     ---Purpose: call_togl_removestructure
271
272     Structure ( me          : mutable;
273                 ACStructure : in out CStructure from Graphic3d )
274         is deferred;
275     ---Purpose: call_togl_structure
276
277     ------------------------------------
278     -- Category: Structured mode methods
279     ------------------------------------
280
281     ActivateView ( me       : mutable;
282                    ACView   : CView from Graphic3d )
283         is deferred;
284     ---Purpose: call_togl_activateview
285
286     AntiAliasing ( me       : mutable;
287                    ACView   : CView from Graphic3d;
288                    AFlag    : Boolean from Standard )
289         is deferred;
290     ---Purpose: call_togl_antialiasing
291
292     Background ( me     : mutable;
293                  ACView : CView from Graphic3d )
294         is deferred;
295     ---Purpose: call_togl_background
296
297     GradientBackground ( me     : mutable;
298                          ACView : CView from Graphic3d;
299                          AColor1: Color from Quantity;
300                          AColor2: Color from Quantity;
301                          FillStyle : GradientFillMethod from Aspect
302                        )
303     is deferred;
304     ---Purpose: call_togl_gradient_background
305
306
307     BackgroundImage( me           : mutable;
308                      FileName     : CString from Standard;
309                      ACView       : CView from Graphic3d;
310                      FillStyle    : FillMethod from Aspect )
311     is deferred;
312
313     SetBgImageStyle( me        : mutable;
314                      ACView    : CView from Graphic3d;
315                      FillStyle : FillMethod from Aspect )
316     is deferred;
317
318     SetBgGradientStyle( me        : mutable;
319                         ACView    : CView from Graphic3d;
320                         FillStyle : GradientFillMethod from Aspect )
321     is deferred;
322
323     ClipLimit ( me      : mutable;
324                 ACView  : CView from Graphic3d;
325                 AWait   : Boolean from Standard )
326         is deferred;
327     ---Purpose: call_togl_cliplimit
328
329     DeactivateView ( me     : mutable;
330                      ACView : CView from Graphic3d )
331         is deferred;
332     ---Purpose: call_togl_deactivateview
333
334     DepthCueing ( me        : mutable;
335                   ACView    : CView from Graphic3d;
336                   AFlag     : Boolean from Standard )
337         is deferred;
338     ---Purpose: call_togl_cliplimit
339
340     ProjectRaster ( me      : mutable;
341                     ACView  : CView from Graphic3d;
342                     AX      : ShortReal from Standard;
343                     AY      : ShortReal from Standard;
344                     AZ      : ShortReal from Standard;
345                     AU      : out Integer from Standard;
346                     AV      : out Integer from Standard )
347         returns Boolean from Standard
348         is deferred;
349     ---Purpose: call_togl_unproject_raster
350
351     UnProjectRaster ( me        : mutable;
352                       ACView    : CView from Graphic3d;
353                       Axm       : Integer from Standard;
354                       Aym       : Integer from Standard;
355                       AXM       : Integer from Standard;
356                       AYM       : Integer from Standard;
357                       AU        : Integer from Standard;
358                       AV        : Integer from Standard;
359                       AX        : out ShortReal from Standard;
360                       AY        : out ShortReal from Standard;
361                       AZ        : out ShortReal from Standard )
362         returns Boolean from Standard
363         is deferred;
364     ---Purpose: call_togl_unproject_raster
365
366     UnProjectRasterWithRay ( me        : mutable;
367                              ACView    : CView from Graphic3d;
368                              Axm       : Integer from Standard;
369                              Aym       : Integer from Standard;
370                              AXM       : Integer from Standard;
371                              AYM       : Integer from Standard;
372                              AU        : Integer from Standard;
373                              AV        : Integer from Standard;
374                              AX        : out ShortReal from Standard;
375                              AY        : out ShortReal from Standard;
376                              AZ        : out ShortReal from Standard;
377                              DX        : out ShortReal from Standard;
378                              DY        : out ShortReal from Standard;
379                              DZ        : out ShortReal from Standard )
380         returns Boolean from Standard
381         is deferred;
382     ---Purpose: call_togl_unproject_raster_with_ray
383
384     RatioWindow ( me        : mutable;
385                   ACView    : CView from Graphic3d )
386         is deferred;
387     ---Purpose: call_togl_ratio_window
388
389     Redraw ( me             : mutable;
390              ACView         : CView from Graphic3d;
391              ACUnderLayer   : CLayer2d from Aspect;
392              ACOverLayer    : CLayer2d from Aspect;
393              x              : Integer = 0;
394              y              : Integer = 0;
395              width              : Integer = 0;
396              height     : Integer = 0 )
397         is deferred;
398     ---Purpose: call_togl_redraw
399     --  Warning: when the redraw area has a null size, the full view is redrawn
400
401     RemoveView ( me     : mutable;
402                 ACView  : CView from Graphic3d )
403         is deferred;
404     ---Purpose: call_togl_removeview
405
406     SetLight ( me       : mutable;
407            ACView   : CView from Graphic3d )
408         is deferred;
409     ---Purpose: call_togl_setlight
410
411     SetPlane ( me       : mutable;
412                ACView   : CView from Graphic3d )
413         is deferred;
414     ---Purpose: call_togl_setplane
415
416     SetVisualisation ( me       : mutable;
417                        ACView   : CView from Graphic3d )
418         is deferred;
419     ---Purpose: call_togl_setvisualisation
420
421     TransformStructure ( me             : mutable;
422                          ACStructure    : CStructure from Graphic3d )
423         is deferred;
424     ---Purpose: call_togl_transformstructure
425
426         DegenerateStructure ( me                        : mutable;
427                               ACStructure       : CStructure from Graphic3d )
428                 is deferred;
429         ---Purpose: call_togl_degeneratestructure
430
431     Transparency ( me       : mutable;
432                    ACView   : CView from Graphic3d;
433                    AFlag    : Boolean from Standard )
434         is deferred;
435     ---Purpose: call_togl_transparency
436
437     Update ( me             : mutable;
438              ACView         : CView from Graphic3d;
439              ACUnderLayer   : CLayer2d from Aspect;
440              ACOverLayer    : CLayer2d from Aspect )
441             is deferred;
442     ---Purpose: call_togl_update
443
444     View ( me   : mutable;
445            ACView   : in out CView from Graphic3d )
446         returns Boolean from Standard
447         is deferred;
448     ---Purpose: call_togl_view
449
450     ViewMapping ( me        : mutable;
451                   ACView    : CView from Graphic3d;
452                   AWait : Boolean from Standard )
453         is deferred;
454     ---Purpose: call_togl_viewmapping
455
456     ViewOrientation ( me        : mutable;
457                       ACView    : CView from Graphic3d;
458                       AWait     : Boolean from Standard )
459         is deferred;
460     ---Purpose: call_togl_vieworientation
461
462         Environment ( me        : mutable;
463                       ACView    : CView from Graphic3d )
464         is deferred;
465     ---Purpose:
466
467     ----------------------------------------
468     -- Category: Methods to create Marker
469     -- for Purpose : see Graphic3d_Group.cdl
470     ----------------------------------------
471
472     Marker ( me         : mutable;
473              ACGroup    : CGroup from Graphic3d;
474              APoint     : Vertex from Graphic3d )
475         is deferred;
476
477     MarkerSet ( me          : mutable;
478                 ACGroup     : CGroup from Graphic3d;
479                 ListVertex  : Array1OfVertex from Graphic3d )
480         is deferred;
481
482     ----------------------------------------
483     -- Category: Methods to create Text
484     -- for Purpose : see Graphic3d_Group.cdl
485     ----------------------------------------
486
487     Text ( me   : mutable;
488            ACGroup  : CGroup from Graphic3d;
489            AText    : CString from Standard;
490            APoint   : Vertex from Graphic3d;
491            AHeight  : Real from Standard;
492            AAngle   : PlaneAngle from Quantity;
493            ATp  : TextPath from Graphic3d;
494            AHta : HorizontalTextAlignment from Graphic3d;
495            AVta : VerticalTextAlignment from Graphic3d;
496            EvalMinMax   : Boolean from Standard = Standard_True )
497         is deferred;
498     ---Purpose: call_togl_text
499
500     Text ( me   : mutable;
501            ACGroup  : CGroup from Graphic3d;
502            AText    : CString from Standard;
503            APoint   : Vertex from Graphic3d;
504            AHeight  : Real from Standard;
505            EvalMinMax   : Boolean from Standard = Standard_True )
506         is deferred;
507     ---Purpose: call_togl_text
508
509     Text ( me   : mutable;
510            ACGroup  : CGroup from Graphic3d;
511            AText    : ExtendedString from TCollection;
512            APoint   : Vertex from Graphic3d;
513            AHeight  : Real from Standard;
514            AAngle   : PlaneAngle from Quantity;
515            ATp  : TextPath from Graphic3d;
516            AHta : HorizontalTextAlignment from Graphic3d;
517            AVta : VerticalTextAlignment from Graphic3d;
518            EvalMinMax   : Boolean from Standard = Standard_True )
519         is deferred;
520     ---Purpose: call_togl_text
521
522     Text ( me   : mutable;
523            ACGroup  : CGroup from Graphic3d;
524            AText    : ExtendedString from TCollection;
525            APoint   : Vertex from Graphic3d;
526            AHeight  : Real from Standard;
527            EvalMinMax   : Boolean from Standard = Standard_True )
528         is deferred;
529     ---Purpose: call_togl_text
530
531     ----------------------------------------
532     ---Category: Methods to create Triangle
533     -- for Purpose : see Graphic3d_Group.cdl
534     ----------------------------------------
535
536     PrimitiveArray( me          : mutable;
537                     ACGroup     : CGroup from Graphic3d;
538                     parray      : PrimitiveArray from Graphic3d;
539                     EvalMinMax  : Boolean from Standard = Standard_True )
540         is deferred;
541         ---Purpose: call_togl_parray
542
543     UserDraw( me          : mutable;
544               ACGroup     : CGroup from Graphic3d;
545               AUserDraw   : CUserDraw from Graphic3d )
546         is deferred;
547         ---Purpose: call_togl_userdraw
548
549     EnableVBO( me       : mutable;
550                status   : Boolean from Standard )
551                is deferred;
552     ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
553
554     MemoryInfo (me;
555                 theFreeBytes : out Size from Standard;
556                 theInfo      : out AsciiString from TCollection) returns Boolean from Standard is deferred;
557     ---Purpose: Returns information about GPU memory usage.
558
559     ----------------------------------------
560     ---Category: Methods to create Triedron
561     -- for Purpose : see Graphic3d_Group.cdl
562     ----------------------------------------
563
564     ZBufferTriedronSetup ( me          : mutable;
565                            XColor      : NameOfColor from Quantity = Quantity_NOC_RED;
566                            YColor      : NameOfColor from Quantity = Quantity_NOC_GREEN;
567                            ZColor      : NameOfColor from Quantity = Quantity_NOC_BLUE1;
568                            SizeRatio   : Real from Standard = 0.8;
569                            AxisDiametr : Real from Standard = 0.05;
570                            NbFacettes  : Integer from Standard = 12)
571          is deferred;
572         ---Purpose: call_togl_ztriedron_setup
573
574     TriedronDisplay ( me            : mutable;
575                       ACView        : CView from Graphic3d;
576                       APosition     : TypeOfTriedronPosition from Aspect  = Aspect_TOTP_CENTER;
577                       AColor        : NameOfColor from Quantity = Quantity_NOC_WHITE ;
578                       AScale        : Real from Standard  =  0.02;
579                       AsWireframe   : Boolean from Standard = Standard_True )
580         is deferred;
581     ---Purpose: call_togl_triedron_display
582
583
584     TriedronErase ( me      : mutable;
585                   ACView    : CView from Graphic3d)
586         is deferred;
587     ---Purpose: call_togl_triedron_erase
588
589
590     TriedronEcho ( me       : mutable;
591                    ACView   : CView from Graphic3d;
592                    AType    : TypeOfTriedronEcho from Aspect  = Aspect_TOTE_NONE )
593         is deferred;
594     ---Purpose: call_togl_triedron_echo
595
596     ---------------------------------
597     ---Category: Graduated  trihedron
598     ---------------------------------
599
600     GraduatedTrihedronDisplay(me : mutable;
601                               view : CView from Graphic3d;
602                               cubic : CGraduatedTrihedron from Graphic3d)
603     ---Purpose: call_togl_graduatedtrihedron_display
604     is deferred;
605
606     GraduatedTrihedronErase(me : mutable;
607                             view : CView from Graphic3d)
608     ---Purpose: call_togl_graduatedtrihedron_erase
609     is deferred;
610
611     GraduatedTrihedronMinMaxValues(me : mutable;
612                                    xmin : ShortReal from Standard;
613                                    ymin : ShortReal from Standard;
614                                    zmin : ShortReal from Standard;
615                                    xmax : ShortReal from Standard;
616                                    ymax : ShortReal from Standard;
617                                    zmax : ShortReal from Standard)
618     ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
619     is deferred;
620
621     ---------------------------
622     -- Category: Animation mode
623     ---------------------------
624
625     BeginAnimation ( me : mutable;
626              ACView : CView from Graphic3d)
627         is deferred;
628     ---Purpose: call_togl_begin_animation
629
630     EndAnimation ( me   : mutable;
631                ACView   : CView from Graphic3d)
632         is deferred;
633     ---Purpose: call_togl_end_animation
634
635     ----------------------------------
636     -- Category: Ajout mode methods
637     ----------------------------------
638
639     BeginAddMode ( me   : mutable;
640                 ACView      : CView from Graphic3d)
641         returns Boolean from Standard
642         is deferred;
643     ---Purpose: call_togl_begin_ajout_mode
644
645     EndAddMode ( me     : mutable)
646         is deferred;
647     ---Purpose: call_togl_end_ajout_mode
648
649     ----------------------------------
650     -- Category: Immediat mode methods
651     ----------------------------------
652
653     SetImmediateModeDrawToFront (me                   : mutable;
654                                  theCView             : CView from Graphic3d;
655                                  theDrawToFrontBuffer : Boolean from Standard)
656     returns Boolean from Standard
657     is deferred;
658     ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
659     -- 1. TRUE.  Drawing immediate mode structures directly to the front buffer over the scene image.
660     --    Fast, so preferred for interactive work (used by default).
661     --    However these extra drawings will be missed in image dump since it is performed from back buffer.
662     --    Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
663     --    in run-time (in case of slow hardware) and/or tearing may appear.
664     --    So this is strongly recommended to draw only simple (fast) structures.
665     -- 2. FALSE. Drawing immediate mode structures to the back buffer.
666     --    The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
667     --    But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
668     -- @return previous mode.
669
670     BeginImmediatMode ( me              : mutable;
671                         ACView          : CView from Graphic3d;
672                         ACUnderLayer    : CLayer2d from Aspect;
673                         ACOverLayer     : CLayer2d from Aspect;
674                         DoubleBuffer    : Boolean from Standard;
675                         RetainMode      : Boolean from Standard)
676         returns Boolean from Standard
677         is deferred;
678     ---Purpose: call_togl_begin_immediat_mode
679
680     ClearImmediatMode ( me  : mutable; ACView       : CView from Graphic3d;
681                   aFlush        : Boolean from Standard = Standard_True)
682         is deferred;
683     ---Purpose: call_togl_clear_immediat_mode
684
685     DrawStructure ( me          : mutable;
686                     ACStructure : CStructure from Graphic3d )
687         is deferred;
688     ---Purpose: call_togl_draw_structure
689
690     EndImmediatMode ( me            : mutable;
691                       Synchronize   : Integer from Standard )
692         is deferred;
693     ---Purpose: call_togl_end_immediat_mode
694
695     -------------------------------
696     -- Category: Layer mode methods
697     -------------------------------
698
699     Layer ( me      : mutable;
700             ACLayer : in out CLayer2d from Aspect )
701         is deferred;
702     ---Purpose: call_togl_layer2d
703
704     RemoveLayer ( me        : mutable;
705                   ACLayer   : CLayer2d from Aspect )
706         is deferred;
707     ---Purpose: call_togl_removelayer2d
708
709     BeginLayer ( me         : mutable;
710                  ACLayer    : CLayer2d from Aspect )
711         is deferred;
712     ---Purpose: call_togl_begin_layer2d
713
714     BeginPolygon2d ( me : mutable )
715         is deferred;
716     ---Purpose: call_togl_begin_polygon2d
717
718     BeginPolyline2d ( me    : mutable )
719         is deferred;
720     ---Purpose: call_togl_begin_polyline2d
721
722     ClearLayer ( me         : mutable;
723                  ACLayer    : CLayer2d from Aspect )
724         is deferred;
725     ---Purpose: call_togl_clear_layer2d
726
727     Draw ( me   : mutable;
728            X    : ShortReal from Standard;
729            Y    : ShortReal from Standard )
730         is deferred;
731     ---Purpose: call_togl_draw2d
732
733     Edge ( me   : mutable;
734            X    : ShortReal from Standard;
735            Y    : ShortReal from Standard )
736         is deferred;
737     ---Purpose: call_togl_edge2d
738
739     EndLayer ( me       : mutable )
740         is deferred;
741     ---Purpose: call_togl_end_layer2d
742
743     EndPolygon2d ( me   : mutable )
744         is deferred;
745     ---Purpose: call_togl_end_polygon2d
746
747     EndPolyline2d ( me  : mutable )
748         is deferred;
749     ---Purpose: call_togl_end_polyline2d
750
751     Move ( me   : mutable;
752            X    : ShortReal from Standard;
753            Y    : ShortReal from Standard )
754         is deferred;
755     ---Purpose: call_togl_move2d
756
757     Rectangle ( me              : mutable;
758                 X, Y            : ShortReal from Standard;
759                 Width, Height   : ShortReal from Standard )
760         is deferred;
761     ---Purpose: call_togl_rectangle2d
762
763     SetColor ( me   : mutable;
764                R    : ShortReal from Standard;
765                G    : ShortReal from Standard;
766                B    : ShortReal from Standard )
767         is deferred;
768     ---Purpose: call_togl_set_color
769
770     SetTransparency ( me    : mutable;
771            ATransparency    : ShortReal from Standard )
772         is deferred;
773     ---Purpose: call_togl_set_transparency
774
775     UnsetTransparency ( me  : mutable )
776         is deferred;
777     ---Purpose: call_togl_unset_transparency
778
779     SetLineAttributes ( me      : mutable;
780                         Type    : Integer from Standard;
781                         Width   : ShortReal from Standard )
782         is deferred;
783     ---Purpose: call_togl_set_line_attributes
784
785
786     SetTextAttributes ( me      : mutable;
787                         Font    : CString from Standard;
788                         Type    : Integer from Standard;
789                         R       : ShortReal from Standard;
790                         G       : ShortReal from Standard;
791                         B       : ShortReal from Standard )
792         is deferred;
793     ---Purpose: Set text attributes for under-/overlayer.
794     -- <Font> argument defines the name of the font to be used,
795     -- <Type> argument defines the display type of the text,
796     -- <R> <G> <B> values define the color of decal or subtitle background.
797     -- To set the color of the text you can use the SetColor method.
798
799     Text ( me       : mutable;
800            AText    : CString from Standard;
801            X, Y     : ShortReal from Standard;
802            AHeight  : ShortReal from Standard )
803         is deferred;
804     ---Purpose: call_togl_text2d
805     -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
806
807     DefaultTextHeight( me )
808         returns ShortReal from Standard
809         is deferred;
810
811
812     TextSize( me;
813               AText    : CString from Standard;
814               AHeight  : ShortReal from Standard;
815               AWidth   : in out ShortReal from Standard;
816               AnAscent : in out ShortReal from Standard;
817               ADescent : in out ShortReal from Standard )
818             is deferred;
819     ---Purpose: call_togl_textsize2d
820
821         SetBackFacingModel ( me    : mutable;
822                              aView : CView from Graphic3d )
823             is deferred;
824         ---Purpose: call_togl_backfacing
825
826         SetDepthTestEnabled( me; view : CView from Graphic3d;
827                                  isEnabled : Boolean from Standard )
828     is deferred;
829     ---Purpose: call_togl_depthtest
830
831         IsDepthTestEnabled( me; view : CView from Graphic3d )
832     returns Boolean from Standard is deferred;
833     ---Purpose: call_togl_isdepthtest
834
835         ReadDepths( me;
836                     view          : CView from Graphic3d;
837                     x, y          : Integer;
838                     width, height : Integer;
839                     buffer        : Address )
840     is deferred;
841     ---Purpose: Reads depths of shown pixels of the given
842     --          rectangle (glReadPixels with GL_DEPTH_COMPONENT)
843
844         FBOCreate( me            : mutable;
845                    view          : CView from Graphic3d;
846                    width, height : Integer from Standard )
847                   returns PtrFrameBuffer from Graphic3d
848     is deferred;
849     ---Purpose: Generate offscreen FBO in the graphic library.
850     --          If not supported on hardware returns NULL.
851
852         FBORelease( me            : mutable;
853                     view          : CView from Graphic3d;
854                     fboPtr        : in out PtrFrameBuffer from Graphic3d )
855     is deferred;
856     ---Purpose: Remove offscreen FBO from the graphic library
857
858         FBOGetDimensions( me                  : mutable;
859                           view                : CView from Graphic3d;
860                           fboPtr              : PtrFrameBuffer from Graphic3d;
861                           width, height       : out Integer from Standard;
862                           widthMax, heightMax : out Integer from Standard )
863     is deferred;
864     ---Purpose: Read offscreen FBO configuration.
865
866         FBOChangeViewport( me                  : mutable;
867                            view                : CView from Graphic3d;
868                            fboPtr              : in out PtrFrameBuffer from Graphic3d;
869                            width, height       : Integer from Standard )
870     is deferred;
871     ---Purpose: Change offscreen FBO viewport.
872
873         BufferDump( me            : mutable;
874                     theCView      : CView from Graphic3d;
875                     theImage      : in out PixMap from Image;
876                     theBufferType : BufferType from Graphic3d )
877                    returns Boolean from Standard
878     is deferred;
879     ---Purpose: Dump active rendering buffer into specified memory buffer.
880
881         SetGLLightEnabled( me; view : CView from Graphic3d;
882                                isEnabled : Boolean from Standard )
883     is deferred;
884     ---Purpose: call_togl_gllight
885
886         IsGLLightEnabled( me; view : CView from Graphic3d )
887     returns Boolean from Standard is deferred;
888     ---Purpose: call_togl_isgllight
889
890     Print (me;
891            ACView          : CView from Graphic3d;
892            ACUnderLayer    : CLayer2d from Aspect;
893            ACOverLayer     : CLayer2d from Aspect;
894            hPrnDC          : Handle from Aspect;
895            showBackground  : Boolean;
896            filename        : CString;
897            printAlgorithm  : PrintAlgo from Aspect = Aspect_PA_STRETCH;
898            theScaleFactor  : Real from Standard = 1.0 )
899         returns Boolean from Standard is deferred;
900       ---Level: Internal
901       ---Purpose: print the contents of all layers of the view to the printer.
902     -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
903     -- <showBackground> : When set to FALSE then print the view without background color
904     -- (background is white)
905       -- else set to TRUE for printing with current background color.
906     -- <filename>: If != NULL, then the view will be printed to a file.
907     -- <printAlgorithm>: Select print algorithm: stretch, tile.   
908     -- <theScaleFactor>: Scaling coefficient, used internally to scale the
909     -- printings accordingly to the scale factor selected in the printer 
910     -- properties dialog.
911     -- Returns Standard_True if the data is passed to the printer, otherwise
912     -- Standard_False if the print operation failed due to the printer errors, 
913     -- or insufficient system memory available.
914     ---Warning: Works only under Windows.
915
916         Export( me: mutable;
917                 theFileName         : CString from Standard;
918                 theFormat           : ExportFormat from Graphic3d;
919                 theSortType         : SortType from Graphic3d;
920                 theWidth, theHeight : Integer from Standard;
921                 theView             : CView from Graphic3d;
922                 theLayerUnder       : CLayer2d from Aspect;
923                 theLayerOver        : CLayer2d from Aspect;
924                 thePrecision        : Real from Standard = 0.005;
925                 theProgressBarFunc  : Address from Standard = NULL;
926                 theProgressObject   : Address from Standard = NULL )
927         returns Boolean from Standard
928         is deferred;
929     ---Purpose:
930     -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
931     -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
932     -- Notice however that results may differ a lot and do not contain some elements.
933
934     AddZLayer( me         : mutable;
935                theCView   : CView from Graphic3d;
936                theLayerId : Integer from Standard )
937         is deferred;
938         ---Purpose: Add a new top-level z layer with ID <theLayerId> for
939         -- the view. Z layers allow drawing structures in higher layers
940         -- in foreground of structures in lower layers. To add a structure
941         -- to desired layer on display it is necessary to set the layer
942         -- ID for the structure.
943
944     RemoveZLayer( me         : mutable;
945                   theCView   : CView from Graphic3d;
946                   theLayerId : Integer from Standard )
947         is deferred;
948         ---Purpose: Remove Z layer from the specified view. All structures
949         -- displayed at the moment in layer will be displayed in default layer
950         -- ( the bottom-level z layer ). To unset layer ID from associated
951         -- structures use method UnsetZLayer (...).
952
953     UnsetZLayer( me         : mutable;
954                  theLayerId : Integer from Standard ) 
955         is deferred;
956         ---Purpose: Unset Z layer ID for all structures. The structure
957         -- indexes will be set to default layer ( the bottom-level z layer
958         -- with ID = 0 ).
959
960     ChangeZLayer( me            : mutable;
961                   theCStructure : CStructure from Graphic3d;
962                   theLayerId    : Integer from Standard )
963         is deferred;
964         ---Purpose: Change Z layer of a structure. The new z layer ID will
965         -- be used to define the associated layer for structure on display.
966
967     ChangeZLayer( me            : mutable;
968                   theCStructure : CStructure from Graphic3d;
969                   theCView      : CView from Graphic3d;
970                   theNewLayerId : Integer from Standard )
971         is deferred;
972         ---Purpose: Change Z layer of a structure already presented in view.
973
974     GetZLayer( me;
975                theCStructure : CStructure from Graphic3d )
976         returns Integer from Standard is deferred;
977         ---Purpose: Get Z layer ID of structure. If the structure doesn't
978         -- exists in graphic driver, the method returns -1.
979
980     --------------------------
981     -- Category: Class methods
982     --------------------------
983
984     Light ( myclass;
985         ACLight : CLight from Graphic3d;
986         Update  : Boolean from Standard )
987         returns Integer from Standard;
988     ---Purpose: call_togl_light
989
990     Plane ( myclass;
991         ACPlane : CPlane from Graphic3d;
992         Update  : Boolean from Standard )
993         returns Integer from Standard;
994     ---Purpose: call_togl_plane
995
996     -----------------------------
997     -- Category: Internal methods
998     -----------------------------
999
1000     PrintBoolean ( me;
1001                    AComment : CString from Standard;
1002                    AValue   : Boolean from Standard );
1003
1004     PrintCGroup ( me;
1005                   ACGroup   : CGroup from Graphic3d;
1006                   AField    : Integer from Standard );
1007
1008     PrintCLight ( me;
1009                   ACLight   : CLight from Graphic3d;
1010                   AField    : Integer from Standard );
1011
1012     PrintCPick ( me;
1013                  ACPick    : CPick from Graphic3d;
1014                  AField    : Integer from Standard );
1015
1016     PrintCPlane ( me;
1017                   ACPlane   : CPlane from Graphic3d;
1018                   AField    : Integer from Standard );
1019
1020     PrintCStructure ( me;
1021                       ACStructure   : CStructure from Graphic3d;
1022                       AField    : Integer from Standard );
1023
1024     PrintCView ( me;
1025                  ACView : CView from Graphic3d;
1026                  AField : Integer from Standard );
1027
1028     PrintFunction ( me;
1029                     AFunc   : CString from Standard );
1030
1031     PrintInteger ( me;
1032                    AComment  : CString from Standard;
1033                    AValue    : Integer from Standard );
1034
1035     PrintIResult ( me;
1036                    AFunc    : CString from Standard;
1037                    AResult  : Integer from Standard );
1038
1039     PrintShortReal ( me;
1040                      AComment   : CString from Standard;
1041                      AValue     : ShortReal from Standard );
1042
1043     PrintMatrix ( me;
1044                   AComment  : CString from Standard;
1045                   AMatrix   : Array2OfReal from TColStd )
1046         raises TransformError from Graphic3d;
1047
1048     PrintString ( me;
1049                   AComment  : CString from Standard;
1050                   AString   : CString from Standard );
1051
1052     SetTrace ( me       : mutable;
1053                ALevel   : Integer from Standard )
1054         is static;
1055
1056     Trace ( me )
1057         returns Integer from Standard
1058         is static;
1059
1060     --ListOfAvalableFontNames( me;
1061     --           lst: out NListOfHAsciiString from Graphic3d )
1062     --           returns Boolean from Standard
1063     --           is deferred;
1064     --  Purpose:  Initialize list of names of avalable system fonts
1065     --            returns Standard_False if fails
1066     --  ABD Integration support of system fonts (using FTGL and FreeType)
1067
1068     GetDisplayConnection (me)
1069        returns DisplayConnection_Handle from Aspect;
1070     ---C++: return const &
1071
1072     ---Purpose: returns Handle to display connection
1073
1074 fields
1075
1076     MyTraceLevel       : Integer from Standard is protected;
1077     MySharedLibrary    : SharedLibrary from OSD is protected;
1078     myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
1079
1080 end GraphicDriver from Graphic3d;