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 ExtendedString from TCollection,
67 NameOfColor from Quantity,
70 PlaneAngle from Quantity,
72 AlienImage from AlienImage,
74 Array1OfEdge from Aspect,
76 GraphicDriver from Aspect,
77 TypeOfTriedronEcho from Aspect,
78 TypeOfTriedronPosition from Aspect,
81 PrintAlgo from Aspect,
83 AspectLine3d from Graphic3d,
84 AspectMarker3d from Graphic3d,
85 AspectText3d from Graphic3d,
86 AspectFillArea3d from Graphic3d,
87 HorizontalTextAlignment from Graphic3d,
88 CBitFields20 from Graphic3d,
89 CGroup from Graphic3d,
90 CLight from Graphic3d,
92 CPlane from Graphic3d,
93 CStructure from Graphic3d,
95 CRawBufferData from Image,
96 Structure from Graphic3d,
97 TextPath from Graphic3d,
98 TypeOfComposition from Graphic3d,
99 TypeOfPolygon from Graphic3d,
100 TypeOfPrimitive from Graphic3d,
101 Vector from Graphic3d,
102 Array1OfVertex from Graphic3d,
103 Array2OfVertex from Graphic3d,
104 Vertex from Graphic3d,
105 Array1OfVertexC from Graphic3d,
106 Array2OfVertexC from Graphic3d,
107 VertexC from Graphic3d,
108 Array1OfVertexN from Graphic3d,
109 Array2OfVertexN from Graphic3d,
110 VertexN from Graphic3d,
111 Array1OfVertexNC from Graphic3d,
112 Array2OfVertexNC from Graphic3d,
113 VertexNC from Graphic3d,
114 VerticalTextAlignment from Graphic3d,
115 CInitTexture from Graphic3d,
116 TypeOfTexture from Graphic3d,
117 VertexNT from Graphic3d,
118 Array1OfVertexNT from Graphic3d,
119 Array2OfVertexNT from Graphic3d,
120 PrimitiveArray from Graphic3d,
121 PtrFrameBuffer from Graphic3d,
122 HArray1OfByte from TColStd,
123 FillMethod from Aspect,
124 GradientFillMethod from Aspect,
125 ExportFormat from Graphic3d,
126 SortType from Graphic3d,
127 HArray1OfReal from TColStd,
128 CUserDraw from Graphic3d,
129 NListOfHAsciiString from Graphic3d,
131 CGraduatedTrihedron from Graphic3d
135 TransformError from Graphic3d
138 Initialize ( AShrName : CString from Standard )
139 returns mutable GraphicDriver from Graphic3d;
141 ---Purpose: Initialises the Driver
143 -------------------------
144 -- Category: Init methods
145 -------------------------
147 Begin ( me : mutable;
148 ADisplay : CString from Standard )
149 returns Boolean from Standard
151 ---Purpose: call_togl_begin
153 Begin ( me : mutable;
154 ADisplay : Display from Aspect )
155 returns Boolean from Standard
157 ---Purpose: call_togl_begin_display
161 ---Purpose: call_togl_end
163 ----------------------------
164 -- Category: Inquire methods
165 ----------------------------
167 InquireLightLimit ( me : mutable )
168 returns Integer from Standard
170 ---Purpose: call_togl_inquirelight
172 InquireMat ( me : mutable;
173 ACView : CView from Graphic3d;
174 AMatO : out Array2OfReal from TColStd;
175 AMatM : out Array2OfReal from TColStd )
177 ---Purpose: call_togl_inquiremat
179 InquirePlaneLimit ( me : mutable )
180 returns Integer from Standard
182 ---Purpose: call_togl_inquireplane
184 InquireViewLimit ( me : mutable )
185 returns Integer from Standard
187 ---Purpose: call_togl_inquireview
189 InquireTextureAvailable ( me : mutable )
190 returns Boolean from Standard
192 ---Purpose: Returns Standard_True if texture is
193 -- supported by the graphic driver
195 ------------------------------
196 -- Category: Highlight methods
197 ------------------------------
199 Blink ( me : mutable;
200 ACStructure : CStructure from Graphic3d;
201 Create : Boolean from Standard )
203 ---Purpose: call_togl_blink
205 BoundaryBox ( me : mutable;
206 ACStructure : CStructure from Graphic3d;
207 Create : Boolean from Standard )
209 ---Purpose: call_togl_boundarybox
211 HighlightColor ( me : mutable;
212 ACStructure : CStructure from Graphic3d;
213 R : ShortReal from Standard;
214 G : ShortReal from Standard;
215 B : ShortReal from Standard;
216 Create : Boolean from Standard )
218 ---Purpose: call_togl_highlightcolor
220 NameSetStructure ( me : mutable;
221 ACStructure : CStructure from Graphic3d )
223 ---Purpose: call_togl_namesetstructure
225 -------------------------------------
226 -- Category: Group management methods
227 -------------------------------------
229 ClearGroup ( me : mutable;
230 ACGroup : CGroup from Graphic3d )
232 ---Purpose: call_togl_cleargroup
234 CloseGroup ( me : mutable;
235 ACGroup : CGroup from Graphic3d )
237 ---Purpose: call_togl_closegroup
239 FaceContextGroup ( me : mutable;
240 ACGroup : CGroup from Graphic3d;
241 NoInsert : Integer from Standard )
243 ---Purpose: call_togl_facecontextgroup
245 Group ( me : mutable;
246 ACGroup : in out CGroup from Graphic3d )
248 ---Purpose: call_togl_group
250 LineContextGroup ( me : mutable;
251 ACGroup : CGroup from Graphic3d;
252 NoInsert : Integer from Standard )
254 ---Purpose: call_togl_linecontextgroup
256 MarkerContextGroup ( me : mutable;
257 ACGroup : CGroup from Graphic3d;
258 NoInsert : Integer from Standard )
260 ---Purpose: call_togl_markercontextgroup
262 MarkerContextGroup ( me : mutable;
263 ACGroup : CGroup from Graphic3d;
264 NoInsert : Integer from Standard;
265 AMarkWidth : Integer from Standard;
266 AMarkHeight: Integer from Standard;
267 ATexture : HArray1OfByte from TColStd )
269 ---Purpose: call_togl_markercontextgroup
271 OpenGroup ( me : mutable;
272 ACGroup : CGroup from Graphic3d )
274 ---Purpose: call_togl_opengroup
276 RemoveGroup ( me : mutable;
277 ACGroup : CGroup from Graphic3d )
279 ---Purpose: call_togl_removegroup
281 TextContextGroup ( me : mutable;
282 ACGroup : CGroup from Graphic3d;
283 NoInsert : Integer from Standard )
285 ---Purpose: call_togl_textcontextgroup
287 -----------------------------------------
288 -- Category: Structure management methods
289 -----------------------------------------
291 ClearStructure ( me : mutable;
292 ACStructure : CStructure from Graphic3d )
294 ---Purpose: call_togl_clearstructure
296 Connect ( me : mutable;
297 AFather : CStructure from Graphic3d;
298 ASon : CStructure from Graphic3d )
300 ---Purpose: call_togl_connect
302 ContextStructure ( me : mutable;
303 ACStructure : CStructure from Graphic3d )
305 ---Purpose: call_togl_contextstructure
307 Disconnect ( me : mutable;
308 AFather : CStructure from Graphic3d;
309 ASon : CStructure from Graphic3d )
311 ---Purpose: call_togl_disconnect
313 DisplayStructure ( me : mutable;
314 ACView : CView from Graphic3d;
315 ACStructure : CStructure from Graphic3d;
316 APriority : Integer from Standard )
318 ---Purpose: call_togl_displaystructure
320 EraseStructure ( me : mutable;
321 ACView : CView from Graphic3d;
322 ACStructure : CStructure from Graphic3d )
324 ---Purpose: call_togl_erasestructure
326 RemoveStructure ( me : mutable;
327 ACStructure : CStructure from Graphic3d )
329 ---Purpose: call_togl_removestructure
331 Structure ( me : mutable;
332 ACStructure : in out CStructure from Graphic3d )
334 ---Purpose: call_togl_structure
336 ------------------------------------
337 -- Category: Structured mode methods
338 ------------------------------------
340 ActivateView ( me : mutable;
341 ACView : CView from Graphic3d )
343 ---Purpose: call_togl_activateview
345 AntiAliasing ( me : mutable;
346 ACView : CView from Graphic3d;
347 AFlag : Boolean from Standard )
349 ---Purpose: call_togl_antialiasing
351 Background ( me : mutable;
352 ACView : CView from Graphic3d )
354 ---Purpose: call_togl_background
356 GradientBackground ( me : mutable;
357 ACView : CView from Graphic3d;
358 AColor1: Color from Quantity;
359 AColor2: Color from Quantity;
360 FillStyle : GradientFillMethod from Aspect
363 ---Purpose: call_togl_gradient_background
366 BackgroundImage( me : mutable;
367 FileName : CString from Standard;
368 ACView : CView from Graphic3d;
369 FillStyle : FillMethod from Aspect )
372 SetBgImageStyle( me : mutable;
373 ACView : CView from Graphic3d;
374 FillStyle : FillMethod from Aspect )
377 SetBgGradientStyle( me : mutable;
378 ACView : CView from Graphic3d;
379 FillStyle : GradientFillMethod from Aspect )
382 ClipLimit ( me : mutable;
383 ACView : CView from Graphic3d;
384 AWait : Boolean from Standard )
386 ---Purpose: call_togl_cliplimit
388 DeactivateView ( me : mutable;
389 ACView : CView from Graphic3d )
391 ---Purpose: call_togl_deactivateview
393 DepthCueing ( me : mutable;
394 ACView : CView from Graphic3d;
395 AFlag : Boolean from Standard )
397 ---Purpose: call_togl_cliplimit
399 ProjectRaster ( me : mutable;
400 ACView : CView from Graphic3d;
401 AX : ShortReal from Standard;
402 AY : ShortReal from Standard;
403 AZ : ShortReal from Standard;
404 AU : out Integer from Standard;
405 AV : out Integer from Standard )
406 returns Boolean from Standard
408 ---Purpose: call_togl_unproject_raster
410 UnProjectRaster ( me : mutable;
411 ACView : CView from Graphic3d;
412 Axm : Integer from Standard;
413 Aym : Integer from Standard;
414 AXM : Integer from Standard;
415 AYM : Integer from Standard;
416 AU : Integer from Standard;
417 AV : Integer from Standard;
418 AX : out ShortReal from Standard;
419 AY : out ShortReal from Standard;
420 AZ : out ShortReal from Standard )
421 returns Boolean from Standard
423 ---Purpose: call_togl_unproject_raster
425 UnProjectRasterWithRay ( me : mutable;
426 ACView : CView from Graphic3d;
427 Axm : Integer from Standard;
428 Aym : Integer from Standard;
429 AXM : Integer from Standard;
430 AYM : Integer from Standard;
431 AU : Integer from Standard;
432 AV : Integer from Standard;
433 AX : out ShortReal from Standard;
434 AY : out ShortReal from Standard;
435 AZ : out ShortReal from Standard;
436 DX : out ShortReal from Standard;
437 DY : out ShortReal from Standard;
438 DZ : out ShortReal from Standard )
439 returns Boolean from Standard
441 ---Purpose: call_togl_unproject_raster_with_ray
443 RatioWindow ( me : mutable;
444 ACView : CView from Graphic3d )
446 ---Purpose: call_togl_ratio_window
448 Redraw ( me : mutable;
449 ACView : CView from Graphic3d;
450 ACUnderLayer : CLayer2d from Aspect;
451 ACOverLayer : CLayer2d from Aspect;
455 height : Integer = 0 )
457 ---Purpose: call_togl_redraw
458 -- Warning: when the redraw area has a null size, the full view is redrawn
460 RemoveView ( me : mutable;
461 ACView : CView from Graphic3d )
463 ---Purpose: call_togl_removeview
465 SetLight ( me : mutable;
466 ACView : CView from Graphic3d )
468 ---Purpose: call_togl_setlight
470 SetPlane ( me : mutable;
471 ACView : CView from Graphic3d )
473 ---Purpose: call_togl_setplane
475 SetVisualisation ( me : mutable;
476 ACView : CView from Graphic3d )
478 ---Purpose: call_togl_setvisualisation
480 TransformStructure ( me : mutable;
481 ACStructure : CStructure from Graphic3d )
483 ---Purpose: call_togl_transformstructure
485 DegenerateStructure ( me : mutable;
486 ACStructure : CStructure from Graphic3d )
488 ---Purpose: call_togl_degeneratestructure
490 Transparency ( me : mutable;
491 ACView : CView from Graphic3d;
492 AFlag : Boolean from Standard )
494 ---Purpose: call_togl_transparency
496 Update ( me : mutable;
497 ACView : CView from Graphic3d;
498 ACUnderLayer : CLayer2d from Aspect;
499 ACOverLayer : CLayer2d from Aspect )
501 ---Purpose: call_togl_update
504 ACView : in out CView from Graphic3d )
505 returns Boolean from Standard
507 ---Purpose: call_togl_view
509 ViewMapping ( me : mutable;
510 ACView : CView from Graphic3d;
511 AWait : Boolean from Standard )
513 ---Purpose: call_togl_viewmapping
515 ViewOrientation ( me : mutable;
516 ACView : CView from Graphic3d;
517 AWait : Boolean from Standard )
519 ---Purpose: call_togl_vieworientation
521 Environment ( me : mutable;
522 ACView : CView from Graphic3d )
526 ----------------------------------------
527 -- Category: Methods to create Marker
528 -- for Purpose : see Graphic3d_Group.cdl
529 ----------------------------------------
531 Marker ( me : mutable;
532 ACGroup : CGroup from Graphic3d;
533 APoint : Vertex from Graphic3d;
534 EvalMinMax : Boolean from Standard = Standard_True )
537 MarkerSet ( me : mutable;
538 ACGroup : CGroup from Graphic3d;
539 ListVertex : Array1OfVertex from Graphic3d;
540 EvalMinMax : Boolean from Standard = Standard_True )
543 ----------------------------------------
544 -- Category: Methods to create Polygon
545 -- for Purpose : see Graphic3d_Group.cdl
546 ----------------------------------------
548 Polygon ( me : mutable;
549 ACGroup : CGroup from Graphic3d;
550 ListVertex : Array1OfVertex from Graphic3d;
551 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
552 EvalMinMax : Boolean from Standard = Standard_True )
554 ---Purpose: call_togl_polygon
556 ----------------------------------------
557 -- Category: Methods to create Text
558 -- for Purpose : see Graphic3d_Group.cdl
559 ----------------------------------------
562 ACGroup : CGroup from Graphic3d;
563 AText : CString from Standard;
564 APoint : Vertex from Graphic3d;
565 AHeight : Real from Standard;
566 AAngle : PlaneAngle from Quantity;
567 ATp : TextPath from Graphic3d;
568 AHta : HorizontalTextAlignment from Graphic3d;
569 AVta : VerticalTextAlignment from Graphic3d;
570 EvalMinMax : Boolean from Standard = Standard_True )
572 ---Purpose: call_togl_text
575 ACGroup : CGroup from Graphic3d;
576 AText : CString from Standard;
577 APoint : Vertex from Graphic3d;
578 AHeight : Real from Standard;
579 EvalMinMax : Boolean from Standard = Standard_True )
581 ---Purpose: call_togl_text
584 ACGroup : CGroup from Graphic3d;
585 AText : ExtendedString from TCollection;
586 APoint : Vertex from Graphic3d;
587 AHeight : Real from Standard;
588 AAngle : PlaneAngle from Quantity;
589 ATp : TextPath from Graphic3d;
590 AHta : HorizontalTextAlignment from Graphic3d;
591 AVta : VerticalTextAlignment from Graphic3d;
592 EvalMinMax : Boolean from Standard = Standard_True )
594 ---Purpose: call_togl_text
597 ACGroup : CGroup from Graphic3d;
598 AText : ExtendedString from TCollection;
599 APoint : Vertex from Graphic3d;
600 AHeight : Real from Standard;
601 EvalMinMax : Boolean from Standard = Standard_True )
603 ---Purpose: call_togl_text
605 ----------------------------------------
606 ---Category: Methods to create Triangle
607 -- for Purpose : see Graphic3d_Group.cdl
608 ----------------------------------------
610 PrimitiveArray( me : mutable;
611 ACGroup : CGroup from Graphic3d;
612 parray : PrimitiveArray from Graphic3d;
613 EvalMinMax : Boolean from Standard = Standard_True )
615 ---Purpose: call_togl_parray
617 UserDraw( me : mutable;
618 ACGroup : CGroup from Graphic3d;
619 AUserDraw : CUserDraw from Graphic3d )
621 ---Purpose: call_togl_userdraw
623 EnableVBO( me : mutable;
624 status : Boolean from Standard )
626 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
628 ----------------------------------------
629 ---Category: Methods to create Triedron
630 -- for Purpose : see Graphic3d_Group.cdl
631 ----------------------------------------
633 ZBufferTriedronSetup ( me : mutable;
634 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
635 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
636 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
637 SizeRatio : Real from Standard = 0.8;
638 AxisDiametr : Real from Standard = 0.05;
639 NbFacettes : Integer from Standard = 12)
641 ---Purpose: call_togl_ztriedron_setup
643 TriedronDisplay ( me : mutable;
644 ACView : CView from Graphic3d;
645 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
646 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
647 AScale : Real from Standard = 0.02;
648 AsWireframe : Boolean from Standard = Standard_True )
650 ---Purpose: call_togl_triedron_display
653 TriedronErase ( me : mutable;
654 ACView : CView from Graphic3d)
656 ---Purpose: call_togl_triedron_erase
659 TriedronEcho ( me : mutable;
660 ACView : CView from Graphic3d;
661 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
663 ---Purpose: call_togl_triedron_echo
665 ---------------------------------
666 ---Category: Graduated trihedron
667 ---------------------------------
669 GraduatedTrihedronDisplay(me : mutable;
670 view : CView from Graphic3d;
671 cubic : CGraduatedTrihedron from Graphic3d)
672 ---Purpose: call_togl_graduatedtrihedron_display
675 GraduatedTrihedronErase(me : mutable;
676 view : CView from Graphic3d)
677 ---Purpose: call_togl_graduatedtrihedron_erase
680 GraduatedTrihedronMinMaxValues(me : mutable;
681 xmin : ShortReal from Standard;
682 ymin : ShortReal from Standard;
683 zmin : ShortReal from Standard;
684 xmax : ShortReal from Standard;
685 ymax : ShortReal from Standard;
686 zmax : ShortReal from Standard)
687 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
690 ---------------------------
691 -- Category: Animation mode
692 ---------------------------
694 BeginAnimation ( me : mutable;
695 ACView : CView from Graphic3d)
697 ---Purpose: call_togl_begin_animation
699 EndAnimation ( me : mutable;
700 ACView : CView from Graphic3d)
702 ---Purpose: call_togl_end_animation
704 ----------------------------------
705 -- Category: Ajout mode methods
706 ----------------------------------
708 BeginAddMode ( me : mutable;
709 ACView : CView from Graphic3d)
710 returns Boolean from Standard
712 ---Purpose: call_togl_begin_ajout_mode
714 EndAddMode ( me : mutable)
716 ---Purpose: call_togl_end_ajout_mode
718 ----------------------------------
719 -- Category: Immediat mode methods
720 ----------------------------------
722 BeginImmediatMode ( me : mutable;
723 ACView : CView from Graphic3d;
724 ACUnderLayer : CLayer2d from Aspect;
725 ACOverLayer : CLayer2d from Aspect;
726 DoubleBuffer : Boolean from Standard;
727 RetainMode : Boolean from Standard)
728 returns Boolean from Standard
730 ---Purpose: call_togl_begin_immediat_mode
732 BeginPolyline ( me : mutable )
734 ---Purpose: call_togl_begin_polyline
736 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
737 aFlush : Boolean from Standard = Standard_True)
739 ---Purpose: call_togl_clear_immediat_mode
742 X : ShortReal from Standard;
743 Y : ShortReal from Standard;
744 Z : ShortReal from Standard )
746 ---Purpose: call_togl_draw
748 DrawStructure ( me : mutable;
749 ACStructure : CStructure from Graphic3d )
751 ---Purpose: call_togl_draw_structure
753 EndImmediatMode ( me : mutable;
754 Synchronize : Integer from Standard )
756 ---Purpose: call_togl_end_immediat_mode
758 EndPolyline ( me : mutable )
760 ---Purpose: call_togl_end_polyline
763 X : ShortReal from Standard;
764 Y : ShortReal from Standard;
765 Z : ShortReal from Standard )
767 ---Purpose: call_togl_move
769 SetLineColor ( me : mutable;
770 R : ShortReal from Standard;
771 G : ShortReal from Standard;
772 B : ShortReal from Standard )
774 ---Purpose: call_togl_set_linecolor
776 SetLineType ( me : mutable;
777 Type : Integer from Standard )
779 ---Purpose: call_togl_set_linetype
781 SetLineWidth ( me : mutable;
782 Width : ShortReal from Standard )
784 ---Purpose: call_togl_set_linewidth
786 SetMinMax ( me : mutable;
787 X1 : ShortReal from Standard;
788 Y1 : ShortReal from Standard;
789 Z1 : ShortReal from Standard;
790 X2 : ShortReal from Standard;
791 Y2 : ShortReal from Standard;
792 Z2 : ShortReal from Standard )
794 ---Purpose: call_togl_set_minmax
796 Transform ( me : mutable;
797 AMatrix : Array2OfReal from TColStd;
798 AType : TypeOfComposition from Graphic3d )
800 ---Purpose: call_togl_transform
802 -----------------------------
803 -- Category: Textures methods
804 -----------------------------
807 Type : TypeOfTexture from Graphic3d;
808 Image : AlienImage from AlienImage;
809 FileName : CString from Standard;
810 TexUpperBounds : HArray1OfReal from TColStd )
811 returns Integer from Standard
816 TexId : Integer from Standard )
821 TexId : Integer from Standard;
822 AValue : CInitTexture from Graphic3d )
826 -------------------------------
827 -- Category: Layer mode methods
828 -------------------------------
830 Layer ( me : mutable;
831 ACLayer : in out CLayer2d from Aspect )
833 ---Purpose: call_togl_layer2d
835 RemoveLayer ( me : mutable;
836 ACLayer : CLayer2d from Aspect )
838 ---Purpose: call_togl_removelayer2d
840 BeginLayer ( me : mutable;
841 ACLayer : CLayer2d from Aspect )
843 ---Purpose: call_togl_begin_layer2d
845 BeginPolygon2d ( me : mutable )
847 ---Purpose: call_togl_begin_polygon2d
849 BeginPolyline2d ( me : mutable )
851 ---Purpose: call_togl_begin_polyline2d
853 ClearLayer ( me : mutable;
854 ACLayer : CLayer2d from Aspect )
856 ---Purpose: call_togl_clear_layer2d
859 X : ShortReal from Standard;
860 Y : ShortReal from Standard )
862 ---Purpose: call_togl_draw2d
865 X : ShortReal from Standard;
866 Y : ShortReal from Standard )
868 ---Purpose: call_togl_edge2d
870 EndLayer ( me : mutable )
872 ---Purpose: call_togl_end_layer2d
874 EndPolygon2d ( me : mutable )
876 ---Purpose: call_togl_end_polygon2d
878 EndPolyline2d ( me : mutable )
880 ---Purpose: call_togl_end_polyline2d
883 X : ShortReal from Standard;
884 Y : ShortReal from Standard )
886 ---Purpose: call_togl_move2d
888 Rectangle ( me : mutable;
889 X, Y : ShortReal from Standard;
890 Width, Height : ShortReal from Standard )
892 ---Purpose: call_togl_rectangle2d
894 SetColor ( me : mutable;
895 R : ShortReal from Standard;
896 G : ShortReal from Standard;
897 B : ShortReal from Standard )
899 ---Purpose: call_togl_set_color
901 SetTransparency ( me : mutable;
902 ATransparency : ShortReal from Standard )
904 ---Purpose: call_togl_set_transparency
906 UnsetTransparency ( me : mutable )
908 ---Purpose: call_togl_unset_transparency
910 SetLineAttributes ( me : mutable;
911 Type : Integer from Standard;
912 Width : ShortReal from Standard )
914 ---Purpose: call_togl_set_line_attributes
917 SetTextAttributes ( me : mutable;
918 Font : CString from Standard;
919 Type : Integer from Standard;
920 R : ShortReal from Standard;
921 G : ShortReal from Standard;
922 B : ShortReal from Standard )
924 ---Purpose: Set text attributes for under-/overlayer.
925 -- <Font> argument defines the name of the font to be used,
926 -- <Type> argument defines the display type of the text,
927 -- <R> <G> <B> values define the color of decal or subtitle background.
928 -- To set the color of the text you can use the SetColor method.
931 AText : CString from Standard;
932 X, Y : ShortReal from Standard;
933 AHeight : ShortReal from Standard )
935 ---Purpose: call_togl_text2d
936 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
938 DefaultTextHeight( me )
939 returns ShortReal from Standard
944 AText : CString from Standard;
945 AHeight : ShortReal from Standard;
946 AWidth : in out ShortReal from Standard;
947 AnAscent : in out ShortReal from Standard;
948 ADescent : in out ShortReal from Standard )
950 ---Purpose: call_togl_textsize2d
952 SetBackFacingModel ( me : mutable;
953 aView : CView from Graphic3d )
955 ---Purpose: call_togl_backfacing
957 SetDepthTestEnabled( me; view : CView from Graphic3d;
958 isEnabled : Boolean from Standard )
960 ---Purpose: call_togl_depthtest
962 IsDepthTestEnabled( me; view : CView from Graphic3d )
963 returns Boolean from Standard is deferred;
964 ---Purpose: call_togl_isdepthtest
967 view : CView from Graphic3d;
969 width, height : Integer;
972 ---Purpose: Reads depths of shown pixels of the given
973 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
975 FBOCreate( me : mutable;
976 view : CView from Graphic3d;
977 width, height : Integer from Standard )
978 returns PtrFrameBuffer from Graphic3d
980 ---Purpose: Generate offscreen FBO in the graphic library.
981 -- If not supported on hardware returns NULL.
983 FBORelease( me : mutable;
984 view : CView from Graphic3d;
985 fboPtr : in out PtrFrameBuffer from Graphic3d )
987 ---Purpose: Remove offscreen FBO from the graphic library
989 FBOGetDimensions( me : mutable;
990 view : CView from Graphic3d;
991 fboPtr : PtrFrameBuffer from Graphic3d;
992 width, height : out Integer from Standard;
993 widthMax, heightMax : out Integer from Standard )
995 ---Purpose: Read offscreen FBO configuration.
997 FBOChangeViewport( me : mutable;
998 view : CView from Graphic3d;
999 fboPtr : in out PtrFrameBuffer from Graphic3d;
1000 width, height : Integer from Standard )
1002 ---Purpose: Change offscreen FBO viewport.
1004 BufferDump( me : mutable;
1005 view : CView from Graphic3d;
1006 buffer : in out CRawBufferData from Image )
1007 returns Boolean from Standard
1009 ---Purpose: Dump active rendering buffer into specified memory buffer.
1011 SetGLLightEnabled( me; view : CView from Graphic3d;
1012 isEnabled : Boolean from Standard )
1014 ---Purpose: call_togl_gllight
1016 IsGLLightEnabled( me; view : CView from Graphic3d )
1017 returns Boolean from Standard is deferred;
1018 ---Purpose: call_togl_isgllight
1021 ACView : CView from Graphic3d;
1022 ACUnderLayer : CLayer2d from Aspect;
1023 ACOverLayer : CLayer2d from Aspect;
1024 hPrnDC : Handle from Aspect;
1025 showBackground : Boolean;
1027 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1028 theScaleFactor : Real from Standard = 1.0 )
1029 returns Boolean from Standard is deferred;
1031 ---Purpose: print the contents of all layers of the view to the printer.
1032 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1033 -- <showBackground> : When set to FALSE then print the view without background color
1034 -- (background is white)
1035 -- else set to TRUE for printing with current background color.
1036 -- <filename>: If != NULL, then the view will be printed to a file.
1037 -- <printAlgorithm>: Select print algorithm: stretch, tile.
1038 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1039 -- printings accordingly to the scale factor selected in the printer
1040 -- properties dialog.
1041 -- Returns Standard_True if the data is passed to the printer, otherwise
1042 -- Standard_False if the print operation failed due to the printer errors,
1043 -- or insufficient system memory available.
1044 ---Warning: Works only under Windows.
1046 Export( me: mutable;
1047 theFileName : CString from Standard;
1048 theFormat : ExportFormat from Graphic3d;
1049 theSortType : SortType from Graphic3d;
1050 theWidth, theHeight : Integer from Standard;
1051 theView : CView from Graphic3d;
1052 theLayerUnder : CLayer2d from Aspect;
1053 theLayerOver : CLayer2d from Aspect;
1054 thePrecision : Real from Standard = 0.005;
1055 theProgressBarFunc : Address from Standard = NULL;
1056 theProgressObject : Address from Standard = NULL )
1057 returns Boolean from Standard
1060 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1061 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1062 -- Notice however that results may differ a lot and do not contain some elements.
1064 RemovePrimitiveArray( me : mutable;
1065 theCGroup : CGroup from Graphic3d;
1066 thePArray : PrimitiveArray from Graphic3d )
1068 ---Purpose: Clear visualization data in graphical driver and
1069 -- stop displaying the primitives array of the graphical group
1070 -- <theCGroup>. This method is internal and should be used
1071 -- by Graphic3d_Group only.
1073 AddZLayer( me : mutable;
1074 theCView : CView from Graphic3d;
1075 theLayerId : Integer from Standard )
1077 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
1078 -- the view. Z layers allow drawing structures in higher layers
1079 -- in foreground of structures in lower layers. To add a structure
1080 -- to desired layer on display it is necessary to set the layer
1081 -- ID for the structure.
1083 RemoveZLayer( me : mutable;
1084 theCView : CView from Graphic3d;
1085 theLayerId : Integer from Standard )
1087 ---Purpose: Remove Z layer from the specified view. All structures
1088 -- displayed at the moment in layer will be displayed in default layer
1089 -- ( the bottom-level z layer ). To unset layer ID from associated
1090 -- structures use method UnsetZLayer (...).
1092 UnsetZLayer( me : mutable;
1093 theLayerId : Integer from Standard )
1095 ---Purpose: Unset Z layer ID for all structures. The structure
1096 -- indexes will be set to default layer ( the bottom-level z layer
1099 ChangeZLayer( me : mutable;
1100 theCStructure : CStructure from Graphic3d;
1101 theLayerId : Integer from Standard )
1103 ---Purpose: Change Z layer of a structure. The new z layer ID will
1104 -- be used to define the associated layer for structure on display.
1106 ChangeZLayer( me : mutable;
1107 theCStructure : CStructure from Graphic3d;
1108 theCView : CView from Graphic3d;
1109 theNewLayerId : Integer from Standard )
1111 ---Purpose: Change Z layer of a structure already presented in view.
1114 theCStructure : CStructure from Graphic3d )
1115 returns Integer from Standard is deferred;
1116 ---Purpose: Get Z layer ID of structure. If the structure doesn't
1117 -- exists in graphic driver, the method returns -1.
1119 --------------------------
1120 -- Category: Class methods
1121 --------------------------
1124 ACLight : CLight from Graphic3d;
1125 Update : Boolean from Standard )
1126 returns Integer from Standard;
1127 ---Purpose: call_togl_light
1130 ACPlane : CPlane from Graphic3d;
1131 Update : Boolean from Standard )
1132 returns Integer from Standard;
1133 ---Purpose: call_togl_plane
1135 -----------------------------
1136 -- Category: Internal methods
1137 -----------------------------
1140 AComment : CString from Standard;
1141 AValue : Boolean from Standard );
1144 ACGroup : CGroup from Graphic3d;
1145 AField : Integer from Standard );
1148 ACLight : CLight from Graphic3d;
1149 AField : Integer from Standard );
1152 ACPick : CPick from Graphic3d;
1153 AField : Integer from Standard );
1156 ACPlane : CPlane from Graphic3d;
1157 AField : Integer from Standard );
1159 PrintCStructure ( me;
1160 ACStructure : CStructure from Graphic3d;
1161 AField : Integer from Standard );
1164 ACView : CView from Graphic3d;
1165 AField : Integer from Standard );
1168 AFunc : CString from Standard );
1171 AComment : CString from Standard;
1172 AValue : Integer from Standard );
1175 AFunc : CString from Standard;
1176 AResult : Integer from Standard );
1178 PrintShortReal ( me;
1179 AComment : CString from Standard;
1180 AValue : ShortReal from Standard );
1183 AComment : CString from Standard;
1184 AMatrix : Array2OfReal from TColStd )
1185 raises TransformError from Graphic3d;
1188 AComment : CString from Standard;
1189 AString : CString from Standard );
1191 SetTrace ( me : mutable;
1192 ALevel : Integer from Standard )
1196 returns Integer from Standard
1199 --ListOfAvalableFontNames( me;
1200 -- lst: out NListOfHAsciiString from Graphic3d )
1201 -- returns Boolean from Standard
1203 -- Purpose: Initialize list of names of avalable system fonts
1204 -- returns Standard_False if fails
1205 -- ABD Integration support of system fonts (using FTGL and FreeType)
1209 MyTraceLevel : Integer from Standard is protected;
1210 MySharedLibrary : SharedLibrary from OSD is protected;
1212 end GraphicDriver from Graphic3d;