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,
75 Array1OfEdge from Aspect,
77 GraphicDriver from Aspect,
78 TypeOfTriedronEcho from Aspect,
79 TypeOfTriedronPosition from Aspect,
82 PrintAlgo from Aspect,
84 AspectLine3d from Graphic3d,
85 AspectMarker3d from Graphic3d,
86 AspectText3d from Graphic3d,
87 AspectFillArea3d from Graphic3d,
88 HorizontalTextAlignment from Graphic3d,
89 CBitFields20 from Graphic3d,
90 CGroup from Graphic3d,
91 CLight from Graphic3d,
93 CPlane from Graphic3d,
94 CStructure from Graphic3d,
96 CRawBufferData from Image,
97 Structure from Graphic3d,
98 TextPath from Graphic3d,
99 TypeOfComposition from Graphic3d,
100 TypeOfPolygon from Graphic3d,
101 TypeOfPrimitive from Graphic3d,
102 Vector from Graphic3d,
103 Array1OfVertex from Graphic3d,
104 Array2OfVertex from Graphic3d,
105 Vertex from Graphic3d,
106 Array1OfVertexC from Graphic3d,
107 Array2OfVertexC from Graphic3d,
108 VertexC from Graphic3d,
109 Array1OfVertexN from Graphic3d,
110 Array2OfVertexN from Graphic3d,
111 VertexN from Graphic3d,
112 Array1OfVertexNC from Graphic3d,
113 Array2OfVertexNC from Graphic3d,
114 VertexNC from Graphic3d,
115 VerticalTextAlignment from Graphic3d,
116 CInitTexture from Graphic3d,
117 TypeOfTexture from Graphic3d,
118 VertexNT from Graphic3d,
119 Array1OfVertexNT from Graphic3d,
120 Array2OfVertexNT from Graphic3d,
121 PrimitiveArray from Graphic3d,
122 PtrFrameBuffer from Graphic3d,
123 HArray1OfByte from TColStd,
124 FillMethod from Aspect,
125 GradientFillMethod from Aspect,
126 ExportFormat from Graphic3d,
127 SortType from Graphic3d,
128 HArray1OfReal from TColStd,
129 CUserDraw from Graphic3d,
130 NListOfHAsciiString from Graphic3d,
132 CGraduatedTrihedron from Graphic3d
136 TransformError from Graphic3d
139 Initialize ( AShrName : CString from Standard )
140 returns mutable GraphicDriver from Graphic3d;
142 ---Purpose: Initialises the Driver
144 -------------------------
145 -- Category: Init methods
146 -------------------------
148 Begin ( me : mutable;
149 ADisplay : CString from Standard )
150 returns Boolean from Standard
152 ---Purpose: call_togl_begin
154 Begin ( me : mutable;
155 ADisplay : Display from Aspect )
156 returns Boolean from Standard
158 ---Purpose: call_togl_begin_display
162 ---Purpose: call_togl_end
164 ----------------------------
165 -- Category: Inquire methods
166 ----------------------------
168 InquireLightLimit ( me : mutable )
169 returns Integer from Standard
171 ---Purpose: call_togl_inquirelight
173 InquireMat ( me : mutable;
174 ACView : CView from Graphic3d;
175 AMatO : out Array2OfReal from TColStd;
176 AMatM : out Array2OfReal from TColStd )
178 ---Purpose: call_togl_inquiremat
180 InquirePlaneLimit ( me : mutable )
181 returns Integer from Standard
183 ---Purpose: call_togl_inquireplane
185 InquireViewLimit ( me : mutable )
186 returns Integer from Standard
188 ---Purpose: call_togl_inquireview
190 InquireTextureAvailable ( me : mutable )
191 returns Boolean from Standard
193 ---Purpose: Returns Standard_True if texture is
194 -- supported by the graphic driver
196 ------------------------------
197 -- Category: Highlight methods
198 ------------------------------
200 Blink ( me : mutable;
201 ACStructure : CStructure from Graphic3d;
202 Create : Boolean from Standard )
204 ---Purpose: call_togl_blink
206 BoundaryBox ( me : mutable;
207 ACStructure : CStructure from Graphic3d;
208 Create : Boolean from Standard )
210 ---Purpose: call_togl_boundarybox
212 HighlightColor ( me : mutable;
213 ACStructure : CStructure from Graphic3d;
214 R : ShortReal from Standard;
215 G : ShortReal from Standard;
216 B : ShortReal from Standard;
217 Create : Boolean from Standard )
219 ---Purpose: call_togl_highlightcolor
221 NameSetStructure ( me : mutable;
222 ACStructure : CStructure from Graphic3d )
224 ---Purpose: call_togl_namesetstructure
226 -------------------------------------
227 -- Category: Group management methods
228 -------------------------------------
230 ClearGroup ( me : mutable;
231 ACGroup : CGroup from Graphic3d )
233 ---Purpose: call_togl_cleargroup
235 CloseGroup ( me : mutable;
236 ACGroup : CGroup from Graphic3d )
238 ---Purpose: call_togl_closegroup
240 FaceContextGroup ( me : mutable;
241 ACGroup : CGroup from Graphic3d;
242 NoInsert : Integer from Standard )
244 ---Purpose: call_togl_facecontextgroup
246 Group ( me : mutable;
247 ACGroup : in out CGroup from Graphic3d )
249 ---Purpose: call_togl_group
251 LineContextGroup ( me : mutable;
252 ACGroup : CGroup from Graphic3d;
253 NoInsert : Integer from Standard )
255 ---Purpose: call_togl_linecontextgroup
257 MarkerContextGroup ( me : mutable;
258 ACGroup : CGroup from Graphic3d;
259 NoInsert : Integer from Standard )
261 ---Purpose: call_togl_markercontextgroup
263 MarkerContextGroup ( me : mutable;
264 ACGroup : CGroup from Graphic3d;
265 NoInsert : Integer from Standard;
266 AMarkWidth : Integer from Standard;
267 AMarkHeight: Integer from Standard;
268 ATexture : HArray1OfByte from TColStd )
270 ---Purpose: call_togl_markercontextgroup
272 OpenGroup ( me : mutable;
273 ACGroup : CGroup from Graphic3d )
275 ---Purpose: call_togl_opengroup
277 RemoveGroup ( me : mutable;
278 ACGroup : CGroup from Graphic3d )
280 ---Purpose: call_togl_removegroup
282 TextContextGroup ( me : mutable;
283 ACGroup : CGroup from Graphic3d;
284 NoInsert : Integer from Standard )
286 ---Purpose: call_togl_textcontextgroup
288 -----------------------------------------
289 -- Category: Structure management methods
290 -----------------------------------------
292 ClearStructure ( me : mutable;
293 ACStructure : CStructure from Graphic3d )
295 ---Purpose: call_togl_clearstructure
297 Connect ( me : mutable;
298 AFather : CStructure from Graphic3d;
299 ASon : CStructure from Graphic3d )
301 ---Purpose: call_togl_connect
303 ContextStructure ( me : mutable;
304 ACStructure : CStructure from Graphic3d )
306 ---Purpose: call_togl_contextstructure
308 Disconnect ( me : mutable;
309 AFather : CStructure from Graphic3d;
310 ASon : CStructure from Graphic3d )
312 ---Purpose: call_togl_disconnect
314 DisplayStructure ( me : mutable;
315 ACView : CView from Graphic3d;
316 ACStructure : CStructure from Graphic3d;
317 APriority : Integer from Standard )
319 ---Purpose: call_togl_displaystructure
321 EraseStructure ( me : mutable;
322 ACView : CView from Graphic3d;
323 ACStructure : CStructure from Graphic3d )
325 ---Purpose: call_togl_erasestructure
327 RemoveStructure ( me : mutable;
328 ACStructure : CStructure from Graphic3d )
330 ---Purpose: call_togl_removestructure
332 Structure ( me : mutable;
333 ACStructure : in out CStructure from Graphic3d )
335 ---Purpose: call_togl_structure
337 ------------------------------------
338 -- Category: Structured mode methods
339 ------------------------------------
341 ActivateView ( me : mutable;
342 ACView : CView from Graphic3d )
344 ---Purpose: call_togl_activateview
346 AntiAliasing ( me : mutable;
347 ACView : CView from Graphic3d;
348 AFlag : Boolean from Standard )
350 ---Purpose: call_togl_antialiasing
352 Background ( me : mutable;
353 ACView : CView from Graphic3d )
355 ---Purpose: call_togl_background
357 GradientBackground ( me : mutable;
358 ACView : CView from Graphic3d;
359 AColor1: Color from Quantity;
360 AColor2: Color from Quantity;
361 FillStyle : GradientFillMethod from Aspect
364 ---Purpose: call_togl_gradient_background
367 BackgroundImage( me : mutable;
368 FileName : CString from Standard;
369 ACView : CView from Graphic3d;
370 FillStyle : FillMethod from Aspect )
373 SetBgImageStyle( me : mutable;
374 ACView : CView from Graphic3d;
375 FillStyle : FillMethod from Aspect )
378 SetBgGradientStyle( me : mutable;
379 ACView : CView from Graphic3d;
380 FillStyle : GradientFillMethod from Aspect )
383 ClipLimit ( me : mutable;
384 ACView : CView from Graphic3d;
385 AWait : Boolean from Standard )
387 ---Purpose: call_togl_cliplimit
389 DeactivateView ( me : mutable;
390 ACView : CView from Graphic3d )
392 ---Purpose: call_togl_deactivateview
394 DepthCueing ( me : mutable;
395 ACView : CView from Graphic3d;
396 AFlag : Boolean from Standard )
398 ---Purpose: call_togl_cliplimit
400 ProjectRaster ( me : mutable;
401 ACView : CView from Graphic3d;
402 AX : ShortReal from Standard;
403 AY : ShortReal from Standard;
404 AZ : ShortReal from Standard;
405 AU : out Integer from Standard;
406 AV : out Integer from Standard )
407 returns Boolean from Standard
409 ---Purpose: call_togl_unproject_raster
411 UnProjectRaster ( me : mutable;
412 ACView : CView from Graphic3d;
413 Axm : Integer from Standard;
414 Aym : Integer from Standard;
415 AXM : Integer from Standard;
416 AYM : Integer from Standard;
417 AU : Integer from Standard;
418 AV : Integer from Standard;
419 AX : out ShortReal from Standard;
420 AY : out ShortReal from Standard;
421 AZ : out ShortReal from Standard )
422 returns Boolean from Standard
424 ---Purpose: call_togl_unproject_raster
426 UnProjectRasterWithRay ( me : mutable;
427 ACView : CView from Graphic3d;
428 Axm : Integer from Standard;
429 Aym : Integer from Standard;
430 AXM : Integer from Standard;
431 AYM : Integer from Standard;
432 AU : Integer from Standard;
433 AV : Integer from Standard;
434 AX : out ShortReal from Standard;
435 AY : out ShortReal from Standard;
436 AZ : out ShortReal from Standard;
437 DX : out ShortReal from Standard;
438 DY : out ShortReal from Standard;
439 DZ : out ShortReal from Standard )
440 returns Boolean from Standard
442 ---Purpose: call_togl_unproject_raster_with_ray
444 RatioWindow ( me : mutable;
445 ACView : CView from Graphic3d )
447 ---Purpose: call_togl_ratio_window
449 Redraw ( me : mutable;
450 ACView : CView from Graphic3d;
451 ACUnderLayer : CLayer2d from Aspect;
452 ACOverLayer : CLayer2d from Aspect;
456 height : Integer = 0 )
458 ---Purpose: call_togl_redraw
459 -- Warning: when the redraw area has a null size, the full view is redrawn
461 RemoveView ( me : mutable;
462 ACView : CView from Graphic3d )
464 ---Purpose: call_togl_removeview
466 SetLight ( me : mutable;
467 ACView : CView from Graphic3d )
469 ---Purpose: call_togl_setlight
471 SetPlane ( me : mutable;
472 ACView : CView from Graphic3d )
474 ---Purpose: call_togl_setplane
476 SetVisualisation ( me : mutable;
477 ACView : CView from Graphic3d )
479 ---Purpose: call_togl_setvisualisation
481 TransformStructure ( me : mutable;
482 ACStructure : CStructure from Graphic3d )
484 ---Purpose: call_togl_transformstructure
486 DegenerateStructure ( me : mutable;
487 ACStructure : CStructure from Graphic3d )
489 ---Purpose: call_togl_degeneratestructure
491 Transparency ( me : mutable;
492 ACView : CView from Graphic3d;
493 AFlag : Boolean from Standard )
495 ---Purpose: call_togl_transparency
497 Update ( me : mutable;
498 ACView : CView from Graphic3d;
499 ACUnderLayer : CLayer2d from Aspect;
500 ACOverLayer : CLayer2d from Aspect )
502 ---Purpose: call_togl_update
505 ACView : in out CView from Graphic3d )
506 returns Boolean from Standard
508 ---Purpose: call_togl_view
510 ViewMapping ( me : mutable;
511 ACView : CView from Graphic3d;
512 AWait : Boolean from Standard )
514 ---Purpose: call_togl_viewmapping
516 ViewOrientation ( me : mutable;
517 ACView : CView from Graphic3d;
518 AWait : Boolean from Standard )
520 ---Purpose: call_togl_vieworientation
522 Environment ( me : mutable;
523 ACView : CView from Graphic3d )
527 ----------------------------------------
528 -- Category: Methods to create Marker
529 -- for Purpose : see Graphic3d_Group.cdl
530 ----------------------------------------
532 Marker ( me : mutable;
533 ACGroup : CGroup from Graphic3d;
534 APoint : Vertex from Graphic3d;
535 EvalMinMax : Boolean from Standard = Standard_True )
538 MarkerSet ( me : mutable;
539 ACGroup : CGroup from Graphic3d;
540 ListVertex : Array1OfVertex from Graphic3d;
541 EvalMinMax : Boolean from Standard = Standard_True )
544 ----------------------------------------
545 -- Category: Methods to create Polygon
546 -- for Purpose : see Graphic3d_Group.cdl
547 ----------------------------------------
549 Polygon ( me : mutable;
550 ACGroup : CGroup from Graphic3d;
551 ListVertex : Array1OfVertex from Graphic3d;
552 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
553 EvalMinMax : Boolean from Standard = Standard_True )
555 ---Purpose: call_togl_polygon
557 ----------------------------------------
558 -- Category: Methods to create Text
559 -- for Purpose : see Graphic3d_Group.cdl
560 ----------------------------------------
563 ACGroup : CGroup from Graphic3d;
564 AText : CString from Standard;
565 APoint : Vertex from Graphic3d;
566 AHeight : Real from Standard;
567 AAngle : PlaneAngle from Quantity;
568 ATp : TextPath from Graphic3d;
569 AHta : HorizontalTextAlignment from Graphic3d;
570 AVta : VerticalTextAlignment from Graphic3d;
571 EvalMinMax : Boolean from Standard = Standard_True )
573 ---Purpose: call_togl_text
576 ACGroup : CGroup from Graphic3d;
577 AText : CString from Standard;
578 APoint : Vertex from Graphic3d;
579 AHeight : Real from Standard;
580 EvalMinMax : Boolean from Standard = Standard_True )
582 ---Purpose: call_togl_text
585 ACGroup : CGroup from Graphic3d;
586 AText : ExtendedString from TCollection;
587 APoint : Vertex from Graphic3d;
588 AHeight : Real from Standard;
589 AAngle : PlaneAngle from Quantity;
590 ATp : TextPath from Graphic3d;
591 AHta : HorizontalTextAlignment from Graphic3d;
592 AVta : VerticalTextAlignment from Graphic3d;
593 EvalMinMax : Boolean from Standard = Standard_True )
595 ---Purpose: call_togl_text
598 ACGroup : CGroup from Graphic3d;
599 AText : ExtendedString from TCollection;
600 APoint : Vertex from Graphic3d;
601 AHeight : Real from Standard;
602 EvalMinMax : Boolean from Standard = Standard_True )
604 ---Purpose: call_togl_text
606 ----------------------------------------
607 ---Category: Methods to create Triangle
608 -- for Purpose : see Graphic3d_Group.cdl
609 ----------------------------------------
611 PrimitiveArray( me : mutable;
612 ACGroup : CGroup from Graphic3d;
613 parray : PrimitiveArray from Graphic3d;
614 EvalMinMax : Boolean from Standard = Standard_True )
616 ---Purpose: call_togl_parray
618 UserDraw( me : mutable;
619 ACGroup : CGroup from Graphic3d;
620 AUserDraw : CUserDraw from Graphic3d )
622 ---Purpose: call_togl_userdraw
624 EnableVBO( me : mutable;
625 status : Boolean from Standard )
627 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
630 theFreeBytes : out Size from Standard;
631 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
632 ---Purpose: Returns information about GPU memory usage.
634 ----------------------------------------
635 ---Category: Methods to create Triedron
636 -- for Purpose : see Graphic3d_Group.cdl
637 ----------------------------------------
639 ZBufferTriedronSetup ( me : mutable;
640 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
641 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
642 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
643 SizeRatio : Real from Standard = 0.8;
644 AxisDiametr : Real from Standard = 0.05;
645 NbFacettes : Integer from Standard = 12)
647 ---Purpose: call_togl_ztriedron_setup
649 TriedronDisplay ( me : mutable;
650 ACView : CView from Graphic3d;
651 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
652 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
653 AScale : Real from Standard = 0.02;
654 AsWireframe : Boolean from Standard = Standard_True )
656 ---Purpose: call_togl_triedron_display
659 TriedronErase ( me : mutable;
660 ACView : CView from Graphic3d)
662 ---Purpose: call_togl_triedron_erase
665 TriedronEcho ( me : mutable;
666 ACView : CView from Graphic3d;
667 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
669 ---Purpose: call_togl_triedron_echo
671 ---------------------------------
672 ---Category: Graduated trihedron
673 ---------------------------------
675 GraduatedTrihedronDisplay(me : mutable;
676 view : CView from Graphic3d;
677 cubic : CGraduatedTrihedron from Graphic3d)
678 ---Purpose: call_togl_graduatedtrihedron_display
681 GraduatedTrihedronErase(me : mutable;
682 view : CView from Graphic3d)
683 ---Purpose: call_togl_graduatedtrihedron_erase
686 GraduatedTrihedronMinMaxValues(me : mutable;
687 xmin : ShortReal from Standard;
688 ymin : ShortReal from Standard;
689 zmin : ShortReal from Standard;
690 xmax : ShortReal from Standard;
691 ymax : ShortReal from Standard;
692 zmax : ShortReal from Standard)
693 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
696 ---------------------------
697 -- Category: Animation mode
698 ---------------------------
700 BeginAnimation ( me : mutable;
701 ACView : CView from Graphic3d)
703 ---Purpose: call_togl_begin_animation
705 EndAnimation ( me : mutable;
706 ACView : CView from Graphic3d)
708 ---Purpose: call_togl_end_animation
710 ----------------------------------
711 -- Category: Ajout mode methods
712 ----------------------------------
714 BeginAddMode ( me : mutable;
715 ACView : CView from Graphic3d)
716 returns Boolean from Standard
718 ---Purpose: call_togl_begin_ajout_mode
720 EndAddMode ( me : mutable)
722 ---Purpose: call_togl_end_ajout_mode
724 ----------------------------------
725 -- Category: Immediat mode methods
726 ----------------------------------
728 BeginImmediatMode ( me : mutable;
729 ACView : CView from Graphic3d;
730 ACUnderLayer : CLayer2d from Aspect;
731 ACOverLayer : CLayer2d from Aspect;
732 DoubleBuffer : Boolean from Standard;
733 RetainMode : Boolean from Standard)
734 returns Boolean from Standard
736 ---Purpose: call_togl_begin_immediat_mode
738 BeginPolyline ( me : mutable )
740 ---Purpose: call_togl_begin_polyline
742 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
743 aFlush : Boolean from Standard = Standard_True)
745 ---Purpose: call_togl_clear_immediat_mode
748 X : ShortReal from Standard;
749 Y : ShortReal from Standard;
750 Z : ShortReal from Standard )
752 ---Purpose: call_togl_draw
754 DrawStructure ( me : mutable;
755 ACStructure : CStructure from Graphic3d )
757 ---Purpose: call_togl_draw_structure
759 EndImmediatMode ( me : mutable;
760 Synchronize : Integer from Standard )
762 ---Purpose: call_togl_end_immediat_mode
764 EndPolyline ( me : mutable )
766 ---Purpose: call_togl_end_polyline
769 X : ShortReal from Standard;
770 Y : ShortReal from Standard;
771 Z : ShortReal from Standard )
773 ---Purpose: call_togl_move
775 SetLineColor ( me : mutable;
776 R : ShortReal from Standard;
777 G : ShortReal from Standard;
778 B : ShortReal from Standard )
780 ---Purpose: call_togl_set_linecolor
782 SetLineType ( me : mutable;
783 Type : Integer from Standard )
785 ---Purpose: call_togl_set_linetype
787 SetLineWidth ( me : mutable;
788 Width : ShortReal from Standard )
790 ---Purpose: call_togl_set_linewidth
792 SetMinMax ( me : mutable;
793 X1 : ShortReal from Standard;
794 Y1 : ShortReal from Standard;
795 Z1 : ShortReal from Standard;
796 X2 : ShortReal from Standard;
797 Y2 : ShortReal from Standard;
798 Z2 : ShortReal from Standard )
800 ---Purpose: call_togl_set_minmax
802 Transform ( me : mutable;
803 AMatrix : Array2OfReal from TColStd;
804 AType : TypeOfComposition from Graphic3d )
806 ---Purpose: call_togl_transform
808 -----------------------------
809 -- Category: Textures methods
810 -----------------------------
813 Type : TypeOfTexture from Graphic3d;
814 Image : AlienImage from AlienImage;
815 FileName : CString from Standard;
816 TexUpperBounds : HArray1OfReal from TColStd )
817 returns Integer from Standard
822 TexId : Integer from Standard )
827 TexId : Integer from Standard;
828 AValue : CInitTexture from Graphic3d )
832 -------------------------------
833 -- Category: Layer mode methods
834 -------------------------------
836 Layer ( me : mutable;
837 ACLayer : in out CLayer2d from Aspect )
839 ---Purpose: call_togl_layer2d
841 RemoveLayer ( me : mutable;
842 ACLayer : CLayer2d from Aspect )
844 ---Purpose: call_togl_removelayer2d
846 BeginLayer ( me : mutable;
847 ACLayer : CLayer2d from Aspect )
849 ---Purpose: call_togl_begin_layer2d
851 BeginPolygon2d ( me : mutable )
853 ---Purpose: call_togl_begin_polygon2d
855 BeginPolyline2d ( me : mutable )
857 ---Purpose: call_togl_begin_polyline2d
859 ClearLayer ( me : mutable;
860 ACLayer : CLayer2d from Aspect )
862 ---Purpose: call_togl_clear_layer2d
865 X : ShortReal from Standard;
866 Y : ShortReal from Standard )
868 ---Purpose: call_togl_draw2d
871 X : ShortReal from Standard;
872 Y : ShortReal from Standard )
874 ---Purpose: call_togl_edge2d
876 EndLayer ( me : mutable )
878 ---Purpose: call_togl_end_layer2d
880 EndPolygon2d ( me : mutable )
882 ---Purpose: call_togl_end_polygon2d
884 EndPolyline2d ( me : mutable )
886 ---Purpose: call_togl_end_polyline2d
889 X : ShortReal from Standard;
890 Y : ShortReal from Standard )
892 ---Purpose: call_togl_move2d
894 Rectangle ( me : mutable;
895 X, Y : ShortReal from Standard;
896 Width, Height : ShortReal from Standard )
898 ---Purpose: call_togl_rectangle2d
900 SetColor ( me : mutable;
901 R : ShortReal from Standard;
902 G : ShortReal from Standard;
903 B : ShortReal from Standard )
905 ---Purpose: call_togl_set_color
907 SetTransparency ( me : mutable;
908 ATransparency : ShortReal from Standard )
910 ---Purpose: call_togl_set_transparency
912 UnsetTransparency ( me : mutable )
914 ---Purpose: call_togl_unset_transparency
916 SetLineAttributes ( me : mutable;
917 Type : Integer from Standard;
918 Width : ShortReal from Standard )
920 ---Purpose: call_togl_set_line_attributes
923 SetTextAttributes ( me : mutable;
924 Font : CString from Standard;
925 Type : Integer from Standard;
926 R : ShortReal from Standard;
927 G : ShortReal from Standard;
928 B : ShortReal from Standard )
930 ---Purpose: Set text attributes for under-/overlayer.
931 -- <Font> argument defines the name of the font to be used,
932 -- <Type> argument defines the display type of the text,
933 -- <R> <G> <B> values define the color of decal or subtitle background.
934 -- To set the color of the text you can use the SetColor method.
937 AText : CString from Standard;
938 X, Y : ShortReal from Standard;
939 AHeight : ShortReal from Standard )
941 ---Purpose: call_togl_text2d
942 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
944 DefaultTextHeight( me )
945 returns ShortReal from Standard
950 AText : CString from Standard;
951 AHeight : ShortReal from Standard;
952 AWidth : in out ShortReal from Standard;
953 AnAscent : in out ShortReal from Standard;
954 ADescent : in out ShortReal from Standard )
956 ---Purpose: call_togl_textsize2d
958 SetBackFacingModel ( me : mutable;
959 aView : CView from Graphic3d )
961 ---Purpose: call_togl_backfacing
963 SetDepthTestEnabled( me; view : CView from Graphic3d;
964 isEnabled : Boolean from Standard )
966 ---Purpose: call_togl_depthtest
968 IsDepthTestEnabled( me; view : CView from Graphic3d )
969 returns Boolean from Standard is deferred;
970 ---Purpose: call_togl_isdepthtest
973 view : CView from Graphic3d;
975 width, height : Integer;
978 ---Purpose: Reads depths of shown pixels of the given
979 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
981 FBOCreate( me : mutable;
982 view : CView from Graphic3d;
983 width, height : Integer from Standard )
984 returns PtrFrameBuffer from Graphic3d
986 ---Purpose: Generate offscreen FBO in the graphic library.
987 -- If not supported on hardware returns NULL.
989 FBORelease( me : mutable;
990 view : CView from Graphic3d;
991 fboPtr : in out PtrFrameBuffer from Graphic3d )
993 ---Purpose: Remove offscreen FBO from the graphic library
995 FBOGetDimensions( me : mutable;
996 view : CView from Graphic3d;
997 fboPtr : PtrFrameBuffer from Graphic3d;
998 width, height : out Integer from Standard;
999 widthMax, heightMax : out Integer from Standard )
1001 ---Purpose: Read offscreen FBO configuration.
1003 FBOChangeViewport( me : mutable;
1004 view : CView from Graphic3d;
1005 fboPtr : in out PtrFrameBuffer from Graphic3d;
1006 width, height : Integer from Standard )
1008 ---Purpose: Change offscreen FBO viewport.
1010 BufferDump( me : mutable;
1011 view : CView from Graphic3d;
1012 buffer : in out CRawBufferData from Image )
1013 returns Boolean from Standard
1015 ---Purpose: Dump active rendering buffer into specified memory buffer.
1017 SetGLLightEnabled( me; view : CView from Graphic3d;
1018 isEnabled : Boolean from Standard )
1020 ---Purpose: call_togl_gllight
1022 IsGLLightEnabled( me; view : CView from Graphic3d )
1023 returns Boolean from Standard is deferred;
1024 ---Purpose: call_togl_isgllight
1027 ACView : CView from Graphic3d;
1028 ACUnderLayer : CLayer2d from Aspect;
1029 ACOverLayer : CLayer2d from Aspect;
1030 hPrnDC : Handle from Aspect;
1031 showBackground : Boolean;
1033 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1034 theScaleFactor : Real from Standard = 1.0 )
1035 returns Boolean from Standard is deferred;
1037 ---Purpose: print the contents of all layers of the view to the printer.
1038 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1039 -- <showBackground> : When set to FALSE then print the view without background color
1040 -- (background is white)
1041 -- else set to TRUE for printing with current background color.
1042 -- <filename>: If != NULL, then the view will be printed to a file.
1043 -- <printAlgorithm>: Select print algorithm: stretch, tile.
1044 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1045 -- printings accordingly to the scale factor selected in the printer
1046 -- properties dialog.
1047 -- Returns Standard_True if the data is passed to the printer, otherwise
1048 -- Standard_False if the print operation failed due to the printer errors,
1049 -- or insufficient system memory available.
1050 ---Warning: Works only under Windows.
1052 Export( me: mutable;
1053 theFileName : CString from Standard;
1054 theFormat : ExportFormat from Graphic3d;
1055 theSortType : SortType from Graphic3d;
1056 theWidth, theHeight : Integer from Standard;
1057 theView : CView from Graphic3d;
1058 theLayerUnder : CLayer2d from Aspect;
1059 theLayerOver : CLayer2d from Aspect;
1060 thePrecision : Real from Standard = 0.005;
1061 theProgressBarFunc : Address from Standard = NULL;
1062 theProgressObject : Address from Standard = NULL )
1063 returns Boolean from Standard
1066 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1067 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1068 -- Notice however that results may differ a lot and do not contain some elements.
1070 RemovePrimitiveArray( me : mutable;
1071 theCGroup : CGroup from Graphic3d;
1072 thePArray : PrimitiveArray from Graphic3d )
1074 ---Purpose: Clear visualization data in graphical driver and
1075 -- stop displaying the primitives array of the graphical group
1076 -- <theCGroup>. This method is internal and should be used
1077 -- by Graphic3d_Group only.
1079 AddZLayer( me : mutable;
1080 theCView : CView from Graphic3d;
1081 theLayerId : Integer from Standard )
1083 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
1084 -- the view. Z layers allow drawing structures in higher layers
1085 -- in foreground of structures in lower layers. To add a structure
1086 -- to desired layer on display it is necessary to set the layer
1087 -- ID for the structure.
1089 RemoveZLayer( me : mutable;
1090 theCView : CView from Graphic3d;
1091 theLayerId : Integer from Standard )
1093 ---Purpose: Remove Z layer from the specified view. All structures
1094 -- displayed at the moment in layer will be displayed in default layer
1095 -- ( the bottom-level z layer ). To unset layer ID from associated
1096 -- structures use method UnsetZLayer (...).
1098 UnsetZLayer( me : mutable;
1099 theLayerId : Integer from Standard )
1101 ---Purpose: Unset Z layer ID for all structures. The structure
1102 -- indexes will be set to default layer ( the bottom-level z layer
1105 ChangeZLayer( me : mutable;
1106 theCStructure : CStructure from Graphic3d;
1107 theLayerId : Integer from Standard )
1109 ---Purpose: Change Z layer of a structure. The new z layer ID will
1110 -- be used to define the associated layer for structure on display.
1112 ChangeZLayer( me : mutable;
1113 theCStructure : CStructure from Graphic3d;
1114 theCView : CView from Graphic3d;
1115 theNewLayerId : Integer from Standard )
1117 ---Purpose: Change Z layer of a structure already presented in view.
1120 theCStructure : CStructure from Graphic3d )
1121 returns Integer from Standard is deferred;
1122 ---Purpose: Get Z layer ID of structure. If the structure doesn't
1123 -- exists in graphic driver, the method returns -1.
1125 --------------------------
1126 -- Category: Class methods
1127 --------------------------
1130 ACLight : CLight from Graphic3d;
1131 Update : Boolean from Standard )
1132 returns Integer from Standard;
1133 ---Purpose: call_togl_light
1136 ACPlane : CPlane from Graphic3d;
1137 Update : Boolean from Standard )
1138 returns Integer from Standard;
1139 ---Purpose: call_togl_plane
1141 -----------------------------
1142 -- Category: Internal methods
1143 -----------------------------
1146 AComment : CString from Standard;
1147 AValue : Boolean from Standard );
1150 ACGroup : CGroup from Graphic3d;
1151 AField : Integer from Standard );
1154 ACLight : CLight from Graphic3d;
1155 AField : Integer from Standard );
1158 ACPick : CPick from Graphic3d;
1159 AField : Integer from Standard );
1162 ACPlane : CPlane from Graphic3d;
1163 AField : Integer from Standard );
1165 PrintCStructure ( me;
1166 ACStructure : CStructure from Graphic3d;
1167 AField : Integer from Standard );
1170 ACView : CView from Graphic3d;
1171 AField : Integer from Standard );
1174 AFunc : CString from Standard );
1177 AComment : CString from Standard;
1178 AValue : Integer from Standard );
1181 AFunc : CString from Standard;
1182 AResult : Integer from Standard );
1184 PrintShortReal ( me;
1185 AComment : CString from Standard;
1186 AValue : ShortReal from Standard );
1189 AComment : CString from Standard;
1190 AMatrix : Array2OfReal from TColStd )
1191 raises TransformError from Graphic3d;
1194 AComment : CString from Standard;
1195 AString : CString from Standard );
1197 SetTrace ( me : mutable;
1198 ALevel : Integer from Standard )
1202 returns Integer from Standard
1205 --ListOfAvalableFontNames( me;
1206 -- lst: out NListOfHAsciiString from Graphic3d )
1207 -- returns Boolean from Standard
1209 -- Purpose: Initialize list of names of avalable system fonts
1210 -- returns Standard_False if fails
1211 -- ABD Integration support of system fonts (using FTGL and FreeType)
1215 MyTraceLevel : Integer from Standard is protected;
1216 MySharedLibrary : SharedLibrary from OSD is protected;
1218 end GraphicDriver from Graphic3d;