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,
51 Array1OfEdge from Aspect,
53 TypeOfTriedronEcho from Aspect,
54 TypeOfTriedronPosition from Aspect,
57 PrintAlgo from Aspect,
58 DisplayConnection_Handle from Aspect,
60 AspectLine3d from Graphic3d,
61 AspectMarker3d from Graphic3d,
62 AspectText3d from Graphic3d,
63 AspectFillArea3d from Graphic3d,
64 HorizontalTextAlignment from Graphic3d,
65 CBitFields20 from Graphic3d,
66 CGroup from Graphic3d,
67 CLight from Graphic3d,
69 CPlane from Graphic3d,
70 CStructure from Graphic3d,
72 BufferType from Graphic3d,
73 Structure from Graphic3d,
74 TextPath from Graphic3d,
75 TypeOfComposition from Graphic3d,
76 TypeOfPrimitive from Graphic3d,
77 Vector from Graphic3d,
78 Array1OfVertex from Graphic3d,
79 Array2OfVertex from Graphic3d,
80 Vertex from Graphic3d,
81 VerticalTextAlignment from Graphic3d,
82 PrimitiveArray from Graphic3d,
83 PtrFrameBuffer from Graphic3d,
84 HArray1OfByte from TColStd,
85 FillMethod from Aspect,
86 GradientFillMethod from Aspect,
87 ExportFormat from Graphic3d,
88 SortType from Graphic3d,
89 HArray1OfReal from TColStd,
90 CUserDraw from Graphic3d,
91 NListOfHAsciiString from Graphic3d,
93 CGraduatedTrihedron from Graphic3d
97 TransformError from Graphic3d
100 Initialize ( AShrName : CString from Standard )
101 returns mutable GraphicDriver from Graphic3d;
103 ---Purpose: Initialises the Driver
105 -------------------------
106 -- Category: Init methods
107 -------------------------
110 theDisplayConnection: DisplayConnection_Handle from Aspect)
111 returns Boolean from Standard
113 ---Purpose: Starts graphic driver with given connection
117 ---Purpose: call_togl_end
119 ----------------------------
120 -- Category: Inquire methods
121 ----------------------------
123 InquireLightLimit ( me : mutable )
124 returns Integer from Standard
126 ---Purpose: call_togl_inquirelight
128 InquireMat ( me : mutable;
129 ACView : CView from Graphic3d;
130 AMatO : out Array2OfReal from TColStd;
131 AMatM : out Array2OfReal from TColStd )
133 ---Purpose: call_togl_inquiremat
135 InquirePlaneLimit ( me : mutable )
136 returns Integer from Standard
138 ---Purpose: call_togl_inquireplane
140 InquireViewLimit ( me : mutable )
141 returns Integer from Standard
143 ---Purpose: call_togl_inquireview
145 ------------------------------
146 -- Category: Highlight methods
147 ------------------------------
149 Blink ( me : mutable;
150 ACStructure : CStructure from Graphic3d;
151 Create : Boolean from Standard )
153 ---Purpose: call_togl_blink
155 BoundaryBox ( me : mutable;
156 ACStructure : CStructure from Graphic3d;
157 Create : Boolean from Standard )
159 ---Purpose: call_togl_boundarybox
161 HighlightColor ( me : mutable;
162 ACStructure : CStructure from Graphic3d;
163 R : ShortReal from Standard;
164 G : ShortReal from Standard;
165 B : ShortReal from Standard;
166 Create : Boolean from Standard )
168 ---Purpose: call_togl_highlightcolor
170 NameSetStructure ( me : mutable;
171 ACStructure : CStructure from Graphic3d )
173 ---Purpose: call_togl_namesetstructure
175 -------------------------------------
176 -- Category: Group management methods
177 -------------------------------------
179 ClearGroup ( me : mutable;
180 ACGroup : CGroup from Graphic3d )
182 ---Purpose: call_togl_cleargroup
184 FaceContextGroup ( me : mutable;
185 ACGroup : CGroup from Graphic3d;
186 NoInsert : Integer from Standard )
188 ---Purpose: call_togl_facecontextgroup
190 Group ( me : mutable;
191 ACGroup : in out CGroup from Graphic3d )
193 ---Purpose: call_togl_group
195 LineContextGroup ( me : mutable;
196 ACGroup : CGroup from Graphic3d;
197 NoInsert : Integer from Standard )
199 ---Purpose: call_togl_linecontextgroup
201 MarkerContextGroup ( me : mutable;
202 ACGroup : CGroup from Graphic3d;
203 NoInsert : Integer from Standard )
205 ---Purpose: call_togl_markercontextgroup
207 MarkerContextGroup ( me : mutable;
208 ACGroup : CGroup from Graphic3d;
209 NoInsert : Integer from Standard;
210 AMarkWidth : Integer from Standard;
211 AMarkHeight: Integer from Standard;
212 ATexture : HArray1OfByte from TColStd )
214 ---Purpose: call_togl_markercontextgroup
216 RemoveGroup ( me : mutable;
217 ACGroup : CGroup from Graphic3d )
219 ---Purpose: call_togl_removegroup
221 TextContextGroup ( me : mutable;
222 ACGroup : CGroup from Graphic3d;
223 NoInsert : Integer from Standard )
225 ---Purpose: call_togl_textcontextgroup
227 -----------------------------------------
228 -- Category: Structure management methods
229 -----------------------------------------
231 ClearStructure ( me : mutable;
232 ACStructure : CStructure from Graphic3d )
234 ---Purpose: call_togl_clearstructure
236 Connect ( me : mutable;
237 AFather : CStructure from Graphic3d;
238 ASon : CStructure from Graphic3d )
240 ---Purpose: call_togl_connect
242 ContextStructure ( me : mutable;
243 ACStructure : CStructure from Graphic3d )
245 ---Purpose: call_togl_contextstructure
247 Disconnect ( me : mutable;
248 AFather : CStructure from Graphic3d;
249 ASon : CStructure from Graphic3d )
251 ---Purpose: call_togl_disconnect
253 DisplayStructure ( me : mutable;
254 ACView : CView from Graphic3d;
255 ACStructure : CStructure from Graphic3d;
256 APriority : Integer from Standard )
258 ---Purpose: call_togl_displaystructure
260 EraseStructure ( me : mutable;
261 ACView : CView from Graphic3d;
262 ACStructure : CStructure from Graphic3d )
264 ---Purpose: call_togl_erasestructure
266 RemoveStructure ( me : mutable;
267 ACStructure : CStructure from Graphic3d )
269 ---Purpose: call_togl_removestructure
271 Structure ( me : mutable;
272 ACStructure : in out CStructure from Graphic3d )
274 ---Purpose: call_togl_structure
276 ------------------------------------
277 -- Category: Structured mode methods
278 ------------------------------------
280 ActivateView ( me : mutable;
281 ACView : CView from Graphic3d )
283 ---Purpose: call_togl_activateview
285 AntiAliasing ( me : mutable;
286 ACView : CView from Graphic3d;
287 AFlag : Boolean from Standard )
289 ---Purpose: call_togl_antialiasing
291 Background ( me : mutable;
292 ACView : CView from Graphic3d )
294 ---Purpose: call_togl_background
296 GradientBackground ( me : mutable;
297 ACView : CView from Graphic3d;
298 AColor1: Color from Quantity;
299 AColor2: Color from Quantity;
300 FillStyle : GradientFillMethod from Aspect
303 ---Purpose: call_togl_gradient_background
306 BackgroundImage( me : mutable;
307 FileName : CString from Standard;
308 ACView : CView from Graphic3d;
309 FillStyle : FillMethod from Aspect )
312 SetBgImageStyle( me : mutable;
313 ACView : CView from Graphic3d;
314 FillStyle : FillMethod from Aspect )
317 SetBgGradientStyle( me : mutable;
318 ACView : CView from Graphic3d;
319 FillStyle : GradientFillMethod from Aspect )
322 ClipLimit ( me : mutable;
323 ACView : CView from Graphic3d;
324 AWait : Boolean from Standard )
326 ---Purpose: call_togl_cliplimit
328 DeactivateView ( me : mutable;
329 ACView : CView from Graphic3d )
331 ---Purpose: call_togl_deactivateview
333 DepthCueing ( me : mutable;
334 ACView : CView from Graphic3d;
335 AFlag : Boolean from Standard )
337 ---Purpose: call_togl_cliplimit
339 ProjectRaster ( me : mutable;
340 ACView : CView from Graphic3d;
341 AX : ShortReal from Standard;
342 AY : ShortReal from Standard;
343 AZ : ShortReal from Standard;
344 AU : out Integer from Standard;
345 AV : out Integer from Standard )
346 returns Boolean from Standard
348 ---Purpose: call_togl_unproject_raster
350 UnProjectRaster ( me : mutable;
351 ACView : CView from Graphic3d;
352 Axm : Integer from Standard;
353 Aym : Integer from Standard;
354 AXM : Integer from Standard;
355 AYM : Integer from Standard;
356 AU : Integer from Standard;
357 AV : Integer from Standard;
358 AX : out ShortReal from Standard;
359 AY : out ShortReal from Standard;
360 AZ : out ShortReal from Standard )
361 returns Boolean from Standard
363 ---Purpose: call_togl_unproject_raster
365 UnProjectRasterWithRay ( me : mutable;
366 ACView : CView from Graphic3d;
367 Axm : Integer from Standard;
368 Aym : Integer from Standard;
369 AXM : Integer from Standard;
370 AYM : Integer from Standard;
371 AU : Integer from Standard;
372 AV : Integer from Standard;
373 AX : out ShortReal from Standard;
374 AY : out ShortReal from Standard;
375 AZ : out ShortReal from Standard;
376 DX : out ShortReal from Standard;
377 DY : out ShortReal from Standard;
378 DZ : out ShortReal from Standard )
379 returns Boolean from Standard
381 ---Purpose: call_togl_unproject_raster_with_ray
383 RatioWindow ( me : mutable;
384 ACView : CView from Graphic3d )
386 ---Purpose: call_togl_ratio_window
388 Redraw ( me : mutable;
389 ACView : CView from Graphic3d;
390 ACUnderLayer : CLayer2d from Aspect;
391 ACOverLayer : CLayer2d from Aspect;
395 height : Integer = 0 )
397 ---Purpose: call_togl_redraw
398 -- Warning: when the redraw area has a null size, the full view is redrawn
400 RemoveView ( me : mutable;
401 ACView : CView from Graphic3d )
403 ---Purpose: call_togl_removeview
405 SetLight ( me : mutable;
406 ACView : CView from Graphic3d )
408 ---Purpose: call_togl_setlight
410 SetPlane ( me : mutable;
411 ACView : CView from Graphic3d )
413 ---Purpose: call_togl_setplane
415 SetVisualisation ( me : mutable;
416 ACView : CView from Graphic3d )
418 ---Purpose: call_togl_setvisualisation
420 TransformStructure ( me : mutable;
421 ACStructure : CStructure from Graphic3d )
423 ---Purpose: call_togl_transformstructure
425 Transparency ( me : mutable;
426 ACView : CView from Graphic3d;
427 AFlag : Boolean from Standard )
429 ---Purpose: call_togl_transparency
431 Update ( me : mutable;
432 ACView : CView from Graphic3d;
433 ACUnderLayer : CLayer2d from Aspect;
434 ACOverLayer : CLayer2d from Aspect )
436 ---Purpose: call_togl_update
439 ACView : in out CView from Graphic3d )
440 returns Boolean from Standard
442 ---Purpose: call_togl_view
444 ViewMapping ( me : mutable;
445 ACView : CView from Graphic3d;
446 AWait : Boolean from Standard )
448 ---Purpose: call_togl_viewmapping
450 ViewOrientation ( me : mutable;
451 ACView : CView from Graphic3d;
452 AWait : Boolean from Standard )
454 ---Purpose: call_togl_vieworientation
456 Environment ( me : mutable;
457 ACView : CView from Graphic3d )
461 ----------------------------------------
462 -- Category: Methods to create Marker
463 -- for Purpose : see Graphic3d_Group.cdl
464 ----------------------------------------
466 Marker ( me : mutable;
467 ACGroup : CGroup from Graphic3d;
468 APoint : Vertex from Graphic3d )
471 MarkerSet ( me : mutable;
472 ACGroup : CGroup from Graphic3d;
473 ListVertex : Array1OfVertex from Graphic3d )
476 ----------------------------------------
477 -- Category: Methods to create Text
478 -- for Purpose : see Graphic3d_Group.cdl
479 ----------------------------------------
482 ACGroup : CGroup from Graphic3d;
483 AText : CString from Standard;
484 APoint : Vertex from Graphic3d;
485 AHeight : Real from Standard;
486 AAngle : PlaneAngle from Quantity;
487 ATp : TextPath from Graphic3d;
488 AHta : HorizontalTextAlignment from Graphic3d;
489 AVta : VerticalTextAlignment from Graphic3d;
490 EvalMinMax : Boolean from Standard = Standard_True )
492 ---Purpose: call_togl_text
495 ACGroup : CGroup from Graphic3d;
496 AText : CString from Standard;
497 APoint : Vertex from Graphic3d;
498 AHeight : Real from Standard;
499 EvalMinMax : Boolean from Standard = Standard_True )
501 ---Purpose: call_togl_text
504 ACGroup : CGroup from Graphic3d;
505 AText : ExtendedString from TCollection;
506 APoint : Vertex from Graphic3d;
507 AHeight : Real from Standard;
508 AAngle : PlaneAngle from Quantity;
509 ATp : TextPath from Graphic3d;
510 AHta : HorizontalTextAlignment from Graphic3d;
511 AVta : VerticalTextAlignment from Graphic3d;
512 EvalMinMax : Boolean from Standard = Standard_True )
514 ---Purpose: call_togl_text
517 ACGroup : CGroup from Graphic3d;
518 AText : ExtendedString from TCollection;
519 APoint : Vertex from Graphic3d;
520 AHeight : Real from Standard;
521 EvalMinMax : Boolean from Standard = Standard_True )
523 ---Purpose: call_togl_text
525 ----------------------------------------
526 ---Category: Methods to create Triangle
527 -- for Purpose : see Graphic3d_Group.cdl
528 ----------------------------------------
530 PrimitiveArray( me : mutable;
531 ACGroup : CGroup from Graphic3d;
532 parray : PrimitiveArray from Graphic3d;
533 EvalMinMax : Boolean from Standard = Standard_True )
535 ---Purpose: call_togl_parray
537 UserDraw( me : mutable;
538 ACGroup : CGroup from Graphic3d;
539 AUserDraw : CUserDraw from Graphic3d )
541 ---Purpose: call_togl_userdraw
543 EnableVBO( me : mutable;
544 status : Boolean from Standard )
546 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
549 theFreeBytes : out Size from Standard;
550 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
551 ---Purpose: Returns information about GPU memory usage.
553 ----------------------------------------
554 ---Category: Methods to create Triedron
555 -- for Purpose : see Graphic3d_Group.cdl
556 ----------------------------------------
558 ZBufferTriedronSetup ( me : mutable;
559 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
560 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
561 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
562 SizeRatio : Real from Standard = 0.8;
563 AxisDiametr : Real from Standard = 0.05;
564 NbFacettes : Integer from Standard = 12)
566 ---Purpose: call_togl_ztriedron_setup
568 TriedronDisplay ( me : mutable;
569 ACView : CView from Graphic3d;
570 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
571 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
572 AScale : Real from Standard = 0.02;
573 AsWireframe : Boolean from Standard = Standard_True )
575 ---Purpose: call_togl_triedron_display
578 TriedronErase ( me : mutable;
579 ACView : CView from Graphic3d)
581 ---Purpose: call_togl_triedron_erase
584 TriedronEcho ( me : mutable;
585 ACView : CView from Graphic3d;
586 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
588 ---Purpose: call_togl_triedron_echo
590 ---------------------------------
591 ---Category: Graduated trihedron
592 ---------------------------------
594 GraduatedTrihedronDisplay(me : mutable;
595 view : CView from Graphic3d;
596 cubic : CGraduatedTrihedron from Graphic3d)
597 ---Purpose: call_togl_graduatedtrihedron_display
600 GraduatedTrihedronErase(me : mutable;
601 view : CView from Graphic3d)
602 ---Purpose: call_togl_graduatedtrihedron_erase
605 GraduatedTrihedronMinMaxValues(me : mutable;
606 xmin : ShortReal from Standard;
607 ymin : ShortReal from Standard;
608 zmin : ShortReal from Standard;
609 xmax : ShortReal from Standard;
610 ymax : ShortReal from Standard;
611 zmax : ShortReal from Standard)
612 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
615 ----------------------------------
616 -- Category: Ajout mode methods
617 ----------------------------------
619 BeginAddMode ( me : mutable;
620 ACView : CView from Graphic3d)
621 returns Boolean from Standard
623 ---Purpose: call_togl_begin_ajout_mode
625 EndAddMode ( me : mutable)
627 ---Purpose: call_togl_end_ajout_mode
629 ----------------------------------
630 -- Category: Immediat mode methods
631 ----------------------------------
633 SetImmediateModeDrawToFront (me : mutable;
634 theCView : CView from Graphic3d;
635 theDrawToFrontBuffer : Boolean from Standard)
636 returns Boolean from Standard
638 ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
639 -- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
640 -- Fast, so preferred for interactive work (used by default).
641 -- However these extra drawings will be missed in image dump since it is performed from back buffer.
642 -- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
643 -- in run-time (in case of slow hardware) and/or tearing may appear.
644 -- So this is strongly recommended to draw only simple (fast) structures.
645 -- 2. FALSE. Drawing immediate mode structures to the back buffer.
646 -- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
647 -- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
648 -- @return previous mode.
650 BeginImmediatMode ( me : mutable;
651 ACView : CView from Graphic3d;
652 ACUnderLayer : CLayer2d from Aspect;
653 ACOverLayer : CLayer2d from Aspect;
654 DoubleBuffer : Boolean from Standard;
655 RetainMode : Boolean from Standard)
656 returns Boolean from Standard
658 ---Purpose: call_togl_begin_immediat_mode
660 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
661 aFlush : Boolean from Standard = Standard_True)
663 ---Purpose: call_togl_clear_immediat_mode
665 DrawStructure ( me : mutable;
666 ACStructure : CStructure from Graphic3d )
668 ---Purpose: call_togl_draw_structure
670 EndImmediatMode ( me : mutable;
671 Synchronize : Integer from Standard )
673 ---Purpose: call_togl_end_immediat_mode
675 -------------------------------
676 -- Category: Layer mode methods
677 -------------------------------
679 Layer ( me : mutable;
680 ACLayer : in out CLayer2d from Aspect )
682 ---Purpose: call_togl_layer2d
684 RemoveLayer ( me : mutable;
685 ACLayer : CLayer2d from Aspect )
687 ---Purpose: call_togl_removelayer2d
689 BeginLayer ( me : mutable;
690 ACLayer : CLayer2d from Aspect )
692 ---Purpose: call_togl_begin_layer2d
694 BeginPolygon2d ( me : mutable )
696 ---Purpose: call_togl_begin_polygon2d
698 BeginPolyline2d ( me : mutable )
700 ---Purpose: call_togl_begin_polyline2d
702 ClearLayer ( me : mutable;
703 ACLayer : CLayer2d from Aspect )
705 ---Purpose: call_togl_clear_layer2d
708 X : ShortReal from Standard;
709 Y : ShortReal from Standard )
711 ---Purpose: call_togl_draw2d
714 X : ShortReal from Standard;
715 Y : ShortReal from Standard )
717 ---Purpose: call_togl_edge2d
719 EndLayer ( me : mutable )
721 ---Purpose: call_togl_end_layer2d
723 EndPolygon2d ( me : mutable )
725 ---Purpose: call_togl_end_polygon2d
727 EndPolyline2d ( me : mutable )
729 ---Purpose: call_togl_end_polyline2d
732 X : ShortReal from Standard;
733 Y : ShortReal from Standard )
735 ---Purpose: call_togl_move2d
737 Rectangle ( me : mutable;
738 X, Y : ShortReal from Standard;
739 Width, Height : ShortReal from Standard )
741 ---Purpose: call_togl_rectangle2d
743 SetColor ( me : mutable;
744 R : ShortReal from Standard;
745 G : ShortReal from Standard;
746 B : ShortReal from Standard )
748 ---Purpose: call_togl_set_color
750 SetTransparency ( me : mutable;
751 ATransparency : ShortReal from Standard )
753 ---Purpose: call_togl_set_transparency
755 UnsetTransparency ( me : mutable )
757 ---Purpose: call_togl_unset_transparency
759 SetLineAttributes ( me : mutable;
760 Type : Integer from Standard;
761 Width : ShortReal from Standard )
763 ---Purpose: call_togl_set_line_attributes
766 SetTextAttributes ( me : mutable;
767 Font : CString from Standard;
768 Type : Integer from Standard;
769 R : ShortReal from Standard;
770 G : ShortReal from Standard;
771 B : ShortReal from Standard )
773 ---Purpose: Set text attributes for under-/overlayer.
774 -- <Font> argument defines the name of the font to be used,
775 -- <Type> argument defines the display type of the text,
776 -- <R> <G> <B> values define the color of decal or subtitle background.
777 -- To set the color of the text you can use the SetColor method.
780 AText : CString from Standard;
781 X, Y : ShortReal from Standard;
782 AHeight : ShortReal from Standard )
784 ---Purpose: call_togl_text2d
785 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
787 DefaultTextHeight( me )
788 returns ShortReal from Standard
793 AText : CString from Standard;
794 AHeight : ShortReal from Standard;
795 AWidth : in out ShortReal from Standard;
796 AnAscent : in out ShortReal from Standard;
797 ADescent : in out ShortReal from Standard )
799 ---Purpose: call_togl_textsize2d
801 SetBackFacingModel ( me : mutable;
802 aView : CView from Graphic3d )
804 ---Purpose: call_togl_backfacing
806 SetDepthTestEnabled( me; view : CView from Graphic3d;
807 isEnabled : Boolean from Standard )
809 ---Purpose: call_togl_depthtest
811 IsDepthTestEnabled( me; view : CView from Graphic3d )
812 returns Boolean from Standard is deferred;
813 ---Purpose: call_togl_isdepthtest
816 view : CView from Graphic3d;
818 width, height : Integer;
821 ---Purpose: Reads depths of shown pixels of the given
822 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
824 FBOCreate( me : mutable;
825 view : CView from Graphic3d;
826 width, height : Integer from Standard )
827 returns PtrFrameBuffer from Graphic3d
829 ---Purpose: Generate offscreen FBO in the graphic library.
830 -- If not supported on hardware returns NULL.
832 FBORelease( me : mutable;
833 view : CView from Graphic3d;
834 fboPtr : in out PtrFrameBuffer from Graphic3d )
836 ---Purpose: Remove offscreen FBO from the graphic library
838 FBOGetDimensions( me : mutable;
839 view : CView from Graphic3d;
840 fboPtr : PtrFrameBuffer from Graphic3d;
841 width, height : out Integer from Standard;
842 widthMax, heightMax : out Integer from Standard )
844 ---Purpose: Read offscreen FBO configuration.
846 FBOChangeViewport( me : mutable;
847 view : CView from Graphic3d;
848 fboPtr : in out PtrFrameBuffer from Graphic3d;
849 width, height : Integer from Standard )
851 ---Purpose: Change offscreen FBO viewport.
853 BufferDump( me : mutable;
854 theCView : CView from Graphic3d;
855 theImage : in out PixMap from Image;
856 theBufferType : BufferType from Graphic3d )
857 returns Boolean from Standard
859 ---Purpose: Dump active rendering buffer into specified memory buffer.
861 SetGLLightEnabled( me; view : CView from Graphic3d;
862 isEnabled : Boolean from Standard )
864 ---Purpose: call_togl_gllight
866 IsGLLightEnabled( me; view : CView from Graphic3d )
867 returns Boolean from Standard is deferred;
868 ---Purpose: call_togl_isgllight
871 ACView : CView from Graphic3d;
872 ACUnderLayer : CLayer2d from Aspect;
873 ACOverLayer : CLayer2d from Aspect;
874 hPrnDC : Handle from Aspect;
875 showBackground : Boolean;
877 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
878 theScaleFactor : Real from Standard = 1.0 )
879 returns Boolean from Standard is deferred;
881 ---Purpose: print the contents of all layers of the view to the printer.
882 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
883 -- <showBackground> : When set to FALSE then print the view without background color
884 -- (background is white)
885 -- else set to TRUE for printing with current background color.
886 -- <filename>: If != NULL, then the view will be printed to a file.
887 -- <printAlgorithm>: Select print algorithm: stretch, tile.
888 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
889 -- printings accordingly to the scale factor selected in the printer
890 -- properties dialog.
891 -- Returns Standard_True if the data is passed to the printer, otherwise
892 -- Standard_False if the print operation failed due to the printer errors,
893 -- or insufficient system memory available.
894 ---Warning: Works only under Windows.
897 theFileName : CString from Standard;
898 theFormat : ExportFormat from Graphic3d;
899 theSortType : SortType from Graphic3d;
900 theWidth, theHeight : Integer from Standard;
901 theView : CView from Graphic3d;
902 theLayerUnder : CLayer2d from Aspect;
903 theLayerOver : CLayer2d from Aspect;
904 thePrecision : Real from Standard = 0.005;
905 theProgressBarFunc : Address from Standard = NULL;
906 theProgressObject : Address from Standard = NULL )
907 returns Boolean from Standard
910 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
911 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
912 -- Notice however that results may differ a lot and do not contain some elements.
914 AddZLayer( me : mutable;
915 theCView : CView from Graphic3d;
916 theLayerId : Integer from Standard )
918 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
919 -- the view. Z layers allow drawing structures in higher layers
920 -- in foreground of structures in lower layers. To add a structure
921 -- to desired layer on display it is necessary to set the layer
922 -- ID for the structure.
924 RemoveZLayer( me : mutable;
925 theCView : CView from Graphic3d;
926 theLayerId : Integer from Standard )
928 ---Purpose: Remove Z layer from the specified view. All structures
929 -- displayed at the moment in layer will be displayed in default layer
930 -- ( the bottom-level z layer ). To unset layer ID from associated
931 -- structures use method UnsetZLayer (...).
933 UnsetZLayer( me : mutable;
934 theLayerId : Integer from Standard )
936 ---Purpose: Unset Z layer ID for all structures. The structure
937 -- indexes will be set to default layer ( the bottom-level z layer
940 ChangeZLayer( me : mutable;
941 theCStructure : CStructure from Graphic3d;
942 theLayerId : Integer from Standard )
944 ---Purpose: Change Z layer of a structure. The new z layer ID will
945 -- be used to define the associated layer for structure on display.
947 ChangeZLayer( me : mutable;
948 theCStructure : CStructure from Graphic3d;
949 theCView : CView from Graphic3d;
950 theNewLayerId : Integer from Standard )
952 ---Purpose: Change Z layer of a structure already presented in view.
955 theCStructure : CStructure from Graphic3d )
956 returns Integer from Standard is deferred;
957 ---Purpose: Get Z layer ID of structure. If the structure doesn't
958 -- exists in graphic driver, the method returns -1.
960 --------------------------
961 -- Category: Class methods
962 --------------------------
965 ACLight : CLight from Graphic3d;
966 Update : Boolean from Standard )
967 returns Integer from Standard;
968 ---Purpose: call_togl_light
971 ACPlane : CPlane from Graphic3d;
972 Update : Boolean from Standard )
973 returns Integer from Standard;
974 ---Purpose: call_togl_plane
976 -----------------------------
977 -- Category: Internal methods
978 -----------------------------
981 AComment : CString from Standard;
982 AValue : Boolean from Standard );
985 ACGroup : CGroup from Graphic3d;
986 AField : Integer from Standard );
989 ACLight : CLight from Graphic3d;
990 AField : Integer from Standard );
993 ACPick : CPick from Graphic3d;
994 AField : Integer from Standard );
997 ACPlane : CPlane from Graphic3d;
998 AField : Integer from Standard );
1000 PrintCStructure ( me;
1001 ACStructure : CStructure from Graphic3d;
1002 AField : Integer from Standard );
1005 ACView : CView from Graphic3d;
1006 AField : Integer from Standard );
1009 AFunc : CString from Standard );
1012 AComment : CString from Standard;
1013 AValue : Integer from Standard );
1016 AFunc : CString from Standard;
1017 AResult : Integer from Standard );
1019 PrintShortReal ( me;
1020 AComment : CString from Standard;
1021 AValue : ShortReal from Standard );
1024 AComment : CString from Standard;
1025 AMatrix : Array2OfReal from TColStd )
1026 raises TransformError from Graphic3d;
1029 AComment : CString from Standard;
1030 AString : CString from Standard );
1032 SetTrace ( me : mutable;
1033 ALevel : Integer from Standard )
1037 returns Integer from Standard
1040 --ListOfAvalableFontNames( me;
1041 -- lst: out NListOfHAsciiString from Graphic3d )
1042 -- returns Boolean from Standard
1044 -- Purpose: Initialize list of names of avalable system fonts
1045 -- returns Standard_False if fails
1046 -- ABD Integration support of system fonts (using FTGL and FreeType)
1048 GetDisplayConnection (me)
1049 returns DisplayConnection_Handle from Aspect;
1050 ---C++: return const &
1052 ---Purpose: returns Handle to display connection
1056 MyTraceLevel : Integer from Standard is protected;
1057 MySharedLibrary : SharedLibrary from OSD is protected;
1058 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
1060 end GraphicDriver from Graphic3d;