1 -- Created on: 1997-01-28
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
21 -- Modified: 01/08/97 ; PCT : ajout texture mapping
22 -- 07/08/97 ; PCT : ajout texture environnante
23 -- 27/08/97 ; PCT : ajout coordonnee texture
24 -- 00/11/97 ; CAL : retrait de la dependance avec math
25 -- 00/11/97 ; CAL : ajout polyline par 2 points
26 -- 16-09-98 ; BGN : Points d'entree du Triedre (S3819, Phase 1)
27 -- 22-09-98 ; BGN : S3989 (anciennement S3819)
28 -- TypeOfTriedron* from Aspect(et pas Graphic3d)
29 -- 03-11-98 ; CAL : Introduction de Visual3d_LayerManager.
30 -- 07-10-99 : EUG : Degeneration support (G003)
31 -- Add DegenerateStructure() and
32 -- SetBackFacingModel() methods.
33 -- 10-11-99 ; GG : PRO19603 Change Redraw( ) method
34 -- 16-06-2000 : ATS,GG : G005 - method PrimitiveArray, which are interface of OpenGl
35 -- package, and used to initialize internal fields
36 -- of primitives (Convert high level data to internal presentation).
37 -- 17/08/00 ; THA ; Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
38 -- -> Add Print methods (works only under Windows).
39 -- 27/03/02 ; GG ; RIC120302 Add new method Begin(Aspect_Display)
40 -- 28/05/02 ; VSV : New trihedron
41 -- 23/12/02 ; SAV : Added methods to set background image and its
43 -- 20/01/09 ; ABD : Integration support of system fonts (using FTGL and FreeType)
45 deferred class GraphicDriver from Graphic3d inherits GraphicDriver from Aspect
49 ---Purpose: This class allows the definition of a graphic driver
50 -- (currently only OpenGl driver is used).
59 SharedLibrary from OSD,
61 Array1OfInteger from TColStd,
62 Array1OfReal from TColStd,
63 Array2OfReal from TColStd,
65 AsciiString from TCollection,
66 ExtendedString from TCollection,
68 NameOfColor from Quantity,
71 PlaneAngle from Quantity,
73 AlienImage from AlienImage,
76 Array1OfEdge from Aspect,
78 GraphicDriver from Aspect,
79 TypeOfTriedronEcho from Aspect,
80 TypeOfTriedronPosition from Aspect,
83 PrintAlgo from Aspect,
85 AspectLine3d from Graphic3d,
86 AspectMarker3d from Graphic3d,
87 AspectText3d from Graphic3d,
88 AspectFillArea3d from Graphic3d,
89 HorizontalTextAlignment from Graphic3d,
90 CBitFields20 from Graphic3d,
91 CGroup from Graphic3d,
92 CLight from Graphic3d,
94 CPlane from Graphic3d,
95 CStructure from Graphic3d,
97 BufferType from Graphic3d,
98 Structure from Graphic3d,
99 TextPath from Graphic3d,
100 TypeOfComposition from Graphic3d,
101 TypeOfPolygon from Graphic3d,
102 TypeOfPrimitive from Graphic3d,
103 Vector from Graphic3d,
104 Array1OfVertex from Graphic3d,
105 Array2OfVertex from Graphic3d,
106 Vertex from Graphic3d,
107 Array1OfVertexC from Graphic3d,
108 Array2OfVertexC from Graphic3d,
109 VertexC from Graphic3d,
110 Array1OfVertexN from Graphic3d,
111 Array2OfVertexN from Graphic3d,
112 VertexN from Graphic3d,
113 Array1OfVertexNC from Graphic3d,
114 Array2OfVertexNC from Graphic3d,
115 VertexNC from Graphic3d,
116 VerticalTextAlignment from Graphic3d,
117 CInitTexture from Graphic3d,
118 TypeOfTexture from Graphic3d,
119 VertexNT from Graphic3d,
120 Array1OfVertexNT from Graphic3d,
121 Array2OfVertexNT from Graphic3d,
122 PrimitiveArray from Graphic3d,
123 PtrFrameBuffer from Graphic3d,
124 HArray1OfByte from TColStd,
125 FillMethod from Aspect,
126 GradientFillMethod from Aspect,
127 ExportFormat from Graphic3d,
128 SortType from Graphic3d,
129 HArray1OfReal from TColStd,
130 CUserDraw from Graphic3d,
131 NListOfHAsciiString from Graphic3d,
132 FontAspect from Font,
133 CGraduatedTrihedron from Graphic3d
137 TransformError from Graphic3d
140 Initialize ( AShrName : CString from Standard )
141 returns mutable GraphicDriver from Graphic3d;
143 ---Purpose: Initialises the Driver
145 -------------------------
146 -- Category: Init methods
147 -------------------------
149 Begin ( me : mutable;
150 ADisplay : CString from Standard )
151 returns Boolean from Standard
153 ---Purpose: call_togl_begin
155 Begin ( me : mutable;
156 ADisplay : Display from Aspect )
157 returns Boolean from Standard
159 ---Purpose: call_togl_begin_display
163 ---Purpose: call_togl_end
165 ----------------------------
166 -- Category: Inquire methods
167 ----------------------------
169 InquireLightLimit ( me : mutable )
170 returns Integer from Standard
172 ---Purpose: call_togl_inquirelight
174 InquireMat ( me : mutable;
175 ACView : CView from Graphic3d;
176 AMatO : out Array2OfReal from TColStd;
177 AMatM : out Array2OfReal from TColStd )
179 ---Purpose: call_togl_inquiremat
181 InquirePlaneLimit ( me : mutable )
182 returns Integer from Standard
184 ---Purpose: call_togl_inquireplane
186 InquireViewLimit ( me : mutable )
187 returns Integer from Standard
189 ---Purpose: call_togl_inquireview
191 ------------------------------
192 -- Category: Highlight methods
193 ------------------------------
195 Blink ( me : mutable;
196 ACStructure : CStructure from Graphic3d;
197 Create : Boolean from Standard )
199 ---Purpose: call_togl_blink
201 BoundaryBox ( me : mutable;
202 ACStructure : CStructure from Graphic3d;
203 Create : Boolean from Standard )
205 ---Purpose: call_togl_boundarybox
207 HighlightColor ( me : mutable;
208 ACStructure : CStructure from Graphic3d;
209 R : ShortReal from Standard;
210 G : ShortReal from Standard;
211 B : ShortReal from Standard;
212 Create : Boolean from Standard )
214 ---Purpose: call_togl_highlightcolor
216 NameSetStructure ( me : mutable;
217 ACStructure : CStructure from Graphic3d )
219 ---Purpose: call_togl_namesetstructure
221 -------------------------------------
222 -- Category: Group management methods
223 -------------------------------------
225 ClearGroup ( me : mutable;
226 ACGroup : CGroup from Graphic3d )
228 ---Purpose: call_togl_cleargroup
230 CloseGroup ( me : mutable;
231 ACGroup : CGroup from Graphic3d )
233 ---Purpose: call_togl_closegroup
235 FaceContextGroup ( me : mutable;
236 ACGroup : CGroup from Graphic3d;
237 NoInsert : Integer from Standard )
239 ---Purpose: call_togl_facecontextgroup
241 Group ( me : mutable;
242 ACGroup : in out CGroup from Graphic3d )
244 ---Purpose: call_togl_group
246 LineContextGroup ( me : mutable;
247 ACGroup : CGroup from Graphic3d;
248 NoInsert : Integer from Standard )
250 ---Purpose: call_togl_linecontextgroup
252 MarkerContextGroup ( me : mutable;
253 ACGroup : CGroup from Graphic3d;
254 NoInsert : Integer from Standard )
256 ---Purpose: call_togl_markercontextgroup
258 MarkerContextGroup ( me : mutable;
259 ACGroup : CGroup from Graphic3d;
260 NoInsert : Integer from Standard;
261 AMarkWidth : Integer from Standard;
262 AMarkHeight: Integer from Standard;
263 ATexture : HArray1OfByte from TColStd )
265 ---Purpose: call_togl_markercontextgroup
267 OpenGroup ( me : mutable;
268 ACGroup : CGroup from Graphic3d )
270 ---Purpose: call_togl_opengroup
272 RemoveGroup ( me : mutable;
273 ACGroup : CGroup from Graphic3d )
275 ---Purpose: call_togl_removegroup
277 TextContextGroup ( me : mutable;
278 ACGroup : CGroup from Graphic3d;
279 NoInsert : Integer from Standard )
281 ---Purpose: call_togl_textcontextgroup
283 -----------------------------------------
284 -- Category: Structure management methods
285 -----------------------------------------
287 ClearStructure ( me : mutable;
288 ACStructure : CStructure from Graphic3d )
290 ---Purpose: call_togl_clearstructure
292 Connect ( me : mutable;
293 AFather : CStructure from Graphic3d;
294 ASon : CStructure from Graphic3d )
296 ---Purpose: call_togl_connect
298 ContextStructure ( me : mutable;
299 ACStructure : CStructure from Graphic3d )
301 ---Purpose: call_togl_contextstructure
303 Disconnect ( me : mutable;
304 AFather : CStructure from Graphic3d;
305 ASon : CStructure from Graphic3d )
307 ---Purpose: call_togl_disconnect
309 DisplayStructure ( me : mutable;
310 ACView : CView from Graphic3d;
311 ACStructure : CStructure from Graphic3d;
312 APriority : Integer from Standard )
314 ---Purpose: call_togl_displaystructure
316 EraseStructure ( me : mutable;
317 ACView : CView from Graphic3d;
318 ACStructure : CStructure from Graphic3d )
320 ---Purpose: call_togl_erasestructure
322 RemoveStructure ( me : mutable;
323 ACStructure : CStructure from Graphic3d )
325 ---Purpose: call_togl_removestructure
327 Structure ( me : mutable;
328 ACStructure : in out CStructure from Graphic3d )
330 ---Purpose: call_togl_structure
332 ------------------------------------
333 -- Category: Structured mode methods
334 ------------------------------------
336 ActivateView ( me : mutable;
337 ACView : CView from Graphic3d )
339 ---Purpose: call_togl_activateview
341 AntiAliasing ( me : mutable;
342 ACView : CView from Graphic3d;
343 AFlag : Boolean from Standard )
345 ---Purpose: call_togl_antialiasing
347 Background ( me : mutable;
348 ACView : CView from Graphic3d )
350 ---Purpose: call_togl_background
352 GradientBackground ( me : mutable;
353 ACView : CView from Graphic3d;
354 AColor1: Color from Quantity;
355 AColor2: Color from Quantity;
356 FillStyle : GradientFillMethod from Aspect
359 ---Purpose: call_togl_gradient_background
362 BackgroundImage( me : mutable;
363 FileName : CString from Standard;
364 ACView : CView from Graphic3d;
365 FillStyle : FillMethod from Aspect )
368 SetBgImageStyle( me : mutable;
369 ACView : CView from Graphic3d;
370 FillStyle : FillMethod from Aspect )
373 SetBgGradientStyle( me : mutable;
374 ACView : CView from Graphic3d;
375 FillStyle : GradientFillMethod from Aspect )
378 ClipLimit ( me : mutable;
379 ACView : CView from Graphic3d;
380 AWait : Boolean from Standard )
382 ---Purpose: call_togl_cliplimit
384 DeactivateView ( me : mutable;
385 ACView : CView from Graphic3d )
387 ---Purpose: call_togl_deactivateview
389 DepthCueing ( me : mutable;
390 ACView : CView from Graphic3d;
391 AFlag : Boolean from Standard )
393 ---Purpose: call_togl_cliplimit
395 ProjectRaster ( me : mutable;
396 ACView : CView from Graphic3d;
397 AX : ShortReal from Standard;
398 AY : ShortReal from Standard;
399 AZ : ShortReal from Standard;
400 AU : out Integer from Standard;
401 AV : out Integer from Standard )
402 returns Boolean from Standard
404 ---Purpose: call_togl_unproject_raster
406 UnProjectRaster ( me : mutable;
407 ACView : CView from Graphic3d;
408 Axm : Integer from Standard;
409 Aym : Integer from Standard;
410 AXM : Integer from Standard;
411 AYM : Integer from Standard;
412 AU : Integer from Standard;
413 AV : Integer from Standard;
414 AX : out ShortReal from Standard;
415 AY : out ShortReal from Standard;
416 AZ : out ShortReal from Standard )
417 returns Boolean from Standard
419 ---Purpose: call_togl_unproject_raster
421 UnProjectRasterWithRay ( me : mutable;
422 ACView : CView from Graphic3d;
423 Axm : Integer from Standard;
424 Aym : Integer from Standard;
425 AXM : Integer from Standard;
426 AYM : Integer from Standard;
427 AU : Integer from Standard;
428 AV : Integer from Standard;
429 AX : out ShortReal from Standard;
430 AY : out ShortReal from Standard;
431 AZ : out ShortReal from Standard;
432 DX : out ShortReal from Standard;
433 DY : out ShortReal from Standard;
434 DZ : out ShortReal from Standard )
435 returns Boolean from Standard
437 ---Purpose: call_togl_unproject_raster_with_ray
439 RatioWindow ( me : mutable;
440 ACView : CView from Graphic3d )
442 ---Purpose: call_togl_ratio_window
444 Redraw ( me : mutable;
445 ACView : CView from Graphic3d;
446 ACUnderLayer : CLayer2d from Aspect;
447 ACOverLayer : CLayer2d from Aspect;
451 height : Integer = 0 )
453 ---Purpose: call_togl_redraw
454 -- Warning: when the redraw area has a null size, the full view is redrawn
456 RemoveView ( me : mutable;
457 ACView : CView from Graphic3d )
459 ---Purpose: call_togl_removeview
461 SetLight ( me : mutable;
462 ACView : CView from Graphic3d )
464 ---Purpose: call_togl_setlight
466 SetPlane ( me : mutable;
467 ACView : CView from Graphic3d )
469 ---Purpose: call_togl_setplane
471 SetVisualisation ( me : mutable;
472 ACView : CView from Graphic3d )
474 ---Purpose: call_togl_setvisualisation
476 TransformStructure ( me : mutable;
477 ACStructure : CStructure from Graphic3d )
479 ---Purpose: call_togl_transformstructure
481 DegenerateStructure ( me : mutable;
482 ACStructure : CStructure from Graphic3d )
484 ---Purpose: call_togl_degeneratestructure
486 Transparency ( me : mutable;
487 ACView : CView from Graphic3d;
488 AFlag : Boolean from Standard )
490 ---Purpose: call_togl_transparency
492 Update ( me : mutable;
493 ACView : CView from Graphic3d;
494 ACUnderLayer : CLayer2d from Aspect;
495 ACOverLayer : CLayer2d from Aspect )
497 ---Purpose: call_togl_update
500 ACView : in out CView from Graphic3d )
501 returns Boolean from Standard
503 ---Purpose: call_togl_view
505 ViewMapping ( me : mutable;
506 ACView : CView from Graphic3d;
507 AWait : Boolean from Standard )
509 ---Purpose: call_togl_viewmapping
511 ViewOrientation ( me : mutable;
512 ACView : CView from Graphic3d;
513 AWait : Boolean from Standard )
515 ---Purpose: call_togl_vieworientation
517 Environment ( me : mutable;
518 ACView : CView from Graphic3d )
522 ----------------------------------------
523 -- Category: Methods to create Marker
524 -- for Purpose : see Graphic3d_Group.cdl
525 ----------------------------------------
527 Marker ( me : mutable;
528 ACGroup : CGroup from Graphic3d;
529 APoint : Vertex from Graphic3d;
530 EvalMinMax : Boolean from Standard = Standard_True )
533 MarkerSet ( me : mutable;
534 ACGroup : CGroup from Graphic3d;
535 ListVertex : Array1OfVertex from Graphic3d;
536 EvalMinMax : Boolean from Standard = Standard_True )
539 ----------------------------------------
540 -- Category: Methods to create Polygon
541 -- for Purpose : see Graphic3d_Group.cdl
542 ----------------------------------------
544 Polygon ( me : mutable;
545 ACGroup : CGroup from Graphic3d;
546 ListVertex : Array1OfVertex from Graphic3d;
547 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
548 EvalMinMax : Boolean from Standard = Standard_True )
550 ---Purpose: call_togl_polygon
552 ----------------------------------------
553 -- Category: Methods to create Text
554 -- for Purpose : see Graphic3d_Group.cdl
555 ----------------------------------------
558 ACGroup : CGroup from Graphic3d;
559 AText : CString from Standard;
560 APoint : Vertex from Graphic3d;
561 AHeight : Real from Standard;
562 AAngle : PlaneAngle from Quantity;
563 ATp : TextPath from Graphic3d;
564 AHta : HorizontalTextAlignment from Graphic3d;
565 AVta : VerticalTextAlignment from Graphic3d;
566 EvalMinMax : Boolean from Standard = Standard_True )
568 ---Purpose: call_togl_text
571 ACGroup : CGroup from Graphic3d;
572 AText : CString from Standard;
573 APoint : Vertex from Graphic3d;
574 AHeight : Real from Standard;
575 EvalMinMax : Boolean from Standard = Standard_True )
577 ---Purpose: call_togl_text
580 ACGroup : CGroup from Graphic3d;
581 AText : ExtendedString from TCollection;
582 APoint : Vertex from Graphic3d;
583 AHeight : Real from Standard;
584 AAngle : PlaneAngle from Quantity;
585 ATp : TextPath from Graphic3d;
586 AHta : HorizontalTextAlignment from Graphic3d;
587 AVta : VerticalTextAlignment from Graphic3d;
588 EvalMinMax : Boolean from Standard = Standard_True )
590 ---Purpose: call_togl_text
593 ACGroup : CGroup from Graphic3d;
594 AText : ExtendedString from TCollection;
595 APoint : Vertex from Graphic3d;
596 AHeight : Real from Standard;
597 EvalMinMax : Boolean from Standard = Standard_True )
599 ---Purpose: call_togl_text
601 ----------------------------------------
602 ---Category: Methods to create Triangle
603 -- for Purpose : see Graphic3d_Group.cdl
604 ----------------------------------------
606 PrimitiveArray( me : mutable;
607 ACGroup : CGroup from Graphic3d;
608 parray : PrimitiveArray from Graphic3d;
609 EvalMinMax : Boolean from Standard = Standard_True )
611 ---Purpose: call_togl_parray
613 UserDraw( me : mutable;
614 ACGroup : CGroup from Graphic3d;
615 AUserDraw : CUserDraw from Graphic3d )
617 ---Purpose: call_togl_userdraw
619 EnableVBO( me : mutable;
620 status : Boolean from Standard )
622 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
625 theFreeBytes : out Size from Standard;
626 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
627 ---Purpose: Returns information about GPU memory usage.
629 ----------------------------------------
630 ---Category: Methods to create Triedron
631 -- for Purpose : see Graphic3d_Group.cdl
632 ----------------------------------------
634 ZBufferTriedronSetup ( me : mutable;
635 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
636 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
637 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
638 SizeRatio : Real from Standard = 0.8;
639 AxisDiametr : Real from Standard = 0.05;
640 NbFacettes : Integer from Standard = 12)
642 ---Purpose: call_togl_ztriedron_setup
644 TriedronDisplay ( me : mutable;
645 ACView : CView from Graphic3d;
646 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
647 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
648 AScale : Real from Standard = 0.02;
649 AsWireframe : Boolean from Standard = Standard_True )
651 ---Purpose: call_togl_triedron_display
654 TriedronErase ( me : mutable;
655 ACView : CView from Graphic3d)
657 ---Purpose: call_togl_triedron_erase
660 TriedronEcho ( me : mutable;
661 ACView : CView from Graphic3d;
662 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
664 ---Purpose: call_togl_triedron_echo
666 ---------------------------------
667 ---Category: Graduated trihedron
668 ---------------------------------
670 GraduatedTrihedronDisplay(me : mutable;
671 view : CView from Graphic3d;
672 cubic : CGraduatedTrihedron from Graphic3d)
673 ---Purpose: call_togl_graduatedtrihedron_display
676 GraduatedTrihedronErase(me : mutable;
677 view : CView from Graphic3d)
678 ---Purpose: call_togl_graduatedtrihedron_erase
681 GraduatedTrihedronMinMaxValues(me : mutable;
682 xmin : ShortReal from Standard;
683 ymin : ShortReal from Standard;
684 zmin : ShortReal from Standard;
685 xmax : ShortReal from Standard;
686 ymax : ShortReal from Standard;
687 zmax : ShortReal from Standard)
688 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
691 ---------------------------
692 -- Category: Animation mode
693 ---------------------------
695 BeginAnimation ( me : mutable;
696 ACView : CView from Graphic3d)
698 ---Purpose: call_togl_begin_animation
700 EndAnimation ( me : mutable;
701 ACView : CView from Graphic3d)
703 ---Purpose: call_togl_end_animation
705 ----------------------------------
706 -- Category: Ajout mode methods
707 ----------------------------------
709 BeginAddMode ( me : mutable;
710 ACView : CView from Graphic3d)
711 returns Boolean from Standard
713 ---Purpose: call_togl_begin_ajout_mode
715 EndAddMode ( me : mutable)
717 ---Purpose: call_togl_end_ajout_mode
719 ----------------------------------
720 -- Category: Immediat mode methods
721 ----------------------------------
723 BeginImmediatMode ( me : mutable;
724 ACView : CView from Graphic3d;
725 ACUnderLayer : CLayer2d from Aspect;
726 ACOverLayer : CLayer2d from Aspect;
727 DoubleBuffer : Boolean from Standard;
728 RetainMode : Boolean from Standard)
729 returns Boolean from Standard
731 ---Purpose: call_togl_begin_immediat_mode
733 BeginPolyline ( me : mutable )
735 ---Purpose: call_togl_begin_polyline
737 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
738 aFlush : Boolean from Standard = Standard_True)
740 ---Purpose: call_togl_clear_immediat_mode
743 X : ShortReal from Standard;
744 Y : ShortReal from Standard;
745 Z : ShortReal from Standard )
747 ---Purpose: call_togl_draw
749 DrawStructure ( me : mutable;
750 ACStructure : CStructure from Graphic3d )
752 ---Purpose: call_togl_draw_structure
754 EndImmediatMode ( me : mutable;
755 Synchronize : Integer from Standard )
757 ---Purpose: call_togl_end_immediat_mode
759 EndPolyline ( me : mutable )
761 ---Purpose: call_togl_end_polyline
764 X : ShortReal from Standard;
765 Y : ShortReal from Standard;
766 Z : ShortReal from Standard )
768 ---Purpose: call_togl_move
770 SetLineColor ( me : mutable;
771 R : ShortReal from Standard;
772 G : ShortReal from Standard;
773 B : ShortReal from Standard )
775 ---Purpose: call_togl_set_linecolor
777 SetLineType ( me : mutable;
778 Type : Integer from Standard )
780 ---Purpose: call_togl_set_linetype
782 SetLineWidth ( me : mutable;
783 Width : ShortReal from Standard )
785 ---Purpose: call_togl_set_linewidth
787 SetMinMax ( me : mutable;
788 X1 : ShortReal from Standard;
789 Y1 : ShortReal from Standard;
790 Z1 : ShortReal from Standard;
791 X2 : ShortReal from Standard;
792 Y2 : ShortReal from Standard;
793 Z2 : ShortReal from Standard )
795 ---Purpose: call_togl_set_minmax
797 Transform ( me : mutable;
798 AMatrix : Array2OfReal from TColStd;
799 AType : TypeOfComposition from Graphic3d )
801 ---Purpose: call_togl_transform
803 -----------------------------
804 -- Category: Textures methods
805 -----------------------------
808 theType : TypeOfTexture from Graphic3d;
809 theImage : PixMap from Image;
810 theFileName : CString from Standard;
811 theTexUpperBounds : HArray1OfReal from TColStd )
812 returns Integer from Standard
817 TexId : Integer from Standard )
822 TexId : Integer from Standard;
823 AValue : CInitTexture from Graphic3d )
827 -------------------------------
828 -- Category: Layer mode methods
829 -------------------------------
831 Layer ( me : mutable;
832 ACLayer : in out CLayer2d from Aspect )
834 ---Purpose: call_togl_layer2d
836 RemoveLayer ( me : mutable;
837 ACLayer : CLayer2d from Aspect )
839 ---Purpose: call_togl_removelayer2d
841 BeginLayer ( me : mutable;
842 ACLayer : CLayer2d from Aspect )
844 ---Purpose: call_togl_begin_layer2d
846 BeginPolygon2d ( me : mutable )
848 ---Purpose: call_togl_begin_polygon2d
850 BeginPolyline2d ( me : mutable )
852 ---Purpose: call_togl_begin_polyline2d
854 ClearLayer ( me : mutable;
855 ACLayer : CLayer2d from Aspect )
857 ---Purpose: call_togl_clear_layer2d
860 X : ShortReal from Standard;
861 Y : ShortReal from Standard )
863 ---Purpose: call_togl_draw2d
866 X : ShortReal from Standard;
867 Y : ShortReal from Standard )
869 ---Purpose: call_togl_edge2d
871 EndLayer ( me : mutable )
873 ---Purpose: call_togl_end_layer2d
875 EndPolygon2d ( me : mutable )
877 ---Purpose: call_togl_end_polygon2d
879 EndPolyline2d ( me : mutable )
881 ---Purpose: call_togl_end_polyline2d
884 X : ShortReal from Standard;
885 Y : ShortReal from Standard )
887 ---Purpose: call_togl_move2d
889 Rectangle ( me : mutable;
890 X, Y : ShortReal from Standard;
891 Width, Height : ShortReal from Standard )
893 ---Purpose: call_togl_rectangle2d
895 SetColor ( me : mutable;
896 R : ShortReal from Standard;
897 G : ShortReal from Standard;
898 B : ShortReal from Standard )
900 ---Purpose: call_togl_set_color
902 SetTransparency ( me : mutable;
903 ATransparency : ShortReal from Standard )
905 ---Purpose: call_togl_set_transparency
907 UnsetTransparency ( me : mutable )
909 ---Purpose: call_togl_unset_transparency
911 SetLineAttributes ( me : mutable;
912 Type : Integer from Standard;
913 Width : ShortReal from Standard )
915 ---Purpose: call_togl_set_line_attributes
918 SetTextAttributes ( me : mutable;
919 Font : CString from Standard;
920 Type : Integer from Standard;
921 R : ShortReal from Standard;
922 G : ShortReal from Standard;
923 B : ShortReal from Standard )
925 ---Purpose: Set text attributes for under-/overlayer.
926 -- <Font> argument defines the name of the font to be used,
927 -- <Type> argument defines the display type of the text,
928 -- <R> <G> <B> values define the color of decal or subtitle background.
929 -- To set the color of the text you can use the SetColor method.
932 AText : CString from Standard;
933 X, Y : ShortReal from Standard;
934 AHeight : ShortReal from Standard )
936 ---Purpose: call_togl_text2d
937 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
939 DefaultTextHeight( me )
940 returns ShortReal from Standard
945 AText : CString from Standard;
946 AHeight : ShortReal from Standard;
947 AWidth : in out ShortReal from Standard;
948 AnAscent : in out ShortReal from Standard;
949 ADescent : in out ShortReal from Standard )
951 ---Purpose: call_togl_textsize2d
953 SetBackFacingModel ( me : mutable;
954 aView : CView from Graphic3d )
956 ---Purpose: call_togl_backfacing
958 SetDepthTestEnabled( me; view : CView from Graphic3d;
959 isEnabled : Boolean from Standard )
961 ---Purpose: call_togl_depthtest
963 IsDepthTestEnabled( me; view : CView from Graphic3d )
964 returns Boolean from Standard is deferred;
965 ---Purpose: call_togl_isdepthtest
968 view : CView from Graphic3d;
970 width, height : Integer;
973 ---Purpose: Reads depths of shown pixels of the given
974 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
976 FBOCreate( me : mutable;
977 view : CView from Graphic3d;
978 width, height : Integer from Standard )
979 returns PtrFrameBuffer from Graphic3d
981 ---Purpose: Generate offscreen FBO in the graphic library.
982 -- If not supported on hardware returns NULL.
984 FBORelease( me : mutable;
985 view : CView from Graphic3d;
986 fboPtr : in out PtrFrameBuffer from Graphic3d )
988 ---Purpose: Remove offscreen FBO from the graphic library
990 FBOGetDimensions( me : mutable;
991 view : CView from Graphic3d;
992 fboPtr : PtrFrameBuffer from Graphic3d;
993 width, height : out Integer from Standard;
994 widthMax, heightMax : out Integer from Standard )
996 ---Purpose: Read offscreen FBO configuration.
998 FBOChangeViewport( me : mutable;
999 view : CView from Graphic3d;
1000 fboPtr : in out PtrFrameBuffer from Graphic3d;
1001 width, height : Integer from Standard )
1003 ---Purpose: Change offscreen FBO viewport.
1005 BufferDump( me : mutable;
1006 theCView : CView from Graphic3d;
1007 theImage : in out PixMap from Image;
1008 theBufferType : BufferType from Graphic3d )
1009 returns Boolean from Standard
1011 ---Purpose: Dump active rendering buffer into specified memory buffer.
1013 SetGLLightEnabled( me; view : CView from Graphic3d;
1014 isEnabled : Boolean from Standard )
1016 ---Purpose: call_togl_gllight
1018 IsGLLightEnabled( me; view : CView from Graphic3d )
1019 returns Boolean from Standard is deferred;
1020 ---Purpose: call_togl_isgllight
1023 ACView : CView from Graphic3d;
1024 ACUnderLayer : CLayer2d from Aspect;
1025 ACOverLayer : CLayer2d from Aspect;
1026 hPrnDC : Handle from Aspect;
1027 showBackground : Boolean;
1029 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1030 theScaleFactor : Real from Standard = 1.0 )
1031 returns Boolean from Standard is deferred;
1033 ---Purpose: print the contents of all layers of the view to the printer.
1034 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1035 -- <showBackground> : When set to FALSE then print the view without background color
1036 -- (background is white)
1037 -- else set to TRUE for printing with current background color.
1038 -- <filename>: If != NULL, then the view will be printed to a file.
1039 -- <printAlgorithm>: Select print algorithm: stretch, tile.
1040 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1041 -- printings accordingly to the scale factor selected in the printer
1042 -- properties dialog.
1043 -- Returns Standard_True if the data is passed to the printer, otherwise
1044 -- Standard_False if the print operation failed due to the printer errors,
1045 -- or insufficient system memory available.
1046 ---Warning: Works only under Windows.
1048 Export( me: mutable;
1049 theFileName : CString from Standard;
1050 theFormat : ExportFormat from Graphic3d;
1051 theSortType : SortType from Graphic3d;
1052 theWidth, theHeight : Integer from Standard;
1053 theView : CView from Graphic3d;
1054 theLayerUnder : CLayer2d from Aspect;
1055 theLayerOver : CLayer2d from Aspect;
1056 thePrecision : Real from Standard = 0.005;
1057 theProgressBarFunc : Address from Standard = NULL;
1058 theProgressObject : Address from Standard = NULL )
1059 returns Boolean from Standard
1062 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1063 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1064 -- Notice however that results may differ a lot and do not contain some elements.
1066 RemovePrimitiveArray( me : mutable;
1067 theCGroup : CGroup from Graphic3d;
1068 thePArray : PrimitiveArray from Graphic3d )
1070 ---Purpose: Clear visualization data in graphical driver and
1071 -- stop displaying the primitives array of the graphical group
1072 -- <theCGroup>. This method is internal and should be used
1073 -- by Graphic3d_Group only.
1075 AddZLayer( me : mutable;
1076 theCView : CView from Graphic3d;
1077 theLayerId : Integer from Standard )
1079 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
1080 -- the view. Z layers allow drawing structures in higher layers
1081 -- in foreground of structures in lower layers. To add a structure
1082 -- to desired layer on display it is necessary to set the layer
1083 -- ID for the structure.
1085 RemoveZLayer( me : mutable;
1086 theCView : CView from Graphic3d;
1087 theLayerId : Integer from Standard )
1089 ---Purpose: Remove Z layer from the specified view. All structures
1090 -- displayed at the moment in layer will be displayed in default layer
1091 -- ( the bottom-level z layer ). To unset layer ID from associated
1092 -- structures use method UnsetZLayer (...).
1094 UnsetZLayer( me : mutable;
1095 theLayerId : Integer from Standard )
1097 ---Purpose: Unset Z layer ID for all structures. The structure
1098 -- indexes will be set to default layer ( the bottom-level z layer
1101 ChangeZLayer( me : mutable;
1102 theCStructure : CStructure from Graphic3d;
1103 theLayerId : Integer from Standard )
1105 ---Purpose: Change Z layer of a structure. The new z layer ID will
1106 -- be used to define the associated layer for structure on display.
1108 ChangeZLayer( me : mutable;
1109 theCStructure : CStructure from Graphic3d;
1110 theCView : CView from Graphic3d;
1111 theNewLayerId : Integer from Standard )
1113 ---Purpose: Change Z layer of a structure already presented in view.
1116 theCStructure : CStructure from Graphic3d )
1117 returns Integer from Standard is deferred;
1118 ---Purpose: Get Z layer ID of structure. If the structure doesn't
1119 -- exists in graphic driver, the method returns -1.
1121 --------------------------
1122 -- Category: Class methods
1123 --------------------------
1126 ACLight : CLight from Graphic3d;
1127 Update : Boolean from Standard )
1128 returns Integer from Standard;
1129 ---Purpose: call_togl_light
1132 ACPlane : CPlane from Graphic3d;
1133 Update : Boolean from Standard )
1134 returns Integer from Standard;
1135 ---Purpose: call_togl_plane
1137 -----------------------------
1138 -- Category: Internal methods
1139 -----------------------------
1142 AComment : CString from Standard;
1143 AValue : Boolean from Standard );
1146 ACGroup : CGroup from Graphic3d;
1147 AField : Integer from Standard );
1150 ACLight : CLight from Graphic3d;
1151 AField : Integer from Standard );
1154 ACPick : CPick from Graphic3d;
1155 AField : Integer from Standard );
1158 ACPlane : CPlane from Graphic3d;
1159 AField : Integer from Standard );
1161 PrintCStructure ( me;
1162 ACStructure : CStructure from Graphic3d;
1163 AField : Integer from Standard );
1166 ACView : CView from Graphic3d;
1167 AField : Integer from Standard );
1170 AFunc : CString from Standard );
1173 AComment : CString from Standard;
1174 AValue : Integer from Standard );
1177 AFunc : CString from Standard;
1178 AResult : Integer from Standard );
1180 PrintShortReal ( me;
1181 AComment : CString from Standard;
1182 AValue : ShortReal from Standard );
1185 AComment : CString from Standard;
1186 AMatrix : Array2OfReal from TColStd )
1187 raises TransformError from Graphic3d;
1190 AComment : CString from Standard;
1191 AString : CString from Standard );
1193 SetTrace ( me : mutable;
1194 ALevel : Integer from Standard )
1198 returns Integer from Standard
1201 --ListOfAvalableFontNames( me;
1202 -- lst: out NListOfHAsciiString from Graphic3d )
1203 -- returns Boolean from Standard
1205 -- Purpose: Initialize list of names of avalable system fonts
1206 -- returns Standard_False if fails
1207 -- ABD Integration support of system fonts (using FTGL and FreeType)
1211 MyTraceLevel : Integer from Standard is protected;
1212 MySharedLibrary : SharedLibrary from OSD is protected;
1214 end GraphicDriver from Graphic3d;