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 TShared
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 TypeOfTriedronEcho from Aspect,
55 TypeOfTriedronPosition from Aspect,
58 PrintAlgo from Aspect,
59 DisplayConnection_Handle 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 TypeOfPrimitive from Graphic3d,
78 Vector from Graphic3d,
79 Array1OfVertex from Graphic3d,
80 Array2OfVertex from Graphic3d,
81 Vertex from Graphic3d,
82 VerticalTextAlignment from Graphic3d,
83 PrimitiveArray from Graphic3d,
84 PtrFrameBuffer from Graphic3d,
85 HArray1OfByte from TColStd,
86 FillMethod from Aspect,
87 GradientFillMethod from Aspect,
88 ExportFormat from Graphic3d,
89 SortType from Graphic3d,
90 HArray1OfReal from TColStd,
91 CUserDraw from Graphic3d,
92 NListOfHAsciiString from Graphic3d,
94 CGraduatedTrihedron from Graphic3d
98 TransformError from Graphic3d
101 Initialize ( AShrName : CString from Standard )
102 returns mutable GraphicDriver from Graphic3d;
104 ---Purpose: Initialises the Driver
106 -------------------------
107 -- Category: Init methods
108 -------------------------
111 theDisplayConnection: DisplayConnection_Handle from Aspect)
112 returns Boolean from Standard
114 ---Purpose: Starts graphic driver with given connection
118 ---Purpose: call_togl_end
120 ----------------------------
121 -- Category: Inquire methods
122 ----------------------------
124 InquireLightLimit ( me : mutable )
125 returns Integer from Standard
127 ---Purpose: call_togl_inquirelight
129 InquireMat ( me : mutable;
130 ACView : CView from Graphic3d;
131 AMatO : out Array2OfReal from TColStd;
132 AMatM : out Array2OfReal from TColStd )
134 ---Purpose: call_togl_inquiremat
136 InquirePlaneLimit ( me : mutable )
137 returns Integer from Standard
139 ---Purpose: call_togl_inquireplane
141 InquireViewLimit ( me : mutable )
142 returns Integer from Standard
144 ---Purpose: call_togl_inquireview
146 ------------------------------
147 -- Category: Highlight methods
148 ------------------------------
150 Blink ( me : mutable;
151 ACStructure : CStructure from Graphic3d;
152 Create : Boolean from Standard )
154 ---Purpose: call_togl_blink
156 BoundaryBox ( me : mutable;
157 ACStructure : CStructure from Graphic3d;
158 Create : Boolean from Standard )
160 ---Purpose: call_togl_boundarybox
162 HighlightColor ( me : mutable;
163 ACStructure : CStructure from Graphic3d;
164 R : ShortReal from Standard;
165 G : ShortReal from Standard;
166 B : ShortReal from Standard;
167 Create : Boolean from Standard )
169 ---Purpose: call_togl_highlightcolor
171 NameSetStructure ( me : mutable;
172 ACStructure : CStructure from Graphic3d )
174 ---Purpose: call_togl_namesetstructure
176 -------------------------------------
177 -- Category: Group management methods
178 -------------------------------------
180 ClearGroup ( me : mutable;
181 ACGroup : CGroup from Graphic3d )
183 ---Purpose: call_togl_cleargroup
185 FaceContextGroup ( me : mutable;
186 ACGroup : CGroup from Graphic3d;
187 NoInsert : Integer from Standard )
189 ---Purpose: call_togl_facecontextgroup
191 Group ( me : mutable;
192 ACGroup : in out CGroup from Graphic3d )
194 ---Purpose: call_togl_group
196 LineContextGroup ( me : mutable;
197 ACGroup : CGroup from Graphic3d;
198 NoInsert : Integer from Standard )
200 ---Purpose: call_togl_linecontextgroup
202 MarkerContextGroup ( me : mutable;
203 ACGroup : CGroup from Graphic3d;
204 NoInsert : Integer from Standard )
206 ---Purpose: call_togl_markercontextgroup
208 MarkerContextGroup ( me : mutable;
209 ACGroup : CGroup from Graphic3d;
210 NoInsert : Integer from Standard;
211 AMarkWidth : Integer from Standard;
212 AMarkHeight: Integer from Standard;
213 ATexture : HArray1OfByte from TColStd )
215 ---Purpose: call_togl_markercontextgroup
217 RemoveGroup ( me : mutable;
218 ACGroup : CGroup from Graphic3d )
220 ---Purpose: call_togl_removegroup
222 TextContextGroup ( me : mutable;
223 ACGroup : CGroup from Graphic3d;
224 NoInsert : Integer from Standard )
226 ---Purpose: call_togl_textcontextgroup
228 -----------------------------------------
229 -- Category: Structure management methods
230 -----------------------------------------
232 ClearStructure ( me : mutable;
233 ACStructure : CStructure from Graphic3d )
235 ---Purpose: call_togl_clearstructure
237 Connect ( me : mutable;
238 AFather : CStructure from Graphic3d;
239 ASon : CStructure from Graphic3d )
241 ---Purpose: call_togl_connect
243 ContextStructure ( me : mutable;
244 ACStructure : CStructure from Graphic3d )
246 ---Purpose: call_togl_contextstructure
248 Disconnect ( me : mutable;
249 AFather : CStructure from Graphic3d;
250 ASon : CStructure from Graphic3d )
252 ---Purpose: call_togl_disconnect
254 DisplayStructure ( me : mutable;
255 ACView : CView from Graphic3d;
256 ACStructure : CStructure from Graphic3d;
257 APriority : Integer from Standard )
259 ---Purpose: call_togl_displaystructure
261 EraseStructure ( me : mutable;
262 ACView : CView from Graphic3d;
263 ACStructure : CStructure from Graphic3d )
265 ---Purpose: call_togl_erasestructure
267 RemoveStructure ( me : mutable;
268 ACStructure : CStructure from Graphic3d )
270 ---Purpose: call_togl_removestructure
272 Structure ( me : mutable;
273 ACStructure : in out CStructure from Graphic3d )
275 ---Purpose: call_togl_structure
277 ------------------------------------
278 -- Category: Structured mode methods
279 ------------------------------------
281 ActivateView ( me : mutable;
282 ACView : CView from Graphic3d )
284 ---Purpose: call_togl_activateview
286 AntiAliasing ( me : mutable;
287 ACView : CView from Graphic3d;
288 AFlag : Boolean from Standard )
290 ---Purpose: call_togl_antialiasing
292 Background ( me : mutable;
293 ACView : CView from Graphic3d )
295 ---Purpose: call_togl_background
297 GradientBackground ( me : mutable;
298 ACView : CView from Graphic3d;
299 AColor1: Color from Quantity;
300 AColor2: Color from Quantity;
301 FillStyle : GradientFillMethod from Aspect
304 ---Purpose: call_togl_gradient_background
307 BackgroundImage( me : mutable;
308 FileName : CString from Standard;
309 ACView : CView from Graphic3d;
310 FillStyle : FillMethod from Aspect )
313 SetBgImageStyle( me : mutable;
314 ACView : CView from Graphic3d;
315 FillStyle : FillMethod from Aspect )
318 SetBgGradientStyle( me : mutable;
319 ACView : CView from Graphic3d;
320 FillStyle : GradientFillMethod from Aspect )
323 ClipLimit ( me : mutable;
324 ACView : CView from Graphic3d;
325 AWait : Boolean from Standard )
327 ---Purpose: call_togl_cliplimit
329 DeactivateView ( me : mutable;
330 ACView : CView from Graphic3d )
332 ---Purpose: call_togl_deactivateview
334 DepthCueing ( me : mutable;
335 ACView : CView from Graphic3d;
336 AFlag : Boolean from Standard )
338 ---Purpose: call_togl_cliplimit
340 ProjectRaster ( me : mutable;
341 ACView : CView from Graphic3d;
342 AX : ShortReal from Standard;
343 AY : ShortReal from Standard;
344 AZ : ShortReal from Standard;
345 AU : out Integer from Standard;
346 AV : out Integer from Standard )
347 returns Boolean from Standard
349 ---Purpose: call_togl_unproject_raster
351 UnProjectRaster ( me : mutable;
352 ACView : CView from Graphic3d;
353 Axm : Integer from Standard;
354 Aym : Integer from Standard;
355 AXM : Integer from Standard;
356 AYM : Integer from Standard;
357 AU : Integer from Standard;
358 AV : Integer from Standard;
359 AX : out ShortReal from Standard;
360 AY : out ShortReal from Standard;
361 AZ : out ShortReal from Standard )
362 returns Boolean from Standard
364 ---Purpose: call_togl_unproject_raster
366 UnProjectRasterWithRay ( me : mutable;
367 ACView : CView from Graphic3d;
368 Axm : Integer from Standard;
369 Aym : Integer from Standard;
370 AXM : Integer from Standard;
371 AYM : Integer from Standard;
372 AU : Integer from Standard;
373 AV : Integer from Standard;
374 AX : out ShortReal from Standard;
375 AY : out ShortReal from Standard;
376 AZ : out ShortReal from Standard;
377 DX : out ShortReal from Standard;
378 DY : out ShortReal from Standard;
379 DZ : out ShortReal from Standard )
380 returns Boolean from Standard
382 ---Purpose: call_togl_unproject_raster_with_ray
384 RatioWindow ( me : mutable;
385 ACView : CView from Graphic3d )
387 ---Purpose: call_togl_ratio_window
389 Redraw ( me : mutable;
390 ACView : CView from Graphic3d;
391 ACUnderLayer : CLayer2d from Aspect;
392 ACOverLayer : CLayer2d from Aspect;
396 height : Integer = 0 )
398 ---Purpose: call_togl_redraw
399 -- Warning: when the redraw area has a null size, the full view is redrawn
401 RemoveView ( me : mutable;
402 ACView : CView from Graphic3d )
404 ---Purpose: call_togl_removeview
406 SetLight ( me : mutable;
407 ACView : CView from Graphic3d )
409 ---Purpose: call_togl_setlight
411 SetPlane ( me : mutable;
412 ACView : CView from Graphic3d )
414 ---Purpose: call_togl_setplane
416 SetVisualisation ( me : mutable;
417 ACView : CView from Graphic3d )
419 ---Purpose: call_togl_setvisualisation
421 TransformStructure ( me : mutable;
422 ACStructure : CStructure from Graphic3d )
424 ---Purpose: call_togl_transformstructure
426 DegenerateStructure ( me : mutable;
427 ACStructure : CStructure from Graphic3d )
429 ---Purpose: call_togl_degeneratestructure
431 Transparency ( me : mutable;
432 ACView : CView from Graphic3d;
433 AFlag : Boolean from Standard )
435 ---Purpose: call_togl_transparency
437 Update ( me : mutable;
438 ACView : CView from Graphic3d;
439 ACUnderLayer : CLayer2d from Aspect;
440 ACOverLayer : CLayer2d from Aspect )
442 ---Purpose: call_togl_update
445 ACView : in out CView from Graphic3d )
446 returns Boolean from Standard
448 ---Purpose: call_togl_view
450 ViewMapping ( me : mutable;
451 ACView : CView from Graphic3d;
452 AWait : Boolean from Standard )
454 ---Purpose: call_togl_viewmapping
456 ViewOrientation ( me : mutable;
457 ACView : CView from Graphic3d;
458 AWait : Boolean from Standard )
460 ---Purpose: call_togl_vieworientation
462 Environment ( me : mutable;
463 ACView : CView from Graphic3d )
467 ----------------------------------------
468 -- Category: Methods to create Marker
469 -- for Purpose : see Graphic3d_Group.cdl
470 ----------------------------------------
472 Marker ( me : mutable;
473 ACGroup : CGroup from Graphic3d;
474 APoint : Vertex from Graphic3d )
477 MarkerSet ( me : mutable;
478 ACGroup : CGroup from Graphic3d;
479 ListVertex : Array1OfVertex from Graphic3d )
482 ----------------------------------------
483 -- Category: Methods to create Text
484 -- for Purpose : see Graphic3d_Group.cdl
485 ----------------------------------------
488 ACGroup : CGroup from Graphic3d;
489 AText : CString from Standard;
490 APoint : Vertex from Graphic3d;
491 AHeight : Real from Standard;
492 AAngle : PlaneAngle from Quantity;
493 ATp : TextPath from Graphic3d;
494 AHta : HorizontalTextAlignment from Graphic3d;
495 AVta : VerticalTextAlignment from Graphic3d;
496 EvalMinMax : Boolean from Standard = Standard_True )
498 ---Purpose: call_togl_text
501 ACGroup : CGroup from Graphic3d;
502 AText : CString from Standard;
503 APoint : Vertex from Graphic3d;
504 AHeight : Real from Standard;
505 EvalMinMax : Boolean from Standard = Standard_True )
507 ---Purpose: call_togl_text
510 ACGroup : CGroup from Graphic3d;
511 AText : ExtendedString from TCollection;
512 APoint : Vertex from Graphic3d;
513 AHeight : Real from Standard;
514 AAngle : PlaneAngle from Quantity;
515 ATp : TextPath from Graphic3d;
516 AHta : HorizontalTextAlignment from Graphic3d;
517 AVta : VerticalTextAlignment from Graphic3d;
518 EvalMinMax : Boolean from Standard = Standard_True )
520 ---Purpose: call_togl_text
523 ACGroup : CGroup from Graphic3d;
524 AText : ExtendedString from TCollection;
525 APoint : Vertex from Graphic3d;
526 AHeight : Real from Standard;
527 EvalMinMax : Boolean from Standard = Standard_True )
529 ---Purpose: call_togl_text
531 ----------------------------------------
532 ---Category: Methods to create Triangle
533 -- for Purpose : see Graphic3d_Group.cdl
534 ----------------------------------------
536 PrimitiveArray( me : mutable;
537 ACGroup : CGroup from Graphic3d;
538 parray : PrimitiveArray from Graphic3d;
539 EvalMinMax : Boolean from Standard = Standard_True )
541 ---Purpose: call_togl_parray
543 UserDraw( me : mutable;
544 ACGroup : CGroup from Graphic3d;
545 AUserDraw : CUserDraw from Graphic3d )
547 ---Purpose: call_togl_userdraw
549 EnableVBO( me : mutable;
550 status : Boolean from Standard )
552 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
555 theFreeBytes : out Size from Standard;
556 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
557 ---Purpose: Returns information about GPU memory usage.
559 ----------------------------------------
560 ---Category: Methods to create Triedron
561 -- for Purpose : see Graphic3d_Group.cdl
562 ----------------------------------------
564 ZBufferTriedronSetup ( me : mutable;
565 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
566 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
567 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
568 SizeRatio : Real from Standard = 0.8;
569 AxisDiametr : Real from Standard = 0.05;
570 NbFacettes : Integer from Standard = 12)
572 ---Purpose: call_togl_ztriedron_setup
574 TriedronDisplay ( me : mutable;
575 ACView : CView from Graphic3d;
576 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
577 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
578 AScale : Real from Standard = 0.02;
579 AsWireframe : Boolean from Standard = Standard_True )
581 ---Purpose: call_togl_triedron_display
584 TriedronErase ( me : mutable;
585 ACView : CView from Graphic3d)
587 ---Purpose: call_togl_triedron_erase
590 TriedronEcho ( me : mutable;
591 ACView : CView from Graphic3d;
592 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
594 ---Purpose: call_togl_triedron_echo
596 ---------------------------------
597 ---Category: Graduated trihedron
598 ---------------------------------
600 GraduatedTrihedronDisplay(me : mutable;
601 view : CView from Graphic3d;
602 cubic : CGraduatedTrihedron from Graphic3d)
603 ---Purpose: call_togl_graduatedtrihedron_display
606 GraduatedTrihedronErase(me : mutable;
607 view : CView from Graphic3d)
608 ---Purpose: call_togl_graduatedtrihedron_erase
611 GraduatedTrihedronMinMaxValues(me : mutable;
612 xmin : ShortReal from Standard;
613 ymin : ShortReal from Standard;
614 zmin : ShortReal from Standard;
615 xmax : ShortReal from Standard;
616 ymax : ShortReal from Standard;
617 zmax : ShortReal from Standard)
618 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
621 ---------------------------
622 -- Category: Animation mode
623 ---------------------------
625 BeginAnimation ( me : mutable;
626 ACView : CView from Graphic3d)
628 ---Purpose: call_togl_begin_animation
630 EndAnimation ( me : mutable;
631 ACView : CView from Graphic3d)
633 ---Purpose: call_togl_end_animation
635 ----------------------------------
636 -- Category: Ajout mode methods
637 ----------------------------------
639 BeginAddMode ( me : mutable;
640 ACView : CView from Graphic3d)
641 returns Boolean from Standard
643 ---Purpose: call_togl_begin_ajout_mode
645 EndAddMode ( me : mutable)
647 ---Purpose: call_togl_end_ajout_mode
649 ----------------------------------
650 -- Category: Immediat mode methods
651 ----------------------------------
653 SetImmediateModeDrawToFront (me : mutable;
654 theCView : CView from Graphic3d;
655 theDrawToFrontBuffer : Boolean from Standard)
656 returns Boolean from Standard
658 ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
659 -- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
660 -- Fast, so preferred for interactive work (used by default).
661 -- However these extra drawings will be missed in image dump since it is performed from back buffer.
662 -- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
663 -- in run-time (in case of slow hardware) and/or tearing may appear.
664 -- So this is strongly recommended to draw only simple (fast) structures.
665 -- 2. FALSE. Drawing immediate mode structures to the back buffer.
666 -- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
667 -- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
668 -- @return previous mode.
670 BeginImmediatMode ( me : mutable;
671 ACView : CView from Graphic3d;
672 ACUnderLayer : CLayer2d from Aspect;
673 ACOverLayer : CLayer2d from Aspect;
674 DoubleBuffer : Boolean from Standard;
675 RetainMode : Boolean from Standard)
676 returns Boolean from Standard
678 ---Purpose: call_togl_begin_immediat_mode
680 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
681 aFlush : Boolean from Standard = Standard_True)
683 ---Purpose: call_togl_clear_immediat_mode
685 DrawStructure ( me : mutable;
686 ACStructure : CStructure from Graphic3d )
688 ---Purpose: call_togl_draw_structure
690 EndImmediatMode ( me : mutable;
691 Synchronize : Integer from Standard )
693 ---Purpose: call_togl_end_immediat_mode
695 -------------------------------
696 -- Category: Layer mode methods
697 -------------------------------
699 Layer ( me : mutable;
700 ACLayer : in out CLayer2d from Aspect )
702 ---Purpose: call_togl_layer2d
704 RemoveLayer ( me : mutable;
705 ACLayer : CLayer2d from Aspect )
707 ---Purpose: call_togl_removelayer2d
709 BeginLayer ( me : mutable;
710 ACLayer : CLayer2d from Aspect )
712 ---Purpose: call_togl_begin_layer2d
714 BeginPolygon2d ( me : mutable )
716 ---Purpose: call_togl_begin_polygon2d
718 BeginPolyline2d ( me : mutable )
720 ---Purpose: call_togl_begin_polyline2d
722 ClearLayer ( me : mutable;
723 ACLayer : CLayer2d from Aspect )
725 ---Purpose: call_togl_clear_layer2d
728 X : ShortReal from Standard;
729 Y : ShortReal from Standard )
731 ---Purpose: call_togl_draw2d
734 X : ShortReal from Standard;
735 Y : ShortReal from Standard )
737 ---Purpose: call_togl_edge2d
739 EndLayer ( me : mutable )
741 ---Purpose: call_togl_end_layer2d
743 EndPolygon2d ( me : mutable )
745 ---Purpose: call_togl_end_polygon2d
747 EndPolyline2d ( me : mutable )
749 ---Purpose: call_togl_end_polyline2d
752 X : ShortReal from Standard;
753 Y : ShortReal from Standard )
755 ---Purpose: call_togl_move2d
757 Rectangle ( me : mutable;
758 X, Y : ShortReal from Standard;
759 Width, Height : ShortReal from Standard )
761 ---Purpose: call_togl_rectangle2d
763 SetColor ( me : mutable;
764 R : ShortReal from Standard;
765 G : ShortReal from Standard;
766 B : ShortReal from Standard )
768 ---Purpose: call_togl_set_color
770 SetTransparency ( me : mutable;
771 ATransparency : ShortReal from Standard )
773 ---Purpose: call_togl_set_transparency
775 UnsetTransparency ( me : mutable )
777 ---Purpose: call_togl_unset_transparency
779 SetLineAttributes ( me : mutable;
780 Type : Integer from Standard;
781 Width : ShortReal from Standard )
783 ---Purpose: call_togl_set_line_attributes
786 SetTextAttributes ( me : mutable;
787 Font : CString from Standard;
788 Type : Integer from Standard;
789 R : ShortReal from Standard;
790 G : ShortReal from Standard;
791 B : ShortReal from Standard )
793 ---Purpose: Set text attributes for under-/overlayer.
794 -- <Font> argument defines the name of the font to be used,
795 -- <Type> argument defines the display type of the text,
796 -- <R> <G> <B> values define the color of decal or subtitle background.
797 -- To set the color of the text you can use the SetColor method.
800 AText : CString from Standard;
801 X, Y : ShortReal from Standard;
802 AHeight : ShortReal from Standard )
804 ---Purpose: call_togl_text2d
805 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
807 DefaultTextHeight( me )
808 returns ShortReal from Standard
813 AText : CString from Standard;
814 AHeight : ShortReal from Standard;
815 AWidth : in out ShortReal from Standard;
816 AnAscent : in out ShortReal from Standard;
817 ADescent : in out ShortReal from Standard )
819 ---Purpose: call_togl_textsize2d
821 SetBackFacingModel ( me : mutable;
822 aView : CView from Graphic3d )
824 ---Purpose: call_togl_backfacing
826 SetDepthTestEnabled( me; view : CView from Graphic3d;
827 isEnabled : Boolean from Standard )
829 ---Purpose: call_togl_depthtest
831 IsDepthTestEnabled( me; view : CView from Graphic3d )
832 returns Boolean from Standard is deferred;
833 ---Purpose: call_togl_isdepthtest
836 view : CView from Graphic3d;
838 width, height : Integer;
841 ---Purpose: Reads depths of shown pixels of the given
842 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
844 FBOCreate( me : mutable;
845 view : CView from Graphic3d;
846 width, height : Integer from Standard )
847 returns PtrFrameBuffer from Graphic3d
849 ---Purpose: Generate offscreen FBO in the graphic library.
850 -- If not supported on hardware returns NULL.
852 FBORelease( me : mutable;
853 view : CView from Graphic3d;
854 fboPtr : in out PtrFrameBuffer from Graphic3d )
856 ---Purpose: Remove offscreen FBO from the graphic library
858 FBOGetDimensions( me : mutable;
859 view : CView from Graphic3d;
860 fboPtr : PtrFrameBuffer from Graphic3d;
861 width, height : out Integer from Standard;
862 widthMax, heightMax : out Integer from Standard )
864 ---Purpose: Read offscreen FBO configuration.
866 FBOChangeViewport( me : mutable;
867 view : CView from Graphic3d;
868 fboPtr : in out PtrFrameBuffer from Graphic3d;
869 width, height : Integer from Standard )
871 ---Purpose: Change offscreen FBO viewport.
873 BufferDump( me : mutable;
874 theCView : CView from Graphic3d;
875 theImage : in out PixMap from Image;
876 theBufferType : BufferType from Graphic3d )
877 returns Boolean from Standard
879 ---Purpose: Dump active rendering buffer into specified memory buffer.
881 SetGLLightEnabled( me; view : CView from Graphic3d;
882 isEnabled : Boolean from Standard )
884 ---Purpose: call_togl_gllight
886 IsGLLightEnabled( me; view : CView from Graphic3d )
887 returns Boolean from Standard is deferred;
888 ---Purpose: call_togl_isgllight
891 ACView : CView from Graphic3d;
892 ACUnderLayer : CLayer2d from Aspect;
893 ACOverLayer : CLayer2d from Aspect;
894 hPrnDC : Handle from Aspect;
895 showBackground : Boolean;
897 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
898 theScaleFactor : Real from Standard = 1.0 )
899 returns Boolean from Standard is deferred;
901 ---Purpose: print the contents of all layers of the view to the printer.
902 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
903 -- <showBackground> : When set to FALSE then print the view without background color
904 -- (background is white)
905 -- else set to TRUE for printing with current background color.
906 -- <filename>: If != NULL, then the view will be printed to a file.
907 -- <printAlgorithm>: Select print algorithm: stretch, tile.
908 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
909 -- printings accordingly to the scale factor selected in the printer
910 -- properties dialog.
911 -- Returns Standard_True if the data is passed to the printer, otherwise
912 -- Standard_False if the print operation failed due to the printer errors,
913 -- or insufficient system memory available.
914 ---Warning: Works only under Windows.
917 theFileName : CString from Standard;
918 theFormat : ExportFormat from Graphic3d;
919 theSortType : SortType from Graphic3d;
920 theWidth, theHeight : Integer from Standard;
921 theView : CView from Graphic3d;
922 theLayerUnder : CLayer2d from Aspect;
923 theLayerOver : CLayer2d from Aspect;
924 thePrecision : Real from Standard = 0.005;
925 theProgressBarFunc : Address from Standard = NULL;
926 theProgressObject : Address from Standard = NULL )
927 returns Boolean from Standard
930 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
931 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
932 -- Notice however that results may differ a lot and do not contain some elements.
934 AddZLayer( me : mutable;
935 theCView : CView from Graphic3d;
936 theLayerId : Integer from Standard )
938 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
939 -- the view. Z layers allow drawing structures in higher layers
940 -- in foreground of structures in lower layers. To add a structure
941 -- to desired layer on display it is necessary to set the layer
942 -- ID for the structure.
944 RemoveZLayer( me : mutable;
945 theCView : CView from Graphic3d;
946 theLayerId : Integer from Standard )
948 ---Purpose: Remove Z layer from the specified view. All structures
949 -- displayed at the moment in layer will be displayed in default layer
950 -- ( the bottom-level z layer ). To unset layer ID from associated
951 -- structures use method UnsetZLayer (...).
953 UnsetZLayer( me : mutable;
954 theLayerId : Integer from Standard )
956 ---Purpose: Unset Z layer ID for all structures. The structure
957 -- indexes will be set to default layer ( the bottom-level z layer
960 ChangeZLayer( me : mutable;
961 theCStructure : CStructure from Graphic3d;
962 theLayerId : Integer from Standard )
964 ---Purpose: Change Z layer of a structure. The new z layer ID will
965 -- be used to define the associated layer for structure on display.
967 ChangeZLayer( me : mutable;
968 theCStructure : CStructure from Graphic3d;
969 theCView : CView from Graphic3d;
970 theNewLayerId : Integer from Standard )
972 ---Purpose: Change Z layer of a structure already presented in view.
975 theCStructure : CStructure from Graphic3d )
976 returns Integer from Standard is deferred;
977 ---Purpose: Get Z layer ID of structure. If the structure doesn't
978 -- exists in graphic driver, the method returns -1.
980 --------------------------
981 -- Category: Class methods
982 --------------------------
985 ACLight : CLight from Graphic3d;
986 Update : Boolean from Standard )
987 returns Integer from Standard;
988 ---Purpose: call_togl_light
991 ACPlane : CPlane from Graphic3d;
992 Update : Boolean from Standard )
993 returns Integer from Standard;
994 ---Purpose: call_togl_plane
996 -----------------------------
997 -- Category: Internal methods
998 -----------------------------
1001 AComment : CString from Standard;
1002 AValue : Boolean from Standard );
1005 ACGroup : CGroup from Graphic3d;
1006 AField : Integer from Standard );
1009 ACLight : CLight from Graphic3d;
1010 AField : Integer from Standard );
1013 ACPick : CPick from Graphic3d;
1014 AField : Integer from Standard );
1017 ACPlane : CPlane from Graphic3d;
1018 AField : Integer from Standard );
1020 PrintCStructure ( me;
1021 ACStructure : CStructure from Graphic3d;
1022 AField : Integer from Standard );
1025 ACView : CView from Graphic3d;
1026 AField : Integer from Standard );
1029 AFunc : CString from Standard );
1032 AComment : CString from Standard;
1033 AValue : Integer from Standard );
1036 AFunc : CString from Standard;
1037 AResult : Integer from Standard );
1039 PrintShortReal ( me;
1040 AComment : CString from Standard;
1041 AValue : ShortReal from Standard );
1044 AComment : CString from Standard;
1045 AMatrix : Array2OfReal from TColStd )
1046 raises TransformError from Graphic3d;
1049 AComment : CString from Standard;
1050 AString : CString from Standard );
1052 SetTrace ( me : mutable;
1053 ALevel : Integer from Standard )
1057 returns Integer from Standard
1060 --ListOfAvalableFontNames( me;
1061 -- lst: out NListOfHAsciiString from Graphic3d )
1062 -- returns Boolean from Standard
1064 -- Purpose: Initialize list of names of avalable system fonts
1065 -- returns Standard_False if fails
1066 -- ABD Integration support of system fonts (using FTGL and FreeType)
1068 GetDisplayConnection (me)
1069 returns DisplayConnection_Handle from Aspect;
1070 ---C++: return const &
1072 ---Purpose: returns Handle to display connection
1076 MyTraceLevel : Integer from Standard is protected;
1077 MySharedLibrary : SharedLibrary from OSD is protected;
1078 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
1080 end GraphicDriver from Graphic3d;