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 SetStencilTestOptions ( me : mutable;
455 theCGroup : CGroup from Graphic3d;
456 theIsEnabled: Boolean from Standard)
458 ---Purpose: sets the stencil test to theIsEnabled state;
460 ----------------------------------------
461 -- Category: Methods to create Text
462 -- for Purpose : see Graphic3d_Group.cdl
463 ----------------------------------------
466 ACGroup : CGroup from Graphic3d;
467 AText : CString from Standard;
468 APoint : Vertex from Graphic3d;
469 AHeight : Real from Standard;
470 AAngle : PlaneAngle from Quantity;
471 ATp : TextPath from Graphic3d;
472 AHta : HorizontalTextAlignment from Graphic3d;
473 AVta : VerticalTextAlignment from Graphic3d;
474 EvalMinMax : Boolean from Standard = Standard_True )
476 ---Purpose: call_togl_text
479 ACGroup : CGroup from Graphic3d;
480 AText : CString from Standard;
481 APoint : Vertex from Graphic3d;
482 AHeight : Real from Standard;
483 EvalMinMax : Boolean from Standard = Standard_True )
485 ---Purpose: call_togl_text
488 ACGroup : CGroup from Graphic3d;
489 AText : ExtendedString from TCollection;
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 : ExtendedString from TCollection;
503 APoint : Vertex from Graphic3d;
504 AHeight : Real from Standard;
505 EvalMinMax : Boolean from Standard = Standard_True )
507 ---Purpose: call_togl_text
509 ----------------------------------------
510 ---Category: Methods to create Triangle
511 -- for Purpose : see Graphic3d_Group.cdl
512 ----------------------------------------
514 PrimitiveArray( me : mutable;
515 ACGroup : CGroup from Graphic3d;
516 parray : PrimitiveArray from Graphic3d;
517 EvalMinMax : Boolean from Standard = Standard_True )
519 ---Purpose: call_togl_parray
521 UserDraw( me : mutable;
522 ACGroup : CGroup from Graphic3d;
523 AUserDraw : CUserDraw from Graphic3d )
525 ---Purpose: call_togl_userdraw
527 EnableVBO( me : mutable;
528 status : Boolean from Standard )
530 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
533 theFreeBytes : out Size from Standard;
534 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
535 ---Purpose: Returns information about GPU memory usage.
537 ----------------------------------------
538 ---Category: Methods to create Triedron
539 -- for Purpose : see Graphic3d_Group.cdl
540 ----------------------------------------
542 ZBufferTriedronSetup ( me : mutable;
543 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
544 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
545 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
546 SizeRatio : Real from Standard = 0.8;
547 AxisDiametr : Real from Standard = 0.05;
548 NbFacettes : Integer from Standard = 12)
550 ---Purpose: call_togl_ztriedron_setup
552 TriedronDisplay ( me : mutable;
553 ACView : CView from Graphic3d;
554 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
555 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
556 AScale : Real from Standard = 0.02;
557 AsWireframe : Boolean from Standard = Standard_True )
559 ---Purpose: call_togl_triedron_display
562 TriedronErase ( me : mutable;
563 ACView : CView from Graphic3d)
565 ---Purpose: call_togl_triedron_erase
568 TriedronEcho ( me : mutable;
569 ACView : CView from Graphic3d;
570 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
572 ---Purpose: call_togl_triedron_echo
574 ---------------------------------
575 ---Category: Graduated trihedron
576 ---------------------------------
578 GraduatedTrihedronDisplay(me : mutable;
579 view : CView from Graphic3d;
580 cubic : CGraduatedTrihedron from Graphic3d)
581 ---Purpose: call_togl_graduatedtrihedron_display
584 GraduatedTrihedronErase(me : mutable;
585 view : CView from Graphic3d)
586 ---Purpose: call_togl_graduatedtrihedron_erase
589 GraduatedTrihedronMinMaxValues(me : mutable;
590 xmin : ShortReal from Standard;
591 ymin : ShortReal from Standard;
592 zmin : ShortReal from Standard;
593 xmax : ShortReal from Standard;
594 ymax : ShortReal from Standard;
595 zmax : ShortReal from Standard)
596 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
599 ----------------------------------
600 -- Category: Ajout mode methods
601 ----------------------------------
603 BeginAddMode ( me : mutable;
604 ACView : CView from Graphic3d)
605 returns Boolean from Standard
607 ---Purpose: call_togl_begin_ajout_mode
609 EndAddMode ( me : mutable)
611 ---Purpose: call_togl_end_ajout_mode
613 ----------------------------------
614 -- Category: Immediat mode methods
615 ----------------------------------
617 SetImmediateModeDrawToFront (me : mutable;
618 theCView : CView from Graphic3d;
619 theDrawToFrontBuffer : Boolean from Standard)
620 returns Boolean from Standard
622 ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
623 -- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
624 -- Fast, so preferred for interactive work (used by default).
625 -- However these extra drawings will be missed in image dump since it is performed from back buffer.
626 -- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
627 -- in run-time (in case of slow hardware) and/or tearing may appear.
628 -- So this is strongly recommended to draw only simple (fast) structures.
629 -- 2. FALSE. Drawing immediate mode structures to the back buffer.
630 -- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
631 -- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
632 -- @return previous mode.
634 BeginImmediatMode ( me : mutable;
635 ACView : CView from Graphic3d;
636 ACUnderLayer : CLayer2d from Aspect;
637 ACOverLayer : CLayer2d from Aspect;
638 DoubleBuffer : Boolean from Standard;
639 RetainMode : Boolean from Standard)
640 returns Boolean from Standard
642 ---Purpose: call_togl_begin_immediat_mode
644 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
645 aFlush : Boolean from Standard = Standard_True)
647 ---Purpose: call_togl_clear_immediat_mode
649 DrawStructure ( me : mutable;
650 ACStructure : CStructure from Graphic3d )
652 ---Purpose: call_togl_draw_structure
654 EndImmediatMode ( me : mutable;
655 Synchronize : Integer from Standard )
657 ---Purpose: call_togl_end_immediat_mode
659 -------------------------------
660 -- Category: Layer mode methods
661 -------------------------------
663 Layer ( me : mutable;
664 ACLayer : in out CLayer2d from Aspect )
666 ---Purpose: call_togl_layer2d
668 RemoveLayer ( me : mutable;
669 ACLayer : CLayer2d from Aspect )
671 ---Purpose: call_togl_removelayer2d
673 BeginLayer ( me : mutable;
674 ACLayer : CLayer2d from Aspect )
676 ---Purpose: call_togl_begin_layer2d
678 BeginPolygon2d ( me : mutable )
680 ---Purpose: call_togl_begin_polygon2d
682 BeginPolyline2d ( me : mutable )
684 ---Purpose: call_togl_begin_polyline2d
686 ClearLayer ( me : mutable;
687 ACLayer : CLayer2d from Aspect )
689 ---Purpose: call_togl_clear_layer2d
692 X : ShortReal from Standard;
693 Y : ShortReal from Standard )
695 ---Purpose: call_togl_draw2d
698 X : ShortReal from Standard;
699 Y : ShortReal from Standard )
701 ---Purpose: call_togl_edge2d
703 EndLayer ( me : mutable )
705 ---Purpose: call_togl_end_layer2d
707 EndPolygon2d ( me : mutable )
709 ---Purpose: call_togl_end_polygon2d
711 EndPolyline2d ( me : mutable )
713 ---Purpose: call_togl_end_polyline2d
716 X : ShortReal from Standard;
717 Y : ShortReal from Standard )
719 ---Purpose: call_togl_move2d
721 Rectangle ( me : mutable;
722 X, Y : ShortReal from Standard;
723 Width, Height : ShortReal from Standard )
725 ---Purpose: call_togl_rectangle2d
727 SetColor ( me : mutable;
728 R : ShortReal from Standard;
729 G : ShortReal from Standard;
730 B : ShortReal from Standard )
732 ---Purpose: call_togl_set_color
734 SetTransparency ( me : mutable;
735 ATransparency : ShortReal from Standard )
737 ---Purpose: call_togl_set_transparency
739 UnsetTransparency ( me : mutable )
741 ---Purpose: call_togl_unset_transparency
743 SetLineAttributes ( me : mutable;
744 Type : Integer from Standard;
745 Width : ShortReal from Standard )
747 ---Purpose: call_togl_set_line_attributes
750 SetTextAttributes ( me : mutable;
751 Font : CString from Standard;
752 Type : Integer from Standard;
753 R : ShortReal from Standard;
754 G : ShortReal from Standard;
755 B : ShortReal from Standard )
757 ---Purpose: Set text attributes for under-/overlayer.
758 -- <Font> argument defines the name of the font to be used,
759 -- <Type> argument defines the display type of the text,
760 -- <R> <G> <B> values define the color of decal or subtitle background.
761 -- To set the color of the text you can use the SetColor method.
764 AText : CString from Standard;
765 X, Y : ShortReal from Standard;
766 AHeight : ShortReal from Standard )
768 ---Purpose: call_togl_text2d
769 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
771 DefaultTextHeight( me )
772 returns ShortReal from Standard
777 AText : CString from Standard;
778 AHeight : ShortReal from Standard;
779 AWidth : in out ShortReal from Standard;
780 AnAscent : in out ShortReal from Standard;
781 ADescent : in out ShortReal from Standard )
783 ---Purpose: call_togl_textsize2d
785 SetBackFacingModel ( me : mutable;
786 aView : CView from Graphic3d )
788 ---Purpose: call_togl_backfacing
790 SetDepthTestEnabled( me; view : CView from Graphic3d;
791 isEnabled : Boolean from Standard )
793 ---Purpose: call_togl_depthtest
795 IsDepthTestEnabled( me; view : CView from Graphic3d )
796 returns Boolean from Standard is deferred;
797 ---Purpose: call_togl_isdepthtest
800 view : CView from Graphic3d;
802 width, height : Integer;
805 ---Purpose: Reads depths of shown pixels of the given
806 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
808 FBOCreate( me : mutable;
809 view : CView from Graphic3d;
810 width, height : Integer from Standard )
811 returns PtrFrameBuffer from Graphic3d
813 ---Purpose: Generate offscreen FBO in the graphic library.
814 -- If not supported on hardware returns NULL.
816 FBORelease( me : mutable;
817 view : CView from Graphic3d;
818 fboPtr : in out PtrFrameBuffer from Graphic3d )
820 ---Purpose: Remove offscreen FBO from the graphic library
822 FBOGetDimensions( me : mutable;
823 view : CView from Graphic3d;
824 fboPtr : PtrFrameBuffer from Graphic3d;
825 width, height : out Integer from Standard;
826 widthMax, heightMax : out Integer from Standard )
828 ---Purpose: Read offscreen FBO configuration.
830 FBOChangeViewport( me : mutable;
831 view : CView from Graphic3d;
832 fboPtr : in out PtrFrameBuffer from Graphic3d;
833 width, height : Integer from Standard )
835 ---Purpose: Change offscreen FBO viewport.
837 BufferDump( me : mutable;
838 theCView : CView from Graphic3d;
839 theImage : in out PixMap from Image;
840 theBufferType : BufferType from Graphic3d )
841 returns Boolean from Standard
843 ---Purpose: Dump active rendering buffer into specified memory buffer.
845 SetGLLightEnabled( me; view : CView from Graphic3d;
846 isEnabled : Boolean from Standard )
848 ---Purpose: call_togl_gllight
850 IsGLLightEnabled( me; view : CView from Graphic3d )
851 returns Boolean from Standard is deferred;
852 ---Purpose: call_togl_isgllight
855 ACView : CView from Graphic3d;
856 ACUnderLayer : CLayer2d from Aspect;
857 ACOverLayer : CLayer2d from Aspect;
858 hPrnDC : Handle from Aspect;
859 showBackground : Boolean;
861 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
862 theScaleFactor : Real from Standard = 1.0 )
863 returns Boolean from Standard is deferred;
865 ---Purpose: print the contents of all layers of the view to the printer.
866 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
867 -- <showBackground> : When set to FALSE then print the view without background color
868 -- (background is white)
869 -- else set to TRUE for printing with current background color.
870 -- <filename>: If != NULL, then the view will be printed to a file.
871 -- <printAlgorithm>: Select print algorithm: stretch, tile.
872 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
873 -- printings accordingly to the scale factor selected in the printer
874 -- properties dialog.
875 -- Returns Standard_True if the data is passed to the printer, otherwise
876 -- Standard_False if the print operation failed due to the printer errors,
877 -- or insufficient system memory available.
878 ---Warning: Works only under Windows.
881 theFileName : CString from Standard;
882 theFormat : ExportFormat from Graphic3d;
883 theSortType : SortType from Graphic3d;
884 theWidth, theHeight : Integer from Standard;
885 theView : CView from Graphic3d;
886 theLayerUnder : CLayer2d from Aspect;
887 theLayerOver : CLayer2d from Aspect;
888 thePrecision : Real from Standard = 0.005;
889 theProgressBarFunc : Address from Standard = NULL;
890 theProgressObject : Address from Standard = NULL )
891 returns Boolean from Standard
894 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
895 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
896 -- Notice however that results may differ a lot and do not contain some elements.
898 AddZLayer( me : mutable;
899 theCView : CView from Graphic3d;
900 theLayerId : Integer from Standard )
902 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
903 -- the view. Z layers allow drawing structures in higher layers
904 -- in foreground of structures in lower layers. To add a structure
905 -- to desired layer on display it is necessary to set the layer
906 -- ID for the structure.
908 RemoveZLayer( me : mutable;
909 theCView : CView from Graphic3d;
910 theLayerId : Integer from Standard )
912 ---Purpose: Remove Z layer from the specified view. All structures
913 -- displayed at the moment in layer will be displayed in default layer
914 -- ( the bottom-level z layer ). To unset layer ID from associated
915 -- structures use method UnsetZLayer (...).
917 UnsetZLayer( me : mutable;
918 theLayerId : Integer from Standard )
920 ---Purpose: Unset Z layer ID for all structures. The structure
921 -- indexes will be set to default layer ( the bottom-level z layer
924 ChangeZLayer( me : mutable;
925 theCStructure : CStructure from Graphic3d;
926 theLayerId : Integer from Standard )
928 ---Purpose: Change Z layer of a structure. The new z layer ID will
929 -- be used to define the associated layer for structure on display.
931 ChangeZLayer( me : mutable;
932 theCStructure : CStructure from Graphic3d;
933 theCView : CView from Graphic3d;
934 theNewLayerId : Integer from Standard )
936 ---Purpose: Change Z layer of a structure already presented in view.
939 theCStructure : CStructure from Graphic3d )
940 returns Integer from Standard is deferred;
941 ---Purpose: Get Z layer ID of structure. If the structure doesn't
942 -- exists in graphic driver, the method returns -1.
944 -----------------------------
945 -- Category: Internal methods
946 -----------------------------
949 AComment : CString from Standard;
950 AValue : Boolean from Standard );
953 ACGroup : CGroup from Graphic3d;
954 AField : Integer from Standard );
957 ACLight : CLight from Graphic3d;
958 AField : Integer from Standard );
961 ACPick : CPick from Graphic3d;
962 AField : Integer from Standard );
964 PrintCStructure ( me;
965 ACStructure : CStructure from Graphic3d;
966 AField : Integer from Standard );
969 ACView : CView from Graphic3d;
970 AField : Integer from Standard );
973 AFunc : CString from Standard );
976 AComment : CString from Standard;
977 AValue : Integer from Standard );
980 AFunc : CString from Standard;
981 AResult : Integer from Standard );
984 AComment : CString from Standard;
985 AValue : ShortReal from Standard );
988 AComment : CString from Standard;
989 AMatrix : Array2OfReal from TColStd )
990 raises TransformError from Graphic3d;
993 AComment : CString from Standard;
994 AString : CString from Standard );
996 SetTrace ( me : mutable;
997 ALevel : Integer from Standard )
1001 returns Integer from Standard
1004 --ListOfAvalableFontNames( me;
1005 -- lst: out NListOfHAsciiString from Graphic3d )
1006 -- returns Boolean from Standard
1008 -- Purpose: Initialize list of names of avalable system fonts
1009 -- returns Standard_False if fails
1010 -- ABD Integration support of system fonts (using FTGL and FreeType)
1012 GetDisplayConnection (me)
1013 returns DisplayConnection_Handle from Aspect;
1014 ---C++: return const &
1016 ---Purpose: returns Handle to display connection
1019 returns Boolean from Standard;
1020 -- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
1022 ResetDeviceLostFlag (me: mutable);
1023 -- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
1027 MyTraceLevel : Integer from Standard is protected;
1028 MySharedLibrary : SharedLibrary from OSD is protected;
1029 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
1030 myDeviceLostFlag : Boolean from Standard is protected;
1032 end GraphicDriver from Graphic3d;