1 -- Created on: 1997-01-28
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 deferred class GraphicDriver from Graphic3d inherits TShared
21 ---Purpose: This class allows the definition of a graphic driver
22 -- (currently only OpenGl driver is used).
31 SharedLibrary from OSD,
33 Array1OfInteger from TColStd,
34 Array1OfReal from TColStd,
35 Array2OfReal from TColStd,
37 AsciiString from TCollection,
38 ExtendedString from TCollection,
40 NameOfColor from Quantity,
43 PlaneAngle from Quantity,
47 Array1OfEdge from Aspect,
49 TypeOfTriedronEcho from Aspect,
50 TypeOfTriedronPosition from Aspect,
53 PrintAlgo from Aspect,
54 DisplayConnection_Handle from Aspect,
56 AspectLine3d from Graphic3d,
57 AspectMarker3d from Graphic3d,
58 AspectText3d from Graphic3d,
59 AspectFillArea3d from Graphic3d,
60 HorizontalTextAlignment from Graphic3d,
61 CBitFields20 from Graphic3d,
62 CGroup from Graphic3d,
63 CLight from Graphic3d,
65 CPlane from Graphic3d,
66 CStructure from Graphic3d,
68 BufferType from Graphic3d,
69 Structure from Graphic3d,
70 TextPath from Graphic3d,
71 TypeOfComposition from Graphic3d,
72 TypeOfPrimitive from Graphic3d,
73 Vector from Graphic3d,
74 Array1OfVertex from Graphic3d,
75 Array2OfVertex from Graphic3d,
76 Vertex from Graphic3d,
77 VerticalTextAlignment from Graphic3d,
78 PrimitiveArray from Graphic3d,
79 PtrFrameBuffer from Graphic3d,
80 HArray1OfByte from TColStd,
81 FillMethod from Aspect,
82 GradientFillMethod from Aspect,
83 ExportFormat from Graphic3d,
84 SortType from Graphic3d,
85 HArray1OfReal from TColStd,
86 CUserDraw from Graphic3d,
87 NListOfHAsciiString from Graphic3d,
89 CGraduatedTrihedron from Graphic3d,
90 ClipPlane from Graphic3d,
95 TransformError from Graphic3d
98 Initialize ( AShrName : CString from Standard )
99 returns mutable GraphicDriver from Graphic3d;
101 ---Purpose: Initialises the Driver
103 -------------------------
104 -- Category: Init methods
105 -------------------------
108 theDisplayConnection: DisplayConnection_Handle from Aspect)
109 returns Boolean from Standard
111 ---Purpose: Starts graphic driver with given connection
115 ---Purpose: call_togl_end
117 ----------------------------
118 -- Category: Inquire methods
119 ----------------------------
121 InquireLightLimit ( me : mutable )
122 returns Integer from Standard
124 ---Purpose: call_togl_inquirelight
126 InquirePlaneLimit ( me : mutable )
127 returns Integer from Standard
129 ---Purpose: call_togl_inquireplane
131 InquireViewLimit ( me : mutable )
132 returns Integer from Standard
134 ---Purpose: call_togl_inquireview
136 ------------------------------
137 -- Category: Highlight methods
138 ------------------------------
140 Blink ( me : mutable;
141 ACStructure : CStructure from Graphic3d;
142 Create : Boolean from Standard )
144 ---Purpose: call_togl_blink
146 BoundaryBox ( me : mutable;
147 ACStructure : CStructure from Graphic3d;
148 Create : Boolean from Standard )
150 ---Purpose: call_togl_boundarybox
152 HighlightColor ( me : mutable;
153 ACStructure : CStructure from Graphic3d;
154 R : ShortReal from Standard;
155 G : ShortReal from Standard;
156 B : ShortReal from Standard;
157 Create : Boolean from Standard )
159 ---Purpose: call_togl_highlightcolor
161 NameSetStructure ( me : mutable;
162 ACStructure : CStructure from Graphic3d )
164 ---Purpose: call_togl_namesetstructure
166 -------------------------------------
167 -- Category: Group management methods
168 -------------------------------------
170 ClearGroup ( me : mutable;
171 ACGroup : CGroup from Graphic3d )
173 ---Purpose: call_togl_cleargroup
175 FaceContextGroup ( me : mutable;
176 ACGroup : CGroup from Graphic3d;
177 NoInsert : Integer from Standard )
179 ---Purpose: call_togl_facecontextgroup
181 Group ( me : mutable;
182 ACGroup : in out CGroup from Graphic3d )
184 ---Purpose: call_togl_group
186 LineContextGroup ( me : mutable;
187 ACGroup : CGroup from Graphic3d;
188 NoInsert : Integer from Standard )
190 ---Purpose: call_togl_linecontextgroup
192 MarkerContextGroup ( me : mutable;
193 ACGroup : CGroup from Graphic3d;
194 NoInsert : Integer from Standard )
196 ---Purpose: call_togl_markercontextgroup
198 RemoveGroup ( me : mutable;
199 ACGroup : CGroup from Graphic3d )
201 ---Purpose: call_togl_removegroup
203 TextContextGroup ( me : mutable;
204 ACGroup : CGroup from Graphic3d;
205 NoInsert : Integer from Standard )
207 ---Purpose: call_togl_textcontextgroup
209 -----------------------------------------
210 -- Category: Structure management methods
211 -----------------------------------------
213 ClearStructure ( me : mutable;
214 ACStructure : CStructure from Graphic3d )
216 ---Purpose: call_togl_clearstructure
218 Connect ( me : mutable;
219 AFather : CStructure from Graphic3d;
220 ASon : CStructure from Graphic3d )
222 ---Purpose: call_togl_connect
224 ContextStructure ( me : mutable;
225 ACStructure : CStructure from Graphic3d )
227 ---Purpose: call_togl_contextstructure
229 Disconnect ( me : mutable;
230 AFather : CStructure from Graphic3d;
231 ASon : CStructure from Graphic3d )
233 ---Purpose: call_togl_disconnect
235 DisplayStructure ( me : mutable;
236 ACView : CView from Graphic3d;
237 ACStructure : CStructure from Graphic3d;
238 APriority : Integer from Standard )
240 ---Purpose: call_togl_displaystructure
242 EraseStructure ( me : mutable;
243 ACView : CView from Graphic3d;
244 ACStructure : CStructure from Graphic3d )
246 ---Purpose: call_togl_erasestructure
248 RemoveStructure ( me : mutable;
249 ACStructure : CStructure from Graphic3d )
251 ---Purpose: call_togl_removestructure
253 Structure ( me : mutable;
254 ACStructure : in out CStructure from Graphic3d )
256 ---Purpose: call_togl_structure
258 ------------------------------------
259 -- Category: Structured mode methods
260 ------------------------------------
262 ActivateView ( me : mutable;
263 ACView : CView from Graphic3d )
265 ---Purpose: call_togl_activateview
267 AntiAliasing ( me : mutable;
268 ACView : CView from Graphic3d;
269 AFlag : Boolean from Standard )
271 ---Purpose: call_togl_antialiasing
273 Background ( me : mutable;
274 ACView : CView from Graphic3d )
276 ---Purpose: call_togl_background
278 GradientBackground ( me : mutable;
279 ACView : CView from Graphic3d;
280 AColor1: Color from Quantity;
281 AColor2: Color from Quantity;
282 FillStyle : GradientFillMethod from Aspect
285 ---Purpose: call_togl_gradient_background
288 BackgroundImage( me : mutable;
289 FileName : CString from Standard;
290 ACView : CView from Graphic3d;
291 FillStyle : FillMethod from Aspect )
294 SetBgImageStyle( me : mutable;
295 ACView : CView from Graphic3d;
296 FillStyle : FillMethod from Aspect )
299 SetBgGradientStyle( me : mutable;
300 ACView : CView from Graphic3d;
301 FillStyle : GradientFillMethod from Aspect )
304 ClipLimit ( me : mutable;
305 ACView : CView from Graphic3d;
306 AWait : Boolean from Standard )
308 ---Purpose: call_togl_cliplimit
310 DeactivateView ( me : mutable;
311 ACView : CView from Graphic3d )
313 ---Purpose: call_togl_deactivateview
315 DepthCueing ( me : mutable;
316 ACView : CView from Graphic3d;
317 AFlag : Boolean from Standard )
319 ---Purpose: call_togl_cliplimit
321 RatioWindow ( me : mutable;
322 ACView : CView from Graphic3d )
324 ---Purpose: call_togl_ratio_window
326 Redraw ( me : mutable;
327 ACView : CView from Graphic3d;
328 ACUnderLayer : CLayer2d from Aspect;
329 ACOverLayer : CLayer2d from Aspect;
333 height : Integer = 0 )
335 ---Purpose: call_togl_redraw
336 -- Warning: when the redraw area has a null size, the full view is redrawn
338 RemoveView ( me : mutable;
339 ACView : CView from Graphic3d )
341 ---Purpose: call_togl_removeview
343 SetLight ( me : mutable;
344 ACView : CView from Graphic3d )
346 ---Purpose: call_togl_setlight
348 SetClipPlanes (me : mutable; theCView : CView from Graphic3d) is deferred;
349 ---Purpose: Pass clip planes to the associated graphic driver view.
351 SetClipPlanes (me : mutable; theCStructure : CStructure from Graphic3d) is deferred;
352 ---Purpose: Pass clip planes to the associated graphic driver structure.
354 SetCamera (me : mutable; theCView : CView from Graphic3d)
356 ---Purpose: Inform graphic driver if camera assigned to view changes.
358 SetVisualisation ( me : mutable;
359 ACView : CView from Graphic3d )
361 ---Purpose: call_togl_setvisualisation
363 TransformStructure ( me : mutable;
364 ACStructure : CStructure from Graphic3d )
366 ---Purpose: call_togl_transformstructure
368 Transparency ( me : mutable;
369 ACView : CView from Graphic3d;
370 AFlag : Boolean from Standard )
372 ---Purpose: call_togl_transparency
374 Update ( me : mutable;
375 ACView : CView from Graphic3d;
376 ACUnderLayer : CLayer2d from Aspect;
377 ACOverLayer : CLayer2d from Aspect )
379 ---Purpose: call_togl_update
382 ACView : in out CView from Graphic3d )
383 returns Boolean from Standard
385 ---Purpose: call_togl_view
387 Environment ( me : mutable;
388 ACView : CView from Graphic3d )
392 SetStencilTestOptions ( me : mutable;
393 theCGroup : CGroup from Graphic3d;
394 theIsEnabled: Boolean from Standard)
396 ---Purpose: sets the stencil test to theIsEnabled state;
398 SetFlippingOptions (me : mutable;
399 theCGroup : CGroup from Graphic3d;
400 theIsEnabled: Boolean from Standard;
401 theRefPlane : Ax2 from gp)
403 ---Purpose: sets the flipping to theIsEnabled state for the given graphic group.
405 ----------------------------------------
406 -- Category: Methods to create Text
407 -- for Purpose : see Graphic3d_Group.cdl
408 ----------------------------------------
411 ACGroup : CGroup from Graphic3d;
412 AText : CString from Standard;
413 APoint : Vertex from Graphic3d;
414 AHeight : Real from Standard;
415 AAngle : PlaneAngle from Quantity;
416 ATp : TextPath from Graphic3d;
417 AHta : HorizontalTextAlignment from Graphic3d;
418 AVta : VerticalTextAlignment from Graphic3d;
419 EvalMinMax : Boolean from Standard = Standard_True )
421 ---Purpose: call_togl_text
424 ACGroup : CGroup from Graphic3d;
425 AText : CString from Standard;
426 APoint : Vertex from Graphic3d;
427 AHeight : Real from Standard;
428 EvalMinMax : Boolean from Standard = Standard_True )
430 ---Purpose: call_togl_text
433 ACGroup : CGroup from Graphic3d;
434 AText : ExtendedString from TCollection;
435 APoint : Vertex from Graphic3d;
436 AHeight : Real from Standard;
437 AAngle : PlaneAngle from Quantity;
438 ATp : TextPath from Graphic3d;
439 AHta : HorizontalTextAlignment from Graphic3d;
440 AVta : VerticalTextAlignment from Graphic3d;
441 EvalMinMax : Boolean from Standard = Standard_True )
443 ---Purpose: call_togl_text
446 ACGroup : CGroup from Graphic3d;
447 AText : ExtendedString from TCollection;
448 APoint : Vertex from Graphic3d;
449 AHeight : Real from Standard;
450 EvalMinMax : Boolean from Standard = Standard_True )
452 ---Purpose: call_togl_text
454 ----------------------------------------
455 ---Category: Methods to create Triangle
456 -- for Purpose : see Graphic3d_Group.cdl
457 ----------------------------------------
459 PrimitiveArray( me : mutable;
460 ACGroup : CGroup from Graphic3d;
461 parray : PrimitiveArray from Graphic3d;
462 EvalMinMax : Boolean from Standard = Standard_True )
464 ---Purpose: call_togl_parray
466 UserDraw( me : mutable;
467 ACGroup : CGroup from Graphic3d;
468 AUserDraw : CUserDraw from Graphic3d )
470 ---Purpose: call_togl_userdraw
472 EnableVBO( me : mutable;
473 status : Boolean from Standard )
475 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
478 theFreeBytes : out Size from Standard;
479 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
480 ---Purpose: Returns information about GPU memory usage.
482 ----------------------------------------
483 ---Category: Methods to create Triedron
484 -- for Purpose : see Graphic3d_Group.cdl
485 ----------------------------------------
487 ZBufferTriedronSetup ( me : mutable;
488 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
489 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
490 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
491 SizeRatio : Real from Standard = 0.8;
492 AxisDiametr : Real from Standard = 0.05;
493 NbFacettes : Integer from Standard = 12)
495 ---Purpose: call_togl_ztriedron_setup
497 TriedronDisplay ( me : mutable;
498 ACView : CView from Graphic3d;
499 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
500 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
501 AScale : Real from Standard = 0.02;
502 AsWireframe : Boolean from Standard = Standard_True )
504 ---Purpose: call_togl_triedron_display
507 TriedronErase ( me : mutable;
508 ACView : CView from Graphic3d)
510 ---Purpose: call_togl_triedron_erase
513 TriedronEcho ( me : mutable;
514 ACView : CView from Graphic3d;
515 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
517 ---Purpose: call_togl_triedron_echo
519 ---------------------------------
520 ---Category: Graduated trihedron
521 ---------------------------------
523 GraduatedTrihedronDisplay(me : mutable;
524 view : CView from Graphic3d;
525 cubic : CGraduatedTrihedron from Graphic3d)
526 ---Purpose: call_togl_graduatedtrihedron_display
529 GraduatedTrihedronErase(me : mutable;
530 view : CView from Graphic3d)
531 ---Purpose: call_togl_graduatedtrihedron_erase
534 GraduatedTrihedronMinMaxValues(me : mutable;
535 xmin : ShortReal from Standard;
536 ymin : ShortReal from Standard;
537 zmin : ShortReal from Standard;
538 xmax : ShortReal from Standard;
539 ymax : ShortReal from Standard;
540 zmax : ShortReal from Standard)
541 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
544 ----------------------------------
545 -- Category: Ajout mode methods
546 ----------------------------------
548 BeginAddMode ( me : mutable;
549 ACView : CView from Graphic3d)
550 returns Boolean from Standard
552 ---Purpose: call_togl_begin_ajout_mode
554 EndAddMode ( me : mutable)
556 ---Purpose: call_togl_end_ajout_mode
558 ----------------------------------
559 -- Category: Immediat mode methods
560 ----------------------------------
562 SetImmediateModeDrawToFront (me : mutable;
563 theCView : CView from Graphic3d;
564 theDrawToFrontBuffer : Boolean from Standard)
565 returns Boolean from Standard
567 ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
568 -- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
569 -- Fast, so preferred for interactive work (used by default).
570 -- However these extra drawings will be missed in image dump since it is performed from back buffer.
571 -- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
572 -- in run-time (in case of slow hardware) and/or tearing may appear.
573 -- So this is strongly recommended to draw only simple (fast) structures.
574 -- 2. FALSE. Drawing immediate mode structures to the back buffer.
575 -- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
576 -- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
577 -- @return previous mode.
579 BeginImmediatMode ( me : mutable;
580 ACView : CView from Graphic3d;
581 ACUnderLayer : CLayer2d from Aspect;
582 ACOverLayer : CLayer2d from Aspect;
583 DoubleBuffer : Boolean from Standard;
584 RetainMode : Boolean from Standard)
585 returns Boolean from Standard
587 ---Purpose: call_togl_begin_immediat_mode
589 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
590 aFlush : Boolean from Standard = Standard_True)
592 ---Purpose: call_togl_clear_immediat_mode
594 DrawStructure ( me : mutable;
595 ACStructure : CStructure from Graphic3d )
597 ---Purpose: call_togl_draw_structure
599 EndImmediatMode ( me : mutable;
600 Synchronize : Integer from Standard )
602 ---Purpose: call_togl_end_immediat_mode
604 -------------------------------
605 -- Category: Layer mode methods
606 -------------------------------
608 Layer ( me : mutable;
609 ACLayer : in out CLayer2d from Aspect )
611 ---Purpose: call_togl_layer2d
613 RemoveLayer ( me : mutable;
614 ACLayer : CLayer2d from Aspect )
616 ---Purpose: call_togl_removelayer2d
618 BeginLayer ( me : mutable;
619 ACLayer : CLayer2d from Aspect )
621 ---Purpose: call_togl_begin_layer2d
623 BeginPolygon2d ( me : mutable )
625 ---Purpose: call_togl_begin_polygon2d
627 BeginPolyline2d ( me : mutable )
629 ---Purpose: call_togl_begin_polyline2d
631 ClearLayer ( me : mutable;
632 ACLayer : CLayer2d from Aspect )
634 ---Purpose: call_togl_clear_layer2d
637 X : ShortReal from Standard;
638 Y : ShortReal from Standard )
640 ---Purpose: call_togl_draw2d
643 X : ShortReal from Standard;
644 Y : ShortReal from Standard )
646 ---Purpose: call_togl_edge2d
648 EndLayer ( me : mutable )
650 ---Purpose: call_togl_end_layer2d
652 EndPolygon2d ( me : mutable )
654 ---Purpose: call_togl_end_polygon2d
656 EndPolyline2d ( me : mutable )
658 ---Purpose: call_togl_end_polyline2d
661 X : ShortReal from Standard;
662 Y : ShortReal from Standard )
664 ---Purpose: call_togl_move2d
666 Rectangle ( me : mutable;
667 X, Y : ShortReal from Standard;
668 Width, Height : ShortReal from Standard )
670 ---Purpose: call_togl_rectangle2d
672 SetColor ( me : mutable;
673 R : ShortReal from Standard;
674 G : ShortReal from Standard;
675 B : ShortReal from Standard )
677 ---Purpose: call_togl_set_color
679 SetTransparency ( me : mutable;
680 ATransparency : ShortReal from Standard )
682 ---Purpose: call_togl_set_transparency
684 UnsetTransparency ( me : mutable )
686 ---Purpose: call_togl_unset_transparency
688 SetLineAttributes ( me : mutable;
689 Type : Integer from Standard;
690 Width : ShortReal from Standard )
692 ---Purpose: call_togl_set_line_attributes
695 SetTextAttributes ( me : mutable;
696 Font : CString from Standard;
697 Type : Integer from Standard;
698 R : ShortReal from Standard;
699 G : ShortReal from Standard;
700 B : ShortReal from Standard )
702 ---Purpose: Set text attributes for under-/overlayer.
703 -- <Font> argument defines the name of the font to be used,
704 -- <Type> argument defines the display type of the text,
705 -- <R> <G> <B> values define the color of decal or subtitle background.
706 -- To set the color of the text you can use the SetColor method.
709 AText : CString from Standard;
710 X, Y : ShortReal from Standard;
711 AHeight : ShortReal from Standard )
713 ---Purpose: call_togl_text2d
714 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
716 DefaultTextHeight( me )
717 returns ShortReal from Standard
722 AText : CString from Standard;
723 AHeight : ShortReal from Standard;
724 AWidth : in out ShortReal from Standard;
725 AnAscent : in out ShortReal from Standard;
726 ADescent : in out ShortReal from Standard )
728 ---Purpose: call_togl_textsize2d
730 SetBackFacingModel ( me : mutable;
731 aView : CView from Graphic3d )
733 ---Purpose: call_togl_backfacing
735 SetDepthTestEnabled( me; view : CView from Graphic3d;
736 isEnabled : Boolean from Standard )
738 ---Purpose: call_togl_depthtest
740 IsDepthTestEnabled( me; view : CView from Graphic3d )
741 returns Boolean from Standard is deferred;
742 ---Purpose: call_togl_isdepthtest
745 view : CView from Graphic3d;
747 width, height : Integer;
750 ---Purpose: Reads depths of shown pixels of the given
751 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
753 FBOCreate( me : mutable;
754 view : CView from Graphic3d;
755 width, height : Integer from Standard )
756 returns PtrFrameBuffer from Graphic3d
758 ---Purpose: Generate offscreen FBO in the graphic library.
759 -- If not supported on hardware returns NULL.
761 FBORelease( me : mutable;
762 view : CView from Graphic3d;
763 fboPtr : in out PtrFrameBuffer from Graphic3d )
765 ---Purpose: Remove offscreen FBO from the graphic library
767 FBOGetDimensions( me : mutable;
768 view : CView from Graphic3d;
769 fboPtr : PtrFrameBuffer from Graphic3d;
770 width, height : out Integer from Standard;
771 widthMax, heightMax : out Integer from Standard )
773 ---Purpose: Read offscreen FBO configuration.
775 FBOChangeViewport( me : mutable;
776 view : CView from Graphic3d;
777 fboPtr : in out PtrFrameBuffer from Graphic3d;
778 width, height : Integer from Standard )
780 ---Purpose: Change offscreen FBO viewport.
782 BufferDump( me : mutable;
783 theCView : CView from Graphic3d;
784 theImage : in out PixMap from Image;
785 theBufferType : BufferType from Graphic3d )
786 returns Boolean from Standard
788 ---Purpose: Dump active rendering buffer into specified memory buffer.
790 SetGLLightEnabled( me; view : CView from Graphic3d;
791 isEnabled : Boolean from Standard )
793 ---Purpose: call_togl_gllight
795 IsGLLightEnabled( me; view : CView from Graphic3d )
796 returns Boolean from Standard is deferred;
797 ---Purpose: call_togl_isgllight
800 ACView : CView from Graphic3d;
801 ACUnderLayer : CLayer2d from Aspect;
802 ACOverLayer : CLayer2d from Aspect;
803 hPrnDC : Handle from Aspect;
804 showBackground : Boolean;
806 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
807 theScaleFactor : Real from Standard = 1.0 )
808 returns Boolean from Standard is deferred;
810 ---Purpose: print the contents of all layers of the view to the printer.
811 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
812 -- <showBackground> : When set to FALSE then print the view without background color
813 -- (background is white)
814 -- else set to TRUE for printing with current background color.
815 -- <filename>: If != NULL, then the view will be printed to a file.
816 -- <printAlgorithm>: Select print algorithm: stretch, tile.
817 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
818 -- printings accordingly to the scale factor selected in the printer
819 -- properties dialog.
820 -- Returns Standard_True if the data is passed to the printer, otherwise
821 -- Standard_False if the print operation failed due to the printer errors,
822 -- or insufficient system memory available.
823 ---Warning: Works only under Windows.
826 theFileName : CString from Standard;
827 theFormat : ExportFormat from Graphic3d;
828 theSortType : SortType from Graphic3d;
829 theWidth, theHeight : Integer from Standard;
830 theView : CView from Graphic3d;
831 theLayerUnder : CLayer2d from Aspect;
832 theLayerOver : CLayer2d from Aspect;
833 thePrecision : Real from Standard = 0.005;
834 theProgressBarFunc : Address from Standard = NULL;
835 theProgressObject : Address from Standard = NULL )
836 returns Boolean from Standard
839 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
840 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
841 -- Notice however that results may differ a lot and do not contain some elements.
843 AddZLayer( me : mutable;
844 theCView : CView from Graphic3d;
845 theLayerId : Integer from Standard )
847 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
848 -- the view. Z layers allow drawing structures in higher layers
849 -- in foreground of structures in lower layers. To add a structure
850 -- to desired layer on display it is necessary to set the layer
851 -- ID for the structure.
853 RemoveZLayer( me : mutable;
854 theCView : CView from Graphic3d;
855 theLayerId : Integer from Standard )
857 ---Purpose: Remove Z layer from the specified view. All structures
858 -- displayed at the moment in layer will be displayed in default layer
859 -- ( the bottom-level z layer ). To unset layer ID from associated
860 -- structures use method UnsetZLayer (...).
862 UnsetZLayer( me : mutable;
863 theLayerId : Integer from Standard )
865 ---Purpose: Unset Z layer ID for all structures. The structure
866 -- indexes will be set to default layer ( the bottom-level z layer
869 ChangeZLayer( me : mutable;
870 theCStructure : CStructure from Graphic3d;
871 theLayerId : Integer from Standard )
873 ---Purpose: Change Z layer of a structure. The new z layer ID will
874 -- be used to define the associated layer for structure on display.
876 ChangeZLayer( me : mutable;
877 theCStructure : CStructure from Graphic3d;
878 theCView : CView from Graphic3d;
879 theNewLayerId : Integer from Standard )
881 ---Purpose: Change Z layer of a structure already presented in view.
884 theCStructure : CStructure from Graphic3d )
885 returns Integer from Standard is deferred;
886 ---Purpose: Get Z layer ID of structure. If the structure doesn't
887 -- exists in graphic driver, the method returns -1.
889 -----------------------------
890 -- Category: Internal methods
891 -----------------------------
894 AComment : CString from Standard;
895 AValue : Boolean from Standard );
898 ACGroup : CGroup from Graphic3d;
899 AField : Integer from Standard );
902 ACLight : CLight from Graphic3d;
903 AField : Integer from Standard );
906 ACPick : CPick from Graphic3d;
907 AField : Integer from Standard );
909 PrintCStructure ( me;
910 ACStructure : CStructure from Graphic3d;
911 AField : Integer from Standard );
914 ACView : CView from Graphic3d;
915 AField : Integer from Standard );
918 AFunc : CString from Standard );
921 AComment : CString from Standard;
922 AValue : Integer from Standard );
925 AFunc : CString from Standard;
926 AResult : Integer from Standard );
929 AComment : CString from Standard;
930 AValue : ShortReal from Standard );
933 AComment : CString from Standard;
934 AMatrix : Array2OfReal from TColStd )
935 raises TransformError from Graphic3d;
938 AComment : CString from Standard;
939 AString : CString from Standard );
941 SetTrace ( me : mutable;
942 ALevel : Integer from Standard )
946 returns Integer from Standard
949 --ListOfAvalableFontNames( me;
950 -- lst: out NListOfHAsciiString from Graphic3d )
951 -- returns Boolean from Standard
953 -- Purpose: Initialize list of names of avalable system fonts
954 -- returns Standard_False if fails
955 -- ABD Integration support of system fonts (using FTGL and FreeType)
957 GetDisplayConnection (me)
958 returns DisplayConnection_Handle from Aspect;
959 ---C++: return const &
961 ---Purpose: returns Handle to display connection
964 returns Boolean from Standard;
965 -- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
967 ResetDeviceLostFlag (me: mutable);
968 -- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
972 MyTraceLevel : Integer from Standard is protected;
973 MySharedLibrary : SharedLibrary from OSD is protected;
974 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
975 myDeviceLostFlag : Boolean from Standard is protected;
977 end GraphicDriver from Graphic3d;