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 deferred class GraphicDriver from Graphic3d inherits GraphicDriver from Aspect
25 ---Purpose: This class allows the definition of a graphic driver
26 -- (currently only OpenGl driver is used).
35 SharedLibrary from OSD,
37 Array1OfInteger from TColStd,
38 Array1OfReal from TColStd,
39 Array2OfReal from TColStd,
41 AsciiString from TCollection,
42 ExtendedString from TCollection,
44 NameOfColor from Quantity,
47 PlaneAngle from Quantity,
49 AlienImage from AlienImage,
52 Array1OfEdge from Aspect,
54 GraphicDriver from Aspect,
55 TypeOfTriedronEcho from Aspect,
56 TypeOfTriedronPosition from Aspect,
59 PrintAlgo from Aspect,
61 AspectLine3d from Graphic3d,
62 AspectMarker3d from Graphic3d,
63 AspectText3d from Graphic3d,
64 AspectFillArea3d from Graphic3d,
65 HorizontalTextAlignment from Graphic3d,
66 CBitFields20 from Graphic3d,
67 CGroup from Graphic3d,
68 CLight from Graphic3d,
70 CPlane from Graphic3d,
71 CStructure from Graphic3d,
73 BufferType from Graphic3d,
74 Structure from Graphic3d,
75 TextPath from Graphic3d,
76 TypeOfComposition from Graphic3d,
77 TypeOfPolygon from Graphic3d,
78 TypeOfPrimitive from Graphic3d,
79 Vector from Graphic3d,
80 Array1OfVertex from Graphic3d,
81 Array2OfVertex from Graphic3d,
82 Vertex from Graphic3d,
83 Array1OfVertexC from Graphic3d,
84 Array2OfVertexC from Graphic3d,
85 VertexC from Graphic3d,
86 Array1OfVertexN from Graphic3d,
87 Array2OfVertexN from Graphic3d,
88 VertexN from Graphic3d,
89 Array1OfVertexNC from Graphic3d,
90 Array2OfVertexNC from Graphic3d,
91 VertexNC from Graphic3d,
92 VerticalTextAlignment from Graphic3d,
93 VertexNT from Graphic3d,
94 Array1OfVertexNT from Graphic3d,
95 Array2OfVertexNT from Graphic3d,
96 PrimitiveArray from Graphic3d,
97 PtrFrameBuffer from Graphic3d,
98 HArray1OfByte from TColStd,
99 FillMethod from Aspect,
100 GradientFillMethod from Aspect,
101 ExportFormat from Graphic3d,
102 SortType from Graphic3d,
103 HArray1OfReal from TColStd,
104 CUserDraw from Graphic3d,
105 NListOfHAsciiString from Graphic3d,
106 FontAspect from Font,
107 CGraduatedTrihedron from Graphic3d
111 TransformError from Graphic3d
114 Initialize ( AShrName : CString from Standard )
115 returns mutable GraphicDriver from Graphic3d;
117 ---Purpose: Initialises the Driver
119 -------------------------
120 -- Category: Init methods
121 -------------------------
123 Begin ( me : mutable;
124 ADisplay : CString from Standard )
125 returns Boolean from Standard
127 ---Purpose: call_togl_begin
129 Begin ( me : mutable;
130 ADisplay : Display from Aspect )
131 returns Boolean from Standard
133 ---Purpose: call_togl_begin_display
137 ---Purpose: call_togl_end
139 ----------------------------
140 -- Category: Inquire methods
141 ----------------------------
143 InquireLightLimit ( me : mutable )
144 returns Integer from Standard
146 ---Purpose: call_togl_inquirelight
148 InquireMat ( me : mutable;
149 ACView : CView from Graphic3d;
150 AMatO : out Array2OfReal from TColStd;
151 AMatM : out Array2OfReal from TColStd )
153 ---Purpose: call_togl_inquiremat
155 InquirePlaneLimit ( me : mutable )
156 returns Integer from Standard
158 ---Purpose: call_togl_inquireplane
160 InquireViewLimit ( me : mutable )
161 returns Integer from Standard
163 ---Purpose: call_togl_inquireview
165 ------------------------------
166 -- Category: Highlight methods
167 ------------------------------
169 Blink ( me : mutable;
170 ACStructure : CStructure from Graphic3d;
171 Create : Boolean from Standard )
173 ---Purpose: call_togl_blink
175 BoundaryBox ( me : mutable;
176 ACStructure : CStructure from Graphic3d;
177 Create : Boolean from Standard )
179 ---Purpose: call_togl_boundarybox
181 HighlightColor ( me : mutable;
182 ACStructure : CStructure from Graphic3d;
183 R : ShortReal from Standard;
184 G : ShortReal from Standard;
185 B : ShortReal from Standard;
186 Create : Boolean from Standard )
188 ---Purpose: call_togl_highlightcolor
190 NameSetStructure ( me : mutable;
191 ACStructure : CStructure from Graphic3d )
193 ---Purpose: call_togl_namesetstructure
195 -------------------------------------
196 -- Category: Group management methods
197 -------------------------------------
199 ClearGroup ( me : mutable;
200 ACGroup : CGroup from Graphic3d )
202 ---Purpose: call_togl_cleargroup
204 CloseGroup ( me : mutable;
205 ACGroup : CGroup from Graphic3d )
207 ---Purpose: call_togl_closegroup
209 FaceContextGroup ( me : mutable;
210 ACGroup : CGroup from Graphic3d;
211 NoInsert : Integer from Standard )
213 ---Purpose: call_togl_facecontextgroup
215 Group ( me : mutable;
216 ACGroup : in out CGroup from Graphic3d )
218 ---Purpose: call_togl_group
220 LineContextGroup ( me : mutable;
221 ACGroup : CGroup from Graphic3d;
222 NoInsert : Integer from Standard )
224 ---Purpose: call_togl_linecontextgroup
226 MarkerContextGroup ( me : mutable;
227 ACGroup : CGroup from Graphic3d;
228 NoInsert : Integer from Standard )
230 ---Purpose: call_togl_markercontextgroup
232 MarkerContextGroup ( me : mutable;
233 ACGroup : CGroup from Graphic3d;
234 NoInsert : Integer from Standard;
235 AMarkWidth : Integer from Standard;
236 AMarkHeight: Integer from Standard;
237 ATexture : HArray1OfByte from TColStd )
239 ---Purpose: call_togl_markercontextgroup
241 OpenGroup ( me : mutable;
242 ACGroup : CGroup from Graphic3d )
244 ---Purpose: call_togl_opengroup
246 RemoveGroup ( me : mutable;
247 ACGroup : CGroup from Graphic3d )
249 ---Purpose: call_togl_removegroup
251 TextContextGroup ( me : mutable;
252 ACGroup : CGroup from Graphic3d;
253 NoInsert : Integer from Standard )
255 ---Purpose: call_togl_textcontextgroup
257 -----------------------------------------
258 -- Category: Structure management methods
259 -----------------------------------------
261 ClearStructure ( me : mutable;
262 ACStructure : CStructure from Graphic3d )
264 ---Purpose: call_togl_clearstructure
266 Connect ( me : mutable;
267 AFather : CStructure from Graphic3d;
268 ASon : CStructure from Graphic3d )
270 ---Purpose: call_togl_connect
272 ContextStructure ( me : mutable;
273 ACStructure : CStructure from Graphic3d )
275 ---Purpose: call_togl_contextstructure
277 Disconnect ( me : mutable;
278 AFather : CStructure from Graphic3d;
279 ASon : CStructure from Graphic3d )
281 ---Purpose: call_togl_disconnect
283 DisplayStructure ( me : mutable;
284 ACView : CView from Graphic3d;
285 ACStructure : CStructure from Graphic3d;
286 APriority : Integer from Standard )
288 ---Purpose: call_togl_displaystructure
290 EraseStructure ( me : mutable;
291 ACView : CView from Graphic3d;
292 ACStructure : CStructure from Graphic3d )
294 ---Purpose: call_togl_erasestructure
296 RemoveStructure ( me : mutable;
297 ACStructure : CStructure from Graphic3d )
299 ---Purpose: call_togl_removestructure
301 Structure ( me : mutable;
302 ACStructure : in out CStructure from Graphic3d )
304 ---Purpose: call_togl_structure
306 ------------------------------------
307 -- Category: Structured mode methods
308 ------------------------------------
310 ActivateView ( me : mutable;
311 ACView : CView from Graphic3d )
313 ---Purpose: call_togl_activateview
315 AntiAliasing ( me : mutable;
316 ACView : CView from Graphic3d;
317 AFlag : Boolean from Standard )
319 ---Purpose: call_togl_antialiasing
321 Background ( me : mutable;
322 ACView : CView from Graphic3d )
324 ---Purpose: call_togl_background
326 GradientBackground ( me : mutable;
327 ACView : CView from Graphic3d;
328 AColor1: Color from Quantity;
329 AColor2: Color from Quantity;
330 FillStyle : GradientFillMethod from Aspect
333 ---Purpose: call_togl_gradient_background
336 BackgroundImage( me : mutable;
337 FileName : CString from Standard;
338 ACView : CView from Graphic3d;
339 FillStyle : FillMethod from Aspect )
342 SetBgImageStyle( me : mutable;
343 ACView : CView from Graphic3d;
344 FillStyle : FillMethod from Aspect )
347 SetBgGradientStyle( me : mutable;
348 ACView : CView from Graphic3d;
349 FillStyle : GradientFillMethod from Aspect )
352 ClipLimit ( me : mutable;
353 ACView : CView from Graphic3d;
354 AWait : Boolean from Standard )
356 ---Purpose: call_togl_cliplimit
358 DeactivateView ( me : mutable;
359 ACView : CView from Graphic3d )
361 ---Purpose: call_togl_deactivateview
363 DepthCueing ( me : mutable;
364 ACView : CView from Graphic3d;
365 AFlag : Boolean from Standard )
367 ---Purpose: call_togl_cliplimit
369 ProjectRaster ( me : mutable;
370 ACView : CView from Graphic3d;
371 AX : ShortReal from Standard;
372 AY : ShortReal from Standard;
373 AZ : ShortReal from Standard;
374 AU : out Integer from Standard;
375 AV : out Integer from Standard )
376 returns Boolean from Standard
378 ---Purpose: call_togl_unproject_raster
380 UnProjectRaster ( me : mutable;
381 ACView : CView from Graphic3d;
382 Axm : Integer from Standard;
383 Aym : Integer from Standard;
384 AXM : Integer from Standard;
385 AYM : Integer from Standard;
386 AU : Integer from Standard;
387 AV : Integer from Standard;
388 AX : out ShortReal from Standard;
389 AY : out ShortReal from Standard;
390 AZ : out ShortReal from Standard )
391 returns Boolean from Standard
393 ---Purpose: call_togl_unproject_raster
395 UnProjectRasterWithRay ( me : mutable;
396 ACView : CView from Graphic3d;
397 Axm : Integer from Standard;
398 Aym : Integer from Standard;
399 AXM : Integer from Standard;
400 AYM : Integer from Standard;
401 AU : Integer from Standard;
402 AV : Integer from Standard;
403 AX : out ShortReal from Standard;
404 AY : out ShortReal from Standard;
405 AZ : out ShortReal from Standard;
406 DX : out ShortReal from Standard;
407 DY : out ShortReal from Standard;
408 DZ : out ShortReal from Standard )
409 returns Boolean from Standard
411 ---Purpose: call_togl_unproject_raster_with_ray
413 RatioWindow ( me : mutable;
414 ACView : CView from Graphic3d )
416 ---Purpose: call_togl_ratio_window
418 Redraw ( me : mutable;
419 ACView : CView from Graphic3d;
420 ACUnderLayer : CLayer2d from Aspect;
421 ACOverLayer : CLayer2d from Aspect;
425 height : Integer = 0 )
427 ---Purpose: call_togl_redraw
428 -- Warning: when the redraw area has a null size, the full view is redrawn
430 RemoveView ( me : mutable;
431 ACView : CView from Graphic3d )
433 ---Purpose: call_togl_removeview
435 SetLight ( me : mutable;
436 ACView : CView from Graphic3d )
438 ---Purpose: call_togl_setlight
440 SetPlane ( me : mutable;
441 ACView : CView from Graphic3d )
443 ---Purpose: call_togl_setplane
445 SetVisualisation ( me : mutable;
446 ACView : CView from Graphic3d )
448 ---Purpose: call_togl_setvisualisation
450 TransformStructure ( me : mutable;
451 ACStructure : CStructure from Graphic3d )
453 ---Purpose: call_togl_transformstructure
455 DegenerateStructure ( me : mutable;
456 ACStructure : CStructure from Graphic3d )
458 ---Purpose: call_togl_degeneratestructure
460 Transparency ( me : mutable;
461 ACView : CView from Graphic3d;
462 AFlag : Boolean from Standard )
464 ---Purpose: call_togl_transparency
466 Update ( me : mutable;
467 ACView : CView from Graphic3d;
468 ACUnderLayer : CLayer2d from Aspect;
469 ACOverLayer : CLayer2d from Aspect )
471 ---Purpose: call_togl_update
474 ACView : in out CView from Graphic3d )
475 returns Boolean from Standard
477 ---Purpose: call_togl_view
479 ViewMapping ( me : mutable;
480 ACView : CView from Graphic3d;
481 AWait : Boolean from Standard )
483 ---Purpose: call_togl_viewmapping
485 ViewOrientation ( me : mutable;
486 ACView : CView from Graphic3d;
487 AWait : Boolean from Standard )
489 ---Purpose: call_togl_vieworientation
491 Environment ( me : mutable;
492 ACView : CView from Graphic3d )
496 ----------------------------------------
497 -- Category: Methods to create Marker
498 -- for Purpose : see Graphic3d_Group.cdl
499 ----------------------------------------
501 Marker ( me : mutable;
502 ACGroup : CGroup from Graphic3d;
503 APoint : Vertex from Graphic3d;
504 EvalMinMax : Boolean from Standard = Standard_True )
507 MarkerSet ( me : mutable;
508 ACGroup : CGroup from Graphic3d;
509 ListVertex : Array1OfVertex from Graphic3d;
510 EvalMinMax : Boolean from Standard = Standard_True )
513 ----------------------------------------
514 -- Category: Methods to create Polygon
515 -- for Purpose : see Graphic3d_Group.cdl
516 ----------------------------------------
518 Polygon ( me : mutable;
519 ACGroup : CGroup from Graphic3d;
520 ListVertex : Array1OfVertex from Graphic3d;
521 AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
522 EvalMinMax : Boolean from Standard = Standard_True )
524 ---Purpose: call_togl_polygon
526 ----------------------------------------
527 -- Category: Methods to create Text
528 -- for Purpose : see Graphic3d_Group.cdl
529 ----------------------------------------
532 ACGroup : CGroup from Graphic3d;
533 AText : CString from Standard;
534 APoint : Vertex from Graphic3d;
535 AHeight : Real from Standard;
536 AAngle : PlaneAngle from Quantity;
537 ATp : TextPath from Graphic3d;
538 AHta : HorizontalTextAlignment from Graphic3d;
539 AVta : VerticalTextAlignment from Graphic3d;
540 EvalMinMax : Boolean from Standard = Standard_True )
542 ---Purpose: call_togl_text
545 ACGroup : CGroup from Graphic3d;
546 AText : CString from Standard;
547 APoint : Vertex from Graphic3d;
548 AHeight : Real from Standard;
549 EvalMinMax : Boolean from Standard = Standard_True )
551 ---Purpose: call_togl_text
554 ACGroup : CGroup from Graphic3d;
555 AText : ExtendedString from TCollection;
556 APoint : Vertex from Graphic3d;
557 AHeight : Real from Standard;
558 AAngle : PlaneAngle from Quantity;
559 ATp : TextPath from Graphic3d;
560 AHta : HorizontalTextAlignment from Graphic3d;
561 AVta : VerticalTextAlignment from Graphic3d;
562 EvalMinMax : Boolean from Standard = Standard_True )
564 ---Purpose: call_togl_text
567 ACGroup : CGroup from Graphic3d;
568 AText : ExtendedString from TCollection;
569 APoint : Vertex from Graphic3d;
570 AHeight : Real from Standard;
571 EvalMinMax : Boolean from Standard = Standard_True )
573 ---Purpose: call_togl_text
575 ----------------------------------------
576 ---Category: Methods to create Triangle
577 -- for Purpose : see Graphic3d_Group.cdl
578 ----------------------------------------
580 PrimitiveArray( me : mutable;
581 ACGroup : CGroup from Graphic3d;
582 parray : PrimitiveArray from Graphic3d;
583 EvalMinMax : Boolean from Standard = Standard_True )
585 ---Purpose: call_togl_parray
587 UserDraw( me : mutable;
588 ACGroup : CGroup from Graphic3d;
589 AUserDraw : CUserDraw from Graphic3d )
591 ---Purpose: call_togl_userdraw
593 EnableVBO( me : mutable;
594 status : Boolean from Standard )
596 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
599 theFreeBytes : out Size from Standard;
600 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
601 ---Purpose: Returns information about GPU memory usage.
603 ----------------------------------------
604 ---Category: Methods to create Triedron
605 -- for Purpose : see Graphic3d_Group.cdl
606 ----------------------------------------
608 ZBufferTriedronSetup ( me : mutable;
609 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
610 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
611 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
612 SizeRatio : Real from Standard = 0.8;
613 AxisDiametr : Real from Standard = 0.05;
614 NbFacettes : Integer from Standard = 12)
616 ---Purpose: call_togl_ztriedron_setup
618 TriedronDisplay ( me : mutable;
619 ACView : CView from Graphic3d;
620 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
621 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
622 AScale : Real from Standard = 0.02;
623 AsWireframe : Boolean from Standard = Standard_True )
625 ---Purpose: call_togl_triedron_display
628 TriedronErase ( me : mutable;
629 ACView : CView from Graphic3d)
631 ---Purpose: call_togl_triedron_erase
634 TriedronEcho ( me : mutable;
635 ACView : CView from Graphic3d;
636 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
638 ---Purpose: call_togl_triedron_echo
640 ---------------------------------
641 ---Category: Graduated trihedron
642 ---------------------------------
644 GraduatedTrihedronDisplay(me : mutable;
645 view : CView from Graphic3d;
646 cubic : CGraduatedTrihedron from Graphic3d)
647 ---Purpose: call_togl_graduatedtrihedron_display
650 GraduatedTrihedronErase(me : mutable;
651 view : CView from Graphic3d)
652 ---Purpose: call_togl_graduatedtrihedron_erase
655 GraduatedTrihedronMinMaxValues(me : mutable;
656 xmin : ShortReal from Standard;
657 ymin : ShortReal from Standard;
658 zmin : ShortReal from Standard;
659 xmax : ShortReal from Standard;
660 ymax : ShortReal from Standard;
661 zmax : ShortReal from Standard)
662 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
665 ---------------------------
666 -- Category: Animation mode
667 ---------------------------
669 BeginAnimation ( me : mutable;
670 ACView : CView from Graphic3d)
672 ---Purpose: call_togl_begin_animation
674 EndAnimation ( me : mutable;
675 ACView : CView from Graphic3d)
677 ---Purpose: call_togl_end_animation
679 ----------------------------------
680 -- Category: Ajout mode methods
681 ----------------------------------
683 BeginAddMode ( me : mutable;
684 ACView : CView from Graphic3d)
685 returns Boolean from Standard
687 ---Purpose: call_togl_begin_ajout_mode
689 EndAddMode ( me : mutable)
691 ---Purpose: call_togl_end_ajout_mode
693 ----------------------------------
694 -- Category: Immediat mode methods
695 ----------------------------------
697 BeginImmediatMode ( me : mutable;
698 ACView : CView from Graphic3d;
699 ACUnderLayer : CLayer2d from Aspect;
700 ACOverLayer : CLayer2d from Aspect;
701 DoubleBuffer : Boolean from Standard;
702 RetainMode : Boolean from Standard)
703 returns Boolean from Standard
705 ---Purpose: call_togl_begin_immediat_mode
707 BeginPolyline ( me : mutable )
709 ---Purpose: call_togl_begin_polyline
711 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
712 aFlush : Boolean from Standard = Standard_True)
714 ---Purpose: call_togl_clear_immediat_mode
717 X : ShortReal from Standard;
718 Y : ShortReal from Standard;
719 Z : ShortReal from Standard )
721 ---Purpose: call_togl_draw
723 DrawStructure ( me : mutable;
724 ACStructure : CStructure from Graphic3d )
726 ---Purpose: call_togl_draw_structure
728 EndImmediatMode ( me : mutable;
729 Synchronize : Integer from Standard )
731 ---Purpose: call_togl_end_immediat_mode
733 EndPolyline ( me : mutable )
735 ---Purpose: call_togl_end_polyline
738 X : ShortReal from Standard;
739 Y : ShortReal from Standard;
740 Z : ShortReal from Standard )
742 ---Purpose: call_togl_move
744 SetLineColor ( me : mutable;
745 R : ShortReal from Standard;
746 G : ShortReal from Standard;
747 B : ShortReal from Standard )
749 ---Purpose: call_togl_set_linecolor
751 SetLineType ( me : mutable;
752 Type : Integer from Standard )
754 ---Purpose: call_togl_set_linetype
756 SetLineWidth ( me : mutable;
757 Width : ShortReal from Standard )
759 ---Purpose: call_togl_set_linewidth
761 SetMinMax ( me : mutable;
762 X1 : ShortReal from Standard;
763 Y1 : ShortReal from Standard;
764 Z1 : ShortReal from Standard;
765 X2 : ShortReal from Standard;
766 Y2 : ShortReal from Standard;
767 Z2 : ShortReal from Standard )
769 ---Purpose: call_togl_set_minmax
771 Transform ( me : mutable;
772 AMatrix : Array2OfReal from TColStd;
773 AType : TypeOfComposition from Graphic3d )
775 ---Purpose: call_togl_transform
777 -------------------------------
778 -- Category: Layer mode methods
779 -------------------------------
781 Layer ( me : mutable;
782 ACLayer : in out CLayer2d from Aspect )
784 ---Purpose: call_togl_layer2d
786 RemoveLayer ( me : mutable;
787 ACLayer : CLayer2d from Aspect )
789 ---Purpose: call_togl_removelayer2d
791 BeginLayer ( me : mutable;
792 ACLayer : CLayer2d from Aspect )
794 ---Purpose: call_togl_begin_layer2d
796 BeginPolygon2d ( me : mutable )
798 ---Purpose: call_togl_begin_polygon2d
800 BeginPolyline2d ( me : mutable )
802 ---Purpose: call_togl_begin_polyline2d
804 ClearLayer ( me : mutable;
805 ACLayer : CLayer2d from Aspect )
807 ---Purpose: call_togl_clear_layer2d
810 X : ShortReal from Standard;
811 Y : ShortReal from Standard )
813 ---Purpose: call_togl_draw2d
816 X : ShortReal from Standard;
817 Y : ShortReal from Standard )
819 ---Purpose: call_togl_edge2d
821 EndLayer ( me : mutable )
823 ---Purpose: call_togl_end_layer2d
825 EndPolygon2d ( me : mutable )
827 ---Purpose: call_togl_end_polygon2d
829 EndPolyline2d ( me : mutable )
831 ---Purpose: call_togl_end_polyline2d
834 X : ShortReal from Standard;
835 Y : ShortReal from Standard )
837 ---Purpose: call_togl_move2d
839 Rectangle ( me : mutable;
840 X, Y : ShortReal from Standard;
841 Width, Height : ShortReal from Standard )
843 ---Purpose: call_togl_rectangle2d
845 SetColor ( me : mutable;
846 R : ShortReal from Standard;
847 G : ShortReal from Standard;
848 B : ShortReal from Standard )
850 ---Purpose: call_togl_set_color
852 SetTransparency ( me : mutable;
853 ATransparency : ShortReal from Standard )
855 ---Purpose: call_togl_set_transparency
857 UnsetTransparency ( me : mutable )
859 ---Purpose: call_togl_unset_transparency
861 SetLineAttributes ( me : mutable;
862 Type : Integer from Standard;
863 Width : ShortReal from Standard )
865 ---Purpose: call_togl_set_line_attributes
868 SetTextAttributes ( me : mutable;
869 Font : CString from Standard;
870 Type : Integer from Standard;
871 R : ShortReal from Standard;
872 G : ShortReal from Standard;
873 B : ShortReal from Standard )
875 ---Purpose: Set text attributes for under-/overlayer.
876 -- <Font> argument defines the name of the font to be used,
877 -- <Type> argument defines the display type of the text,
878 -- <R> <G> <B> values define the color of decal or subtitle background.
879 -- To set the color of the text you can use the SetColor method.
882 AText : CString from Standard;
883 X, Y : ShortReal from Standard;
884 AHeight : ShortReal from Standard )
886 ---Purpose: call_togl_text2d
887 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
889 DefaultTextHeight( me )
890 returns ShortReal from Standard
895 AText : CString from Standard;
896 AHeight : ShortReal from Standard;
897 AWidth : in out ShortReal from Standard;
898 AnAscent : in out ShortReal from Standard;
899 ADescent : in out ShortReal from Standard )
901 ---Purpose: call_togl_textsize2d
903 SetBackFacingModel ( me : mutable;
904 aView : CView from Graphic3d )
906 ---Purpose: call_togl_backfacing
908 SetDepthTestEnabled( me; view : CView from Graphic3d;
909 isEnabled : Boolean from Standard )
911 ---Purpose: call_togl_depthtest
913 IsDepthTestEnabled( me; view : CView from Graphic3d )
914 returns Boolean from Standard is deferred;
915 ---Purpose: call_togl_isdepthtest
918 view : CView from Graphic3d;
920 width, height : Integer;
923 ---Purpose: Reads depths of shown pixels of the given
924 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
926 FBOCreate( me : mutable;
927 view : CView from Graphic3d;
928 width, height : Integer from Standard )
929 returns PtrFrameBuffer from Graphic3d
931 ---Purpose: Generate offscreen FBO in the graphic library.
932 -- If not supported on hardware returns NULL.
934 FBORelease( me : mutable;
935 view : CView from Graphic3d;
936 fboPtr : in out PtrFrameBuffer from Graphic3d )
938 ---Purpose: Remove offscreen FBO from the graphic library
940 FBOGetDimensions( me : mutable;
941 view : CView from Graphic3d;
942 fboPtr : PtrFrameBuffer from Graphic3d;
943 width, height : out Integer from Standard;
944 widthMax, heightMax : out Integer from Standard )
946 ---Purpose: Read offscreen FBO configuration.
948 FBOChangeViewport( me : mutable;
949 view : CView from Graphic3d;
950 fboPtr : in out PtrFrameBuffer from Graphic3d;
951 width, height : Integer from Standard )
953 ---Purpose: Change offscreen FBO viewport.
955 BufferDump( me : mutable;
956 theCView : CView from Graphic3d;
957 theImage : in out PixMap from Image;
958 theBufferType : BufferType from Graphic3d )
959 returns Boolean from Standard
961 ---Purpose: Dump active rendering buffer into specified memory buffer.
963 SetGLLightEnabled( me; view : CView from Graphic3d;
964 isEnabled : Boolean from Standard )
966 ---Purpose: call_togl_gllight
968 IsGLLightEnabled( me; view : CView from Graphic3d )
969 returns Boolean from Standard is deferred;
970 ---Purpose: call_togl_isgllight
973 ACView : CView from Graphic3d;
974 ACUnderLayer : CLayer2d from Aspect;
975 ACOverLayer : CLayer2d from Aspect;
976 hPrnDC : Handle from Aspect;
977 showBackground : Boolean;
979 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
980 theScaleFactor : Real from Standard = 1.0 )
981 returns Boolean from Standard is deferred;
983 ---Purpose: print the contents of all layers of the view to the printer.
984 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
985 -- <showBackground> : When set to FALSE then print the view without background color
986 -- (background is white)
987 -- else set to TRUE for printing with current background color.
988 -- <filename>: If != NULL, then the view will be printed to a file.
989 -- <printAlgorithm>: Select print algorithm: stretch, tile.
990 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
991 -- printings accordingly to the scale factor selected in the printer
992 -- properties dialog.
993 -- Returns Standard_True if the data is passed to the printer, otherwise
994 -- Standard_False if the print operation failed due to the printer errors,
995 -- or insufficient system memory available.
996 ---Warning: Works only under Windows.
999 theFileName : CString from Standard;
1000 theFormat : ExportFormat from Graphic3d;
1001 theSortType : SortType from Graphic3d;
1002 theWidth, theHeight : Integer from Standard;
1003 theView : CView from Graphic3d;
1004 theLayerUnder : CLayer2d from Aspect;
1005 theLayerOver : CLayer2d from Aspect;
1006 thePrecision : Real from Standard = 0.005;
1007 theProgressBarFunc : Address from Standard = NULL;
1008 theProgressObject : Address from Standard = NULL )
1009 returns Boolean from Standard
1012 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1013 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1014 -- Notice however that results may differ a lot and do not contain some elements.
1016 RemovePrimitiveArray( me : mutable;
1017 theCGroup : CGroup from Graphic3d;
1018 thePArray : PrimitiveArray from Graphic3d )
1020 ---Purpose: Clear visualization data in graphical driver and
1021 -- stop displaying the primitives array of the graphical group
1022 -- <theCGroup>. This method is internal and should be used
1023 -- by Graphic3d_Group only.
1025 AddZLayer( me : mutable;
1026 theCView : CView from Graphic3d;
1027 theLayerId : Integer from Standard )
1029 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
1030 -- the view. Z layers allow drawing structures in higher layers
1031 -- in foreground of structures in lower layers. To add a structure
1032 -- to desired layer on display it is necessary to set the layer
1033 -- ID for the structure.
1035 RemoveZLayer( me : mutable;
1036 theCView : CView from Graphic3d;
1037 theLayerId : Integer from Standard )
1039 ---Purpose: Remove Z layer from the specified view. All structures
1040 -- displayed at the moment in layer will be displayed in default layer
1041 -- ( the bottom-level z layer ). To unset layer ID from associated
1042 -- structures use method UnsetZLayer (...).
1044 UnsetZLayer( me : mutable;
1045 theLayerId : Integer from Standard )
1047 ---Purpose: Unset Z layer ID for all structures. The structure
1048 -- indexes will be set to default layer ( the bottom-level z layer
1051 ChangeZLayer( me : mutable;
1052 theCStructure : CStructure from Graphic3d;
1053 theLayerId : Integer from Standard )
1055 ---Purpose: Change Z layer of a structure. The new z layer ID will
1056 -- be used to define the associated layer for structure on display.
1058 ChangeZLayer( me : mutable;
1059 theCStructure : CStructure from Graphic3d;
1060 theCView : CView from Graphic3d;
1061 theNewLayerId : Integer from Standard )
1063 ---Purpose: Change Z layer of a structure already presented in view.
1066 theCStructure : CStructure from Graphic3d )
1067 returns Integer from Standard is deferred;
1068 ---Purpose: Get Z layer ID of structure. If the structure doesn't
1069 -- exists in graphic driver, the method returns -1.
1071 --------------------------
1072 -- Category: Class methods
1073 --------------------------
1076 ACLight : CLight from Graphic3d;
1077 Update : Boolean from Standard )
1078 returns Integer from Standard;
1079 ---Purpose: call_togl_light
1082 ACPlane : CPlane from Graphic3d;
1083 Update : Boolean from Standard )
1084 returns Integer from Standard;
1085 ---Purpose: call_togl_plane
1087 -----------------------------
1088 -- Category: Internal methods
1089 -----------------------------
1092 AComment : CString from Standard;
1093 AValue : Boolean from Standard );
1096 ACGroup : CGroup from Graphic3d;
1097 AField : Integer from Standard );
1100 ACLight : CLight from Graphic3d;
1101 AField : Integer from Standard );
1104 ACPick : CPick from Graphic3d;
1105 AField : Integer from Standard );
1108 ACPlane : CPlane from Graphic3d;
1109 AField : Integer from Standard );
1111 PrintCStructure ( me;
1112 ACStructure : CStructure from Graphic3d;
1113 AField : Integer from Standard );
1116 ACView : CView from Graphic3d;
1117 AField : Integer from Standard );
1120 AFunc : CString from Standard );
1123 AComment : CString from Standard;
1124 AValue : Integer from Standard );
1127 AFunc : CString from Standard;
1128 AResult : Integer from Standard );
1130 PrintShortReal ( me;
1131 AComment : CString from Standard;
1132 AValue : ShortReal from Standard );
1135 AComment : CString from Standard;
1136 AMatrix : Array2OfReal from TColStd )
1137 raises TransformError from Graphic3d;
1140 AComment : CString from Standard;
1141 AString : CString from Standard );
1143 SetTrace ( me : mutable;
1144 ALevel : Integer from Standard )
1148 returns Integer from Standard
1151 --ListOfAvalableFontNames( me;
1152 -- lst: out NListOfHAsciiString from Graphic3d )
1153 -- returns Boolean from Standard
1155 -- Purpose: Initialize list of names of avalable system fonts
1156 -- returns Standard_False if fails
1157 -- ABD Integration support of system fonts (using FTGL and FreeType)
1161 MyTraceLevel : Integer from Standard is protected;
1162 MySharedLibrary : SharedLibrary from OSD is protected;
1164 end GraphicDriver from Graphic3d;