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,
94 ClipPlane 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 RemoveGroup ( me : mutable;
209 ACGroup : CGroup from Graphic3d )
211 ---Purpose: call_togl_removegroup
213 TextContextGroup ( me : mutable;
214 ACGroup : CGroup from Graphic3d;
215 NoInsert : Integer from Standard )
217 ---Purpose: call_togl_textcontextgroup
219 -----------------------------------------
220 -- Category: Structure management methods
221 -----------------------------------------
223 ClearStructure ( me : mutable;
224 ACStructure : CStructure from Graphic3d )
226 ---Purpose: call_togl_clearstructure
228 Connect ( me : mutable;
229 AFather : CStructure from Graphic3d;
230 ASon : CStructure from Graphic3d )
232 ---Purpose: call_togl_connect
234 ContextStructure ( me : mutable;
235 ACStructure : CStructure from Graphic3d )
237 ---Purpose: call_togl_contextstructure
239 Disconnect ( me : mutable;
240 AFather : CStructure from Graphic3d;
241 ASon : CStructure from Graphic3d )
243 ---Purpose: call_togl_disconnect
245 DisplayStructure ( me : mutable;
246 ACView : CView from Graphic3d;
247 ACStructure : CStructure from Graphic3d;
248 APriority : Integer from Standard )
250 ---Purpose: call_togl_displaystructure
252 EraseStructure ( me : mutable;
253 ACView : CView from Graphic3d;
254 ACStructure : CStructure from Graphic3d )
256 ---Purpose: call_togl_erasestructure
258 RemoveStructure ( me : mutable;
259 ACStructure : CStructure from Graphic3d )
261 ---Purpose: call_togl_removestructure
263 Structure ( me : mutable;
264 ACStructure : in out CStructure from Graphic3d )
266 ---Purpose: call_togl_structure
268 ------------------------------------
269 -- Category: Structured mode methods
270 ------------------------------------
272 ActivateView ( me : mutable;
273 ACView : CView from Graphic3d )
275 ---Purpose: call_togl_activateview
277 AntiAliasing ( me : mutable;
278 ACView : CView from Graphic3d;
279 AFlag : Boolean from Standard )
281 ---Purpose: call_togl_antialiasing
283 Background ( me : mutable;
284 ACView : CView from Graphic3d )
286 ---Purpose: call_togl_background
288 GradientBackground ( me : mutable;
289 ACView : CView from Graphic3d;
290 AColor1: Color from Quantity;
291 AColor2: Color from Quantity;
292 FillStyle : GradientFillMethod from Aspect
295 ---Purpose: call_togl_gradient_background
298 BackgroundImage( me : mutable;
299 FileName : CString from Standard;
300 ACView : CView from Graphic3d;
301 FillStyle : FillMethod from Aspect )
304 SetBgImageStyle( me : mutable;
305 ACView : CView from Graphic3d;
306 FillStyle : FillMethod from Aspect )
309 SetBgGradientStyle( me : mutable;
310 ACView : CView from Graphic3d;
311 FillStyle : GradientFillMethod from Aspect )
314 ClipLimit ( me : mutable;
315 ACView : CView from Graphic3d;
316 AWait : Boolean from Standard )
318 ---Purpose: call_togl_cliplimit
320 DeactivateView ( me : mutable;
321 ACView : CView from Graphic3d )
323 ---Purpose: call_togl_deactivateview
325 DepthCueing ( me : mutable;
326 ACView : CView from Graphic3d;
327 AFlag : Boolean from Standard )
329 ---Purpose: call_togl_cliplimit
331 ProjectRaster ( me : mutable;
332 ACView : CView from Graphic3d;
333 AX : ShortReal from Standard;
334 AY : ShortReal from Standard;
335 AZ : ShortReal from Standard;
336 AU : out Integer from Standard;
337 AV : out Integer from Standard )
338 returns Boolean from Standard
340 ---Purpose: call_togl_unproject_raster
342 UnProjectRaster ( me : mutable;
343 ACView : CView from Graphic3d;
344 Axm : Integer from Standard;
345 Aym : Integer from Standard;
346 AXM : Integer from Standard;
347 AYM : Integer from Standard;
348 AU : Integer from Standard;
349 AV : Integer from Standard;
350 AX : out ShortReal from Standard;
351 AY : out ShortReal from Standard;
352 AZ : out ShortReal from Standard )
353 returns Boolean from Standard
355 ---Purpose: call_togl_unproject_raster
357 UnProjectRasterWithRay ( me : mutable;
358 ACView : CView from Graphic3d;
359 Axm : Integer from Standard;
360 Aym : Integer from Standard;
361 AXM : Integer from Standard;
362 AYM : Integer from Standard;
363 AU : Integer from Standard;
364 AV : Integer from Standard;
365 AX : out ShortReal from Standard;
366 AY : out ShortReal from Standard;
367 AZ : out ShortReal from Standard;
368 DX : out ShortReal from Standard;
369 DY : out ShortReal from Standard;
370 DZ : out ShortReal from Standard )
371 returns Boolean from Standard
373 ---Purpose: call_togl_unproject_raster_with_ray
375 RatioWindow ( me : mutable;
376 ACView : CView from Graphic3d )
378 ---Purpose: call_togl_ratio_window
380 Redraw ( me : mutable;
381 ACView : CView from Graphic3d;
382 ACUnderLayer : CLayer2d from Aspect;
383 ACOverLayer : CLayer2d from Aspect;
387 height : Integer = 0 )
389 ---Purpose: call_togl_redraw
390 -- Warning: when the redraw area has a null size, the full view is redrawn
392 RemoveView ( me : mutable;
393 ACView : CView from Graphic3d )
395 ---Purpose: call_togl_removeview
397 SetLight ( me : mutable;
398 ACView : CView from Graphic3d )
400 ---Purpose: call_togl_setlight
402 SetClipPlanes (me : mutable; theCView : CView from Graphic3d) is deferred;
403 ---Purpose: Pass clip planes to the associated graphic driver view.
405 SetClipPlanes (me : mutable; theCStructure : CStructure from Graphic3d) is deferred;
406 ---Purpose: Pass clip planes to the associated graphic driver structure.
408 SetVisualisation ( me : mutable;
409 ACView : CView from Graphic3d )
411 ---Purpose: call_togl_setvisualisation
413 TransformStructure ( me : mutable;
414 ACStructure : CStructure from Graphic3d )
416 ---Purpose: call_togl_transformstructure
418 Transparency ( me : mutable;
419 ACView : CView from Graphic3d;
420 AFlag : Boolean from Standard )
422 ---Purpose: call_togl_transparency
424 Update ( me : mutable;
425 ACView : CView from Graphic3d;
426 ACUnderLayer : CLayer2d from Aspect;
427 ACOverLayer : CLayer2d from Aspect )
429 ---Purpose: call_togl_update
432 ACView : in out CView from Graphic3d )
433 returns Boolean from Standard
435 ---Purpose: call_togl_view
437 ViewMapping ( me : mutable;
438 ACView : CView from Graphic3d;
439 AWait : Boolean from Standard )
441 ---Purpose: call_togl_viewmapping
443 ViewOrientation ( me : mutable;
444 ACView : CView from Graphic3d;
445 AWait : Boolean from Standard )
447 ---Purpose: call_togl_vieworientation
449 Environment ( me : mutable;
450 ACView : CView from Graphic3d )
454 ----------------------------------------
455 -- Category: Methods to create Text
456 -- for Purpose : see Graphic3d_Group.cdl
457 ----------------------------------------
460 ACGroup : CGroup from Graphic3d;
461 AText : CString from Standard;
462 APoint : Vertex from Graphic3d;
463 AHeight : Real from Standard;
464 AAngle : PlaneAngle from Quantity;
465 ATp : TextPath from Graphic3d;
466 AHta : HorizontalTextAlignment from Graphic3d;
467 AVta : VerticalTextAlignment from Graphic3d;
468 EvalMinMax : Boolean from Standard = Standard_True )
470 ---Purpose: call_togl_text
473 ACGroup : CGroup from Graphic3d;
474 AText : CString from Standard;
475 APoint : Vertex from Graphic3d;
476 AHeight : Real from Standard;
477 EvalMinMax : Boolean from Standard = Standard_True )
479 ---Purpose: call_togl_text
482 ACGroup : CGroup from Graphic3d;
483 AText : ExtendedString from TCollection;
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 : ExtendedString from TCollection;
497 APoint : Vertex from Graphic3d;
498 AHeight : Real from Standard;
499 EvalMinMax : Boolean from Standard = Standard_True )
501 ---Purpose: call_togl_text
503 ----------------------------------------
504 ---Category: Methods to create Triangle
505 -- for Purpose : see Graphic3d_Group.cdl
506 ----------------------------------------
508 PrimitiveArray( me : mutable;
509 ACGroup : CGroup from Graphic3d;
510 parray : PrimitiveArray from Graphic3d;
511 EvalMinMax : Boolean from Standard = Standard_True )
513 ---Purpose: call_togl_parray
515 UserDraw( me : mutable;
516 ACGroup : CGroup from Graphic3d;
517 AUserDraw : CUserDraw from Graphic3d )
519 ---Purpose: call_togl_userdraw
521 EnableVBO( me : mutable;
522 status : Boolean from Standard )
524 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
527 theFreeBytes : out Size from Standard;
528 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
529 ---Purpose: Returns information about GPU memory usage.
531 ----------------------------------------
532 ---Category: Methods to create Triedron
533 -- for Purpose : see Graphic3d_Group.cdl
534 ----------------------------------------
536 ZBufferTriedronSetup ( me : mutable;
537 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
538 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
539 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
540 SizeRatio : Real from Standard = 0.8;
541 AxisDiametr : Real from Standard = 0.05;
542 NbFacettes : Integer from Standard = 12)
544 ---Purpose: call_togl_ztriedron_setup
546 TriedronDisplay ( me : mutable;
547 ACView : CView from Graphic3d;
548 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
549 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
550 AScale : Real from Standard = 0.02;
551 AsWireframe : Boolean from Standard = Standard_True )
553 ---Purpose: call_togl_triedron_display
556 TriedronErase ( me : mutable;
557 ACView : CView from Graphic3d)
559 ---Purpose: call_togl_triedron_erase
562 TriedronEcho ( me : mutable;
563 ACView : CView from Graphic3d;
564 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
566 ---Purpose: call_togl_triedron_echo
568 ---------------------------------
569 ---Category: Graduated trihedron
570 ---------------------------------
572 GraduatedTrihedronDisplay(me : mutable;
573 view : CView from Graphic3d;
574 cubic : CGraduatedTrihedron from Graphic3d)
575 ---Purpose: call_togl_graduatedtrihedron_display
578 GraduatedTrihedronErase(me : mutable;
579 view : CView from Graphic3d)
580 ---Purpose: call_togl_graduatedtrihedron_erase
583 GraduatedTrihedronMinMaxValues(me : mutable;
584 xmin : ShortReal from Standard;
585 ymin : ShortReal from Standard;
586 zmin : ShortReal from Standard;
587 xmax : ShortReal from Standard;
588 ymax : ShortReal from Standard;
589 zmax : ShortReal from Standard)
590 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
593 ----------------------------------
594 -- Category: Ajout mode methods
595 ----------------------------------
597 BeginAddMode ( me : mutable;
598 ACView : CView from Graphic3d)
599 returns Boolean from Standard
601 ---Purpose: call_togl_begin_ajout_mode
603 EndAddMode ( me : mutable)
605 ---Purpose: call_togl_end_ajout_mode
607 ----------------------------------
608 -- Category: Immediat mode methods
609 ----------------------------------
611 SetImmediateModeDrawToFront (me : mutable;
612 theCView : CView from Graphic3d;
613 theDrawToFrontBuffer : Boolean from Standard)
614 returns Boolean from Standard
616 ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
617 -- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
618 -- Fast, so preferred for interactive work (used by default).
619 -- However these extra drawings will be missed in image dump since it is performed from back buffer.
620 -- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
621 -- in run-time (in case of slow hardware) and/or tearing may appear.
622 -- So this is strongly recommended to draw only simple (fast) structures.
623 -- 2. FALSE. Drawing immediate mode structures to the back buffer.
624 -- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
625 -- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
626 -- @return previous mode.
628 BeginImmediatMode ( me : mutable;
629 ACView : CView from Graphic3d;
630 ACUnderLayer : CLayer2d from Aspect;
631 ACOverLayer : CLayer2d from Aspect;
632 DoubleBuffer : Boolean from Standard;
633 RetainMode : Boolean from Standard)
634 returns Boolean from Standard
636 ---Purpose: call_togl_begin_immediat_mode
638 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
639 aFlush : Boolean from Standard = Standard_True)
641 ---Purpose: call_togl_clear_immediat_mode
643 DrawStructure ( me : mutable;
644 ACStructure : CStructure from Graphic3d )
646 ---Purpose: call_togl_draw_structure
648 EndImmediatMode ( me : mutable;
649 Synchronize : Integer from Standard )
651 ---Purpose: call_togl_end_immediat_mode
653 -------------------------------
654 -- Category: Layer mode methods
655 -------------------------------
657 Layer ( me : mutable;
658 ACLayer : in out CLayer2d from Aspect )
660 ---Purpose: call_togl_layer2d
662 RemoveLayer ( me : mutable;
663 ACLayer : CLayer2d from Aspect )
665 ---Purpose: call_togl_removelayer2d
667 BeginLayer ( me : mutable;
668 ACLayer : CLayer2d from Aspect )
670 ---Purpose: call_togl_begin_layer2d
672 BeginPolygon2d ( me : mutable )
674 ---Purpose: call_togl_begin_polygon2d
676 BeginPolyline2d ( me : mutable )
678 ---Purpose: call_togl_begin_polyline2d
680 ClearLayer ( me : mutable;
681 ACLayer : CLayer2d from Aspect )
683 ---Purpose: call_togl_clear_layer2d
686 X : ShortReal from Standard;
687 Y : ShortReal from Standard )
689 ---Purpose: call_togl_draw2d
692 X : ShortReal from Standard;
693 Y : ShortReal from Standard )
695 ---Purpose: call_togl_edge2d
697 EndLayer ( me : mutable )
699 ---Purpose: call_togl_end_layer2d
701 EndPolygon2d ( me : mutable )
703 ---Purpose: call_togl_end_polygon2d
705 EndPolyline2d ( me : mutable )
707 ---Purpose: call_togl_end_polyline2d
710 X : ShortReal from Standard;
711 Y : ShortReal from Standard )
713 ---Purpose: call_togl_move2d
715 Rectangle ( me : mutable;
716 X, Y : ShortReal from Standard;
717 Width, Height : ShortReal from Standard )
719 ---Purpose: call_togl_rectangle2d
721 SetColor ( me : mutable;
722 R : ShortReal from Standard;
723 G : ShortReal from Standard;
724 B : ShortReal from Standard )
726 ---Purpose: call_togl_set_color
728 SetTransparency ( me : mutable;
729 ATransparency : ShortReal from Standard )
731 ---Purpose: call_togl_set_transparency
733 UnsetTransparency ( me : mutable )
735 ---Purpose: call_togl_unset_transparency
737 SetLineAttributes ( me : mutable;
738 Type : Integer from Standard;
739 Width : ShortReal from Standard )
741 ---Purpose: call_togl_set_line_attributes
744 SetTextAttributes ( me : mutable;
745 Font : CString from Standard;
746 Type : Integer from Standard;
747 R : ShortReal from Standard;
748 G : ShortReal from Standard;
749 B : ShortReal from Standard )
751 ---Purpose: Set text attributes for under-/overlayer.
752 -- <Font> argument defines the name of the font to be used,
753 -- <Type> argument defines the display type of the text,
754 -- <R> <G> <B> values define the color of decal or subtitle background.
755 -- To set the color of the text you can use the SetColor method.
758 AText : CString from Standard;
759 X, Y : ShortReal from Standard;
760 AHeight : ShortReal from Standard )
762 ---Purpose: call_togl_text2d
763 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
765 DefaultTextHeight( me )
766 returns ShortReal from Standard
771 AText : CString from Standard;
772 AHeight : ShortReal from Standard;
773 AWidth : in out ShortReal from Standard;
774 AnAscent : in out ShortReal from Standard;
775 ADescent : in out ShortReal from Standard )
777 ---Purpose: call_togl_textsize2d
779 SetBackFacingModel ( me : mutable;
780 aView : CView from Graphic3d )
782 ---Purpose: call_togl_backfacing
784 SetDepthTestEnabled( me; view : CView from Graphic3d;
785 isEnabled : Boolean from Standard )
787 ---Purpose: call_togl_depthtest
789 IsDepthTestEnabled( me; view : CView from Graphic3d )
790 returns Boolean from Standard is deferred;
791 ---Purpose: call_togl_isdepthtest
794 view : CView from Graphic3d;
796 width, height : Integer;
799 ---Purpose: Reads depths of shown pixels of the given
800 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
802 FBOCreate( me : mutable;
803 view : CView from Graphic3d;
804 width, height : Integer from Standard )
805 returns PtrFrameBuffer from Graphic3d
807 ---Purpose: Generate offscreen FBO in the graphic library.
808 -- If not supported on hardware returns NULL.
810 FBORelease( me : mutable;
811 view : CView from Graphic3d;
812 fboPtr : in out PtrFrameBuffer from Graphic3d )
814 ---Purpose: Remove offscreen FBO from the graphic library
816 FBOGetDimensions( me : mutable;
817 view : CView from Graphic3d;
818 fboPtr : PtrFrameBuffer from Graphic3d;
819 width, height : out Integer from Standard;
820 widthMax, heightMax : out Integer from Standard )
822 ---Purpose: Read offscreen FBO configuration.
824 FBOChangeViewport( me : mutable;
825 view : CView from Graphic3d;
826 fboPtr : in out PtrFrameBuffer from Graphic3d;
827 width, height : Integer from Standard )
829 ---Purpose: Change offscreen FBO viewport.
831 BufferDump( me : mutable;
832 theCView : CView from Graphic3d;
833 theImage : in out PixMap from Image;
834 theBufferType : BufferType from Graphic3d )
835 returns Boolean from Standard
837 ---Purpose: Dump active rendering buffer into specified memory buffer.
839 SetGLLightEnabled( me; view : CView from Graphic3d;
840 isEnabled : Boolean from Standard )
842 ---Purpose: call_togl_gllight
844 IsGLLightEnabled( me; view : CView from Graphic3d )
845 returns Boolean from Standard is deferred;
846 ---Purpose: call_togl_isgllight
849 ACView : CView from Graphic3d;
850 ACUnderLayer : CLayer2d from Aspect;
851 ACOverLayer : CLayer2d from Aspect;
852 hPrnDC : Handle from Aspect;
853 showBackground : Boolean;
855 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
856 theScaleFactor : Real from Standard = 1.0 )
857 returns Boolean from Standard is deferred;
859 ---Purpose: print the contents of all layers of the view to the printer.
860 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
861 -- <showBackground> : When set to FALSE then print the view without background color
862 -- (background is white)
863 -- else set to TRUE for printing with current background color.
864 -- <filename>: If != NULL, then the view will be printed to a file.
865 -- <printAlgorithm>: Select print algorithm: stretch, tile.
866 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
867 -- printings accordingly to the scale factor selected in the printer
868 -- properties dialog.
869 -- Returns Standard_True if the data is passed to the printer, otherwise
870 -- Standard_False if the print operation failed due to the printer errors,
871 -- or insufficient system memory available.
872 ---Warning: Works only under Windows.
875 theFileName : CString from Standard;
876 theFormat : ExportFormat from Graphic3d;
877 theSortType : SortType from Graphic3d;
878 theWidth, theHeight : Integer from Standard;
879 theView : CView from Graphic3d;
880 theLayerUnder : CLayer2d from Aspect;
881 theLayerOver : CLayer2d from Aspect;
882 thePrecision : Real from Standard = 0.005;
883 theProgressBarFunc : Address from Standard = NULL;
884 theProgressObject : Address from Standard = NULL )
885 returns Boolean from Standard
888 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
889 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
890 -- Notice however that results may differ a lot and do not contain some elements.
892 AddZLayer( me : mutable;
893 theCView : CView from Graphic3d;
894 theLayerId : Integer from Standard )
896 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
897 -- the view. Z layers allow drawing structures in higher layers
898 -- in foreground of structures in lower layers. To add a structure
899 -- to desired layer on display it is necessary to set the layer
900 -- ID for the structure.
902 RemoveZLayer( me : mutable;
903 theCView : CView from Graphic3d;
904 theLayerId : Integer from Standard )
906 ---Purpose: Remove Z layer from the specified view. All structures
907 -- displayed at the moment in layer will be displayed in default layer
908 -- ( the bottom-level z layer ). To unset layer ID from associated
909 -- structures use method UnsetZLayer (...).
911 UnsetZLayer( me : mutable;
912 theLayerId : Integer from Standard )
914 ---Purpose: Unset Z layer ID for all structures. The structure
915 -- indexes will be set to default layer ( the bottom-level z layer
918 ChangeZLayer( me : mutable;
919 theCStructure : CStructure from Graphic3d;
920 theLayerId : Integer from Standard )
922 ---Purpose: Change Z layer of a structure. The new z layer ID will
923 -- be used to define the associated layer for structure on display.
925 ChangeZLayer( me : mutable;
926 theCStructure : CStructure from Graphic3d;
927 theCView : CView from Graphic3d;
928 theNewLayerId : Integer from Standard )
930 ---Purpose: Change Z layer of a structure already presented in view.
933 theCStructure : CStructure from Graphic3d )
934 returns Integer from Standard is deferred;
935 ---Purpose: Get Z layer ID of structure. If the structure doesn't
936 -- exists in graphic driver, the method returns -1.
938 --------------------------
939 -- Category: Class methods
940 --------------------------
943 ACLight : CLight from Graphic3d;
944 Update : Boolean from Standard )
945 returns Integer from Standard;
946 ---Purpose: call_togl_light
948 -----------------------------
949 -- Category: Internal methods
950 -----------------------------
953 AComment : CString from Standard;
954 AValue : Boolean from Standard );
957 ACGroup : CGroup from Graphic3d;
958 AField : Integer from Standard );
961 ACLight : CLight from Graphic3d;
962 AField : Integer from Standard );
965 ACPick : CPick from Graphic3d;
966 AField : Integer from Standard );
968 PrintCStructure ( me;
969 ACStructure : CStructure from Graphic3d;
970 AField : Integer from Standard );
973 ACView : CView from Graphic3d;
974 AField : Integer from Standard );
977 AFunc : CString from Standard );
980 AComment : CString from Standard;
981 AValue : Integer from Standard );
984 AFunc : CString from Standard;
985 AResult : Integer from Standard );
988 AComment : CString from Standard;
989 AValue : ShortReal from Standard );
992 AComment : CString from Standard;
993 AMatrix : Array2OfReal from TColStd )
994 raises TransformError from Graphic3d;
997 AComment : CString from Standard;
998 AString : CString from Standard );
1000 SetTrace ( me : mutable;
1001 ALevel : Integer from Standard )
1005 returns Integer from Standard
1008 --ListOfAvalableFontNames( me;
1009 -- lst: out NListOfHAsciiString from Graphic3d )
1010 -- returns Boolean from Standard
1012 -- Purpose: Initialize list of names of avalable system fonts
1013 -- returns Standard_False if fails
1014 -- ABD Integration support of system fonts (using FTGL and FreeType)
1016 GetDisplayConnection (me)
1017 returns DisplayConnection_Handle from Aspect;
1018 ---C++: return const &
1020 ---Purpose: returns Handle to display connection
1023 returns Boolean from Standard;
1024 -- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
1026 ResetDeviceLostFlag (me: mutable);
1027 -- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
1031 MyTraceLevel : Integer from Standard is protected;
1032 MySharedLibrary : SharedLibrary from OSD is protected;
1033 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
1034 myDeviceLostFlag : Boolean from Standard is protected;
1036 end GraphicDriver from Graphic3d;