0024413: Visualization - get rid of projection shift from orthographic camera definition
[occt.git] / src / Graphic3d / Graphic3d_GraphicDriver.cdl
CommitLineData
b311480e 1-- Created on: 1997-01-28
2-- Created by: CAL
3-- Copyright (c) 1997-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
7fd59977 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
b311480e 16
6942f04a 17deferred class GraphicDriver from Graphic3d inherits TShared
7fd59977 18
19 ---Version:
20
2166f0fa
SK
21 ---Purpose: This class allows the definition of a graphic driver
22 -- (currently only OpenGl driver is used).
7fd59977 23
2166f0fa 24 ---Keywords: OpenGl
7fd59977 25
26 ---Warning:
27 ---References:
28
29uses
30
31 SharedLibrary from OSD,
32
33 Array1OfInteger from TColStd,
34 Array1OfReal from TColStd,
35 Array2OfReal from TColStd,
36
f0430952 37 AsciiString from TCollection,
7fd59977 38 ExtendedString from TCollection,
39
40 NameOfColor from Quantity,
41 Color from Quantity,
42
43 PlaneAngle from Quantity,
44
692613e5 45 PixMap from Image,
7fd59977 46
47 Array1OfEdge from Aspect,
48 CLayer2d from Aspect,
7fd59977 49 TypeOfTriedronEcho from Aspect,
50 TypeOfTriedronPosition from Aspect,
51 Handle from Aspect,
52 Display from Aspect,
7edf74fd 53 PrintAlgo from Aspect,
dc3fe572 54 DisplayConnection_Handle from Aspect,
7fd59977 55
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,
64 CPick from Graphic3d,
65 CPlane from Graphic3d,
66 CStructure from Graphic3d,
67 CView from Graphic3d,
692613e5 68 BufferType from Graphic3d,
7fd59977 69 Structure from Graphic3d,
70 TextPath from Graphic3d,
71 TypeOfComposition from Graphic3d,
7fd59977 72 TypeOfPrimitive from Graphic3d,
73 Vector from Graphic3d,
74 Array1OfVertex from Graphic3d,
75 Array2OfVertex from Graphic3d,
76 Vertex from Graphic3d,
7fd59977 77 VerticalTextAlignment from Graphic3d,
7fd59977 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,
eeaaaefb 88 FontAspect from Font,
4269bd1b 89 CGraduatedTrihedron from Graphic3d,
938d4544 90 ClipPlane from Graphic3d,
91 Ax2 from gp
7fd59977 92
93raises
94
95 TransformError from Graphic3d
96
97is
98 Initialize ( AShrName : CString from Standard )
99 returns mutable GraphicDriver from Graphic3d;
100 ---Level: Public
101 ---Purpose: Initialises the Driver
102
103 -------------------------
104 -- Category: Init methods
105 -------------------------
106
dc3fe572 107 Begin (me: mutable;
108 theDisplayConnection: DisplayConnection_Handle from Aspect)
109 returns Boolean from Standard
110 is deferred;
111 ---Purpose: Starts graphic driver with given connection
7fd59977 112
113 End ( me : mutable )
114 is deferred;
115 ---Purpose: call_togl_end
116
117 ----------------------------
118 -- Category: Inquire methods
119 ----------------------------
120
121 InquireLightLimit ( me : mutable )
122 returns Integer from Standard
123 is deferred;
124 ---Purpose: call_togl_inquirelight
125
7fd59977 126 InquirePlaneLimit ( me : mutable )
127 returns Integer from Standard
128 is deferred;
129 ---Purpose: call_togl_inquireplane
130
131 InquireViewLimit ( me : mutable )
132 returns Integer from Standard
133 is deferred;
134 ---Purpose: call_togl_inquireview
135
7fd59977 136 ------------------------------
137 -- Category: Highlight methods
138 ------------------------------
139
140 Blink ( me : mutable;
141 ACStructure : CStructure from Graphic3d;
142 Create : Boolean from Standard )
143 is deferred;
144 ---Purpose: call_togl_blink
145
146 BoundaryBox ( me : mutable;
147 ACStructure : CStructure from Graphic3d;
148 Create : Boolean from Standard )
149 is deferred;
150 ---Purpose: call_togl_boundarybox
151
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 )
158 is deferred;
159 ---Purpose: call_togl_highlightcolor
160
161 NameSetStructure ( me : mutable;
162 ACStructure : CStructure from Graphic3d )
163 is deferred;
164 ---Purpose: call_togl_namesetstructure
165
166 -------------------------------------
167 -- Category: Group management methods
168 -------------------------------------
169
170 ClearGroup ( me : mutable;
171 ACGroup : CGroup from Graphic3d )
172 is deferred;
173 ---Purpose: call_togl_cleargroup
174
7fd59977 175 FaceContextGroup ( me : mutable;
176 ACGroup : CGroup from Graphic3d;
177 NoInsert : Integer from Standard )
178 is deferred;
179 ---Purpose: call_togl_facecontextgroup
180
181 Group ( me : mutable;
182 ACGroup : in out CGroup from Graphic3d )
183 is deferred;
184 ---Purpose: call_togl_group
185
186 LineContextGroup ( me : mutable;
187 ACGroup : CGroup from Graphic3d;
188 NoInsert : Integer from Standard )
189 is deferred;
190 ---Purpose: call_togl_linecontextgroup
191
192 MarkerContextGroup ( me : mutable;
193 ACGroup : CGroup from Graphic3d;
194 NoInsert : Integer from Standard )
195 is deferred;
196 ---Purpose: call_togl_markercontextgroup
197
7fd59977 198 RemoveGroup ( me : mutable;
199 ACGroup : CGroup from Graphic3d )
200 is deferred;
201 ---Purpose: call_togl_removegroup
202
203 TextContextGroup ( me : mutable;
204 ACGroup : CGroup from Graphic3d;
205 NoInsert : Integer from Standard )
206 is deferred;
207 ---Purpose: call_togl_textcontextgroup
208
209 -----------------------------------------
210 -- Category: Structure management methods
211 -----------------------------------------
212
213 ClearStructure ( me : mutable;
214 ACStructure : CStructure from Graphic3d )
215 is deferred;
216 ---Purpose: call_togl_clearstructure
217
218 Connect ( me : mutable;
219 AFather : CStructure from Graphic3d;
220 ASon : CStructure from Graphic3d )
221 is deferred;
222 ---Purpose: call_togl_connect
223
224 ContextStructure ( me : mutable;
225 ACStructure : CStructure from Graphic3d )
226 is deferred;
227 ---Purpose: call_togl_contextstructure
228
229 Disconnect ( me : mutable;
230 AFather : CStructure from Graphic3d;
231 ASon : CStructure from Graphic3d )
232 is deferred;
233 ---Purpose: call_togl_disconnect
234
235 DisplayStructure ( me : mutable;
236 ACView : CView from Graphic3d;
237 ACStructure : CStructure from Graphic3d;
238 APriority : Integer from Standard )
239 is deferred;
240 ---Purpose: call_togl_displaystructure
241
242 EraseStructure ( me : mutable;
243 ACView : CView from Graphic3d;
244 ACStructure : CStructure from Graphic3d )
245 is deferred;
246 ---Purpose: call_togl_erasestructure
247
248 RemoveStructure ( me : mutable;
249 ACStructure : CStructure from Graphic3d )
250 is deferred;
251 ---Purpose: call_togl_removestructure
252
253 Structure ( me : mutable;
254 ACStructure : in out CStructure from Graphic3d )
255 is deferred;
256 ---Purpose: call_togl_structure
257
7fd59977 258 ------------------------------------
259 -- Category: Structured mode methods
260 ------------------------------------
261
262 ActivateView ( me : mutable;
263 ACView : CView from Graphic3d )
264 is deferred;
265 ---Purpose: call_togl_activateview
266
267 AntiAliasing ( me : mutable;
268 ACView : CView from Graphic3d;
269 AFlag : Boolean from Standard )
270 is deferred;
271 ---Purpose: call_togl_antialiasing
272
273 Background ( me : mutable;
274 ACView : CView from Graphic3d )
275 is deferred;
276 ---Purpose: call_togl_background
277
278 GradientBackground ( me : mutable;
279 ACView : CView from Graphic3d;
280 AColor1: Color from Quantity;
281 AColor2: Color from Quantity;
282 FillStyle : GradientFillMethod from Aspect
283 )
2166f0fa 284 is deferred;
7fd59977 285 ---Purpose: call_togl_gradient_background
286
287
288 BackgroundImage( me : mutable;
289 FileName : CString from Standard;
290 ACView : CView from Graphic3d;
291 FillStyle : FillMethod from Aspect )
292 is deferred;
293
294 SetBgImageStyle( me : mutable;
295 ACView : CView from Graphic3d;
296 FillStyle : FillMethod from Aspect )
297 is deferred;
298
299 SetBgGradientStyle( me : mutable;
300 ACView : CView from Graphic3d;
301 FillStyle : GradientFillMethod from Aspect )
2166f0fa 302 is deferred;
7fd59977 303
304 ClipLimit ( me : mutable;
305 ACView : CView from Graphic3d;
306 AWait : Boolean from Standard )
307 is deferred;
308 ---Purpose: call_togl_cliplimit
309
310 DeactivateView ( me : mutable;
311 ACView : CView from Graphic3d )
312 is deferred;
313 ---Purpose: call_togl_deactivateview
314
315 DepthCueing ( me : mutable;
316 ACView : CView from Graphic3d;
317 AFlag : Boolean from Standard )
318 is deferred;
319 ---Purpose: call_togl_cliplimit
320
7fd59977 321 RatioWindow ( me : mutable;
322 ACView : CView from Graphic3d )
323 is deferred;
324 ---Purpose: call_togl_ratio_window
325
326 Redraw ( me : mutable;
327 ACView : CView from Graphic3d;
328 ACUnderLayer : CLayer2d from Aspect;
329 ACOverLayer : CLayer2d from Aspect;
330 x : Integer = 0;
331 y : Integer = 0;
332 width : Integer = 0;
333 height : Integer = 0 )
334 is deferred;
335 ---Purpose: call_togl_redraw
336 -- Warning: when the redraw area has a null size, the full view is redrawn
337
338 RemoveView ( me : mutable;
339 ACView : CView from Graphic3d )
340 is deferred;
341 ---Purpose: call_togl_removeview
342
343 SetLight ( me : mutable;
344 ACView : CView from Graphic3d )
345 is deferred;
346 ---Purpose: call_togl_setlight
347
4269bd1b 348 SetClipPlanes (me : mutable; theCView : CView from Graphic3d) is deferred;
349 ---Purpose: Pass clip planes to the associated graphic driver view.
350
351 SetClipPlanes (me : mutable; theCStructure : CStructure from Graphic3d) is deferred;
352 ---Purpose: Pass clip planes to the associated graphic driver structure.
7fd59977 353
b5ac8292 354 SetCamera (me : mutable; theCView : CView from Graphic3d)
355 is deferred;
356 ---Purpose: Inform graphic driver if camera assigned to view changes.
357
7fd59977 358 SetVisualisation ( me : mutable;
359 ACView : CView from Graphic3d )
360 is deferred;
361 ---Purpose: call_togl_setvisualisation
362
363 TransformStructure ( me : mutable;
364 ACStructure : CStructure from Graphic3d )
365 is deferred;
366 ---Purpose: call_togl_transformstructure
367
7fd59977 368 Transparency ( me : mutable;
369 ACView : CView from Graphic3d;
370 AFlag : Boolean from Standard )
371 is deferred;
372 ---Purpose: call_togl_transparency
373
374 Update ( me : mutable;
375 ACView : CView from Graphic3d;
376 ACUnderLayer : CLayer2d from Aspect;
377 ACOverLayer : CLayer2d from Aspect )
378 is deferred;
379 ---Purpose: call_togl_update
380
381 View ( me : mutable;
382 ACView : in out CView from Graphic3d )
383 returns Boolean from Standard
384 is deferred;
385 ---Purpose: call_togl_view
386
7fd59977 387 Environment ( me : mutable;
388 ACView : CView from Graphic3d )
389 is deferred;
390 ---Purpose:
391
a6eb515f 392 SetStencilTestOptions ( me : mutable;
393 theCGroup : CGroup from Graphic3d;
394 theIsEnabled: Boolean from Standard)
395 is deferred;
396 ---Purpose: sets the stencil test to theIsEnabled state;
938d4544 397
398 SetFlippingOptions (me : mutable;
399 theCGroup : CGroup from Graphic3d;
400 theIsEnabled: Boolean from Standard;
401 theRefPlane : Ax2 from gp)
402 is deferred;
403 ---Purpose: sets the flipping to theIsEnabled state for the given graphic group.
a6eb515f 404
7fd59977 405 ----------------------------------------
406 -- Category: Methods to create Text
407 -- for Purpose : see Graphic3d_Group.cdl
408 ----------------------------------------
409
410 Text ( me : mutable;
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 )
420 is deferred;
421 ---Purpose: call_togl_text
422
423 Text ( me : mutable;
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 )
429 is deferred;
430 ---Purpose: call_togl_text
431
432 Text ( me : mutable;
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 )
442 is deferred;
443 ---Purpose: call_togl_text
444
445 Text ( me : mutable;
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 )
451 is deferred;
452 ---Purpose: call_togl_text
453
454 ----------------------------------------
455 ---Category: Methods to create Triangle
456 -- for Purpose : see Graphic3d_Group.cdl
457 ----------------------------------------
458
7fd59977 459 PrimitiveArray( me : mutable;
460 ACGroup : CGroup from Graphic3d;
461 parray : PrimitiveArray from Graphic3d;
462 EvalMinMax : Boolean from Standard = Standard_True )
463 is deferred;
464 ---Purpose: call_togl_parray
465
466 UserDraw( me : mutable;
467 ACGroup : CGroup from Graphic3d;
468 AUserDraw : CUserDraw from Graphic3d )
469 is deferred;
470 ---Purpose: call_togl_userdraw
471
472 EnableVBO( me : mutable;
473 status : Boolean from Standard )
2166f0fa 474 is deferred;
7fd59977 475 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
476
f0430952 477 MemoryInfo (me;
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.
481
7fd59977 482 ----------------------------------------
483 ---Category: Methods to create Triedron
484 -- for Purpose : see Graphic3d_Group.cdl
485 ----------------------------------------
486
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)
494 is deferred;
495 ---Purpose: call_togl_ztriedron_setup
496
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 )
503 is deferred;
504 ---Purpose: call_togl_triedron_display
505
506
507 TriedronErase ( me : mutable;
508 ACView : CView from Graphic3d)
509 is deferred;
510 ---Purpose: call_togl_triedron_erase
511
512
513 TriedronEcho ( me : mutable;
514 ACView : CView from Graphic3d;
515 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
516 is deferred;
517 ---Purpose: call_togl_triedron_echo
518
519 ---------------------------------
520 ---Category: Graduated trihedron
521 ---------------------------------
522
7fd59977 523 GraduatedTrihedronDisplay(me : mutable;
524 view : CView from Graphic3d;
13a22457 525 cubic : CGraduatedTrihedron from Graphic3d)
7fd59977 526 ---Purpose: call_togl_graduatedtrihedron_display
527 is deferred;
528
529 GraduatedTrihedronErase(me : mutable;
530 view : CView from Graphic3d)
531 ---Purpose: call_togl_graduatedtrihedron_erase
532 is deferred;
533
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
542 is deferred;
543
7fd59977 544 ----------------------------------
545 -- Category: Ajout mode methods
546 ----------------------------------
547
548 BeginAddMode ( me : mutable;
549 ACView : CView from Graphic3d)
550 returns Boolean from Standard
551 is deferred;
552 ---Purpose: call_togl_begin_ajout_mode
553
554 EndAddMode ( me : mutable)
555 is deferred;
556 ---Purpose: call_togl_end_ajout_mode
557
558 ----------------------------------
559 -- Category: Immediat mode methods
560 ----------------------------------
561
1981cb22 562 SetImmediateModeDrawToFront (me : mutable;
563 theCView : CView from Graphic3d;
564 theDrawToFrontBuffer : Boolean from Standard)
565 returns Boolean from Standard
566 is deferred;
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.
578
7fd59977 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
586 is deferred;
587 ---Purpose: call_togl_begin_immediat_mode
588
7fd59977 589 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
590 aFlush : Boolean from Standard = Standard_True)
591 is deferred;
592 ---Purpose: call_togl_clear_immediat_mode
593
7fd59977 594 DrawStructure ( me : mutable;
595 ACStructure : CStructure from Graphic3d )
596 is deferred;
597 ---Purpose: call_togl_draw_structure
598
599 EndImmediatMode ( me : mutable;
600 Synchronize : Integer from Standard )
601 is deferred;
602 ---Purpose: call_togl_end_immediat_mode
603
7fd59977 604 -------------------------------
605 -- Category: Layer mode methods
606 -------------------------------
607
608 Layer ( me : mutable;
609 ACLayer : in out CLayer2d from Aspect )
610 is deferred;
611 ---Purpose: call_togl_layer2d
612
613 RemoveLayer ( me : mutable;
614 ACLayer : CLayer2d from Aspect )
615 is deferred;
616 ---Purpose: call_togl_removelayer2d
617
618 BeginLayer ( me : mutable;
619 ACLayer : CLayer2d from Aspect )
620 is deferred;
621 ---Purpose: call_togl_begin_layer2d
622
623 BeginPolygon2d ( me : mutable )
624 is deferred;
625 ---Purpose: call_togl_begin_polygon2d
626
627 BeginPolyline2d ( me : mutable )
628 is deferred;
629 ---Purpose: call_togl_begin_polyline2d
630
631 ClearLayer ( me : mutable;
632 ACLayer : CLayer2d from Aspect )
633 is deferred;
634 ---Purpose: call_togl_clear_layer2d
635
636 Draw ( me : mutable;
637 X : ShortReal from Standard;
638 Y : ShortReal from Standard )
639 is deferred;
640 ---Purpose: call_togl_draw2d
641
642 Edge ( me : mutable;
643 X : ShortReal from Standard;
644 Y : ShortReal from Standard )
645 is deferred;
646 ---Purpose: call_togl_edge2d
647
648 EndLayer ( me : mutable )
649 is deferred;
650 ---Purpose: call_togl_end_layer2d
651
652 EndPolygon2d ( me : mutable )
653 is deferred;
654 ---Purpose: call_togl_end_polygon2d
655
656 EndPolyline2d ( me : mutable )
657 is deferred;
658 ---Purpose: call_togl_end_polyline2d
659
660 Move ( me : mutable;
661 X : ShortReal from Standard;
662 Y : ShortReal from Standard )
663 is deferred;
664 ---Purpose: call_togl_move2d
665
666 Rectangle ( me : mutable;
667 X, Y : ShortReal from Standard;
668 Width, Height : ShortReal from Standard )
669 is deferred;
670 ---Purpose: call_togl_rectangle2d
671
672 SetColor ( me : mutable;
673 R : ShortReal from Standard;
674 G : ShortReal from Standard;
675 B : ShortReal from Standard )
676 is deferred;
677 ---Purpose: call_togl_set_color
678
679 SetTransparency ( me : mutable;
680 ATransparency : ShortReal from Standard )
681 is deferred;
682 ---Purpose: call_togl_set_transparency
683
684 UnsetTransparency ( me : mutable )
685 is deferred;
686 ---Purpose: call_togl_unset_transparency
687
688 SetLineAttributes ( me : mutable;
689 Type : Integer from Standard;
690 Width : ShortReal from Standard )
691 is deferred;
692 ---Purpose: call_togl_set_line_attributes
693
694
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 )
2166f0fa 701 is deferred;
25289ec1 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.
7fd59977 707
708 Text ( me : mutable;
709 AText : CString from Standard;
710 X, Y : ShortReal from Standard;
711 AHeight : ShortReal from Standard )
712 is deferred;
713 ---Purpose: call_togl_text2d
714 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
715
716 DefaultTextHeight( me )
717 returns ShortReal from Standard
718 is deferred;
719
720
721 TextSize( me;
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 )
727 is deferred;
728 ---Purpose: call_togl_textsize2d
729
730 SetBackFacingModel ( me : mutable;
731 aView : CView from Graphic3d )
732 is deferred;
733 ---Purpose: call_togl_backfacing
734
735 SetDepthTestEnabled( me; view : CView from Graphic3d;
736 isEnabled : Boolean from Standard )
737 is deferred;
738 ---Purpose: call_togl_depthtest
739
740 IsDepthTestEnabled( me; view : CView from Graphic3d )
741 returns Boolean from Standard is deferred;
742 ---Purpose: call_togl_isdepthtest
743
744 ReadDepths( me;
745 view : CView from Graphic3d;
746 x, y : Integer;
747 width, height : Integer;
748 buffer : Address )
749 is deferred;
750 ---Purpose: Reads depths of shown pixels of the given
751 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
752
753 FBOCreate( me : mutable;
754 view : CView from Graphic3d;
755 width, height : Integer from Standard )
756 returns PtrFrameBuffer from Graphic3d
757 is deferred;
758 ---Purpose: Generate offscreen FBO in the graphic library.
759 -- If not supported on hardware returns NULL.
760
761 FBORelease( me : mutable;
762 view : CView from Graphic3d;
763 fboPtr : in out PtrFrameBuffer from Graphic3d )
764 is deferred;
765 ---Purpose: Remove offscreen FBO from the graphic library
766
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 )
772 is deferred;
773 ---Purpose: Read offscreen FBO configuration.
774
775 FBOChangeViewport( me : mutable;
776 view : CView from Graphic3d;
777 fboPtr : in out PtrFrameBuffer from Graphic3d;
778 width, height : Integer from Standard )
779 is deferred;
780 ---Purpose: Change offscreen FBO viewport.
781
782 BufferDump( me : mutable;
692613e5 783 theCView : CView from Graphic3d;
784 theImage : in out PixMap from Image;
785 theBufferType : BufferType from Graphic3d )
7fd59977 786 returns Boolean from Standard
787 is deferred;
788 ---Purpose: Dump active rendering buffer into specified memory buffer.
789
790 SetGLLightEnabled( me; view : CView from Graphic3d;
791 isEnabled : Boolean from Standard )
792 is deferred;
793 ---Purpose: call_togl_gllight
794
795 IsGLLightEnabled( me; view : CView from Graphic3d )
796 returns Boolean from Standard is deferred;
797 ---Purpose: call_togl_isgllight
798
799 Print (me;
800 ACView : CView from Graphic3d;
801 ACUnderLayer : CLayer2d from Aspect;
802 ACOverLayer : CLayer2d from Aspect;
803 hPrnDC : Handle from Aspect;
804 showBackground : Boolean;
7edf74fd
A
805 filename : CString;
806 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
807 theScaleFactor : Real from Standard = 1.0 )
808 returns Boolean from Standard is deferred;
7fd59977 809 ---Level: Internal
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.
7edf74fd
A
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.
7fd59977 823 ---Warning: Works only under Windows.
824
7fd59977 825 Export( me: mutable;
5cedc27f
K
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
837 is deferred;
838 ---Purpose:
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.
7fd59977 842
59f45b7c 843 AddZLayer( me : mutable;
844 theCView : CView from Graphic3d;
845 theLayerId : Integer from Standard )
846 is deferred;
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.
852
853 RemoveZLayer( me : mutable;
854 theCView : CView from Graphic3d;
855 theLayerId : Integer from Standard )
856 is deferred;
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 (...).
861
862 UnsetZLayer( me : mutable;
863 theLayerId : Integer from Standard )
864 is deferred;
865 ---Purpose: Unset Z layer ID for all structures. The structure
866 -- indexes will be set to default layer ( the bottom-level z layer
867 -- with ID = 0 ).
868
869 ChangeZLayer( me : mutable;
870 theCStructure : CStructure from Graphic3d;
871 theLayerId : Integer from Standard )
872 is deferred;
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.
875
876 ChangeZLayer( me : mutable;
877 theCStructure : CStructure from Graphic3d;
878 theCView : CView from Graphic3d;
879 theNewLayerId : Integer from Standard )
880 is deferred;
881 ---Purpose: Change Z layer of a structure already presented in view.
882
883 GetZLayer( me;
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.
888
7fd59977 889 -----------------------------
890 -- Category: Internal methods
891 -----------------------------
892
893 PrintBoolean ( me;
894 AComment : CString from Standard;
895 AValue : Boolean from Standard );
896
897 PrintCGroup ( me;
898 ACGroup : CGroup from Graphic3d;
899 AField : Integer from Standard );
900
901 PrintCLight ( me;
902 ACLight : CLight from Graphic3d;
903 AField : Integer from Standard );
904
905 PrintCPick ( me;
906 ACPick : CPick from Graphic3d;
907 AField : Integer from Standard );
7fd59977 908
909 PrintCStructure ( me;
910 ACStructure : CStructure from Graphic3d;
911 AField : Integer from Standard );
912
913 PrintCView ( me;
914 ACView : CView from Graphic3d;
915 AField : Integer from Standard );
916
917 PrintFunction ( me;
918 AFunc : CString from Standard );
919
920 PrintInteger ( me;
921 AComment : CString from Standard;
922 AValue : Integer from Standard );
923
924 PrintIResult ( me;
925 AFunc : CString from Standard;
926 AResult : Integer from Standard );
927
928 PrintShortReal ( me;
929 AComment : CString from Standard;
930 AValue : ShortReal from Standard );
931
932 PrintMatrix ( me;
933 AComment : CString from Standard;
934 AMatrix : Array2OfReal from TColStd )
935 raises TransformError from Graphic3d;
936
937 PrintString ( me;
938 AComment : CString from Standard;
939 AString : CString from Standard );
940
941 SetTrace ( me : mutable;
942 ALevel : Integer from Standard )
943 is static;
944
945 Trace ( me )
946 returns Integer from Standard
947 is static;
948
949 --ListOfAvalableFontNames( me;
950 -- lst: out NListOfHAsciiString from Graphic3d )
951 -- returns Boolean from Standard
952 -- is deferred;
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)
956
dc3fe572 957 GetDisplayConnection (me)
958 returns DisplayConnection_Handle from Aspect;
959 ---C++: return const &
960
961 ---Purpose: returns Handle to display connection
962
eb4320f2 963 IsDeviceLost (me)
964 returns Boolean from Standard;
965 -- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
966
967 ResetDeviceLostFlag (me: mutable);
968 -- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
969
7fd59977 970fields
971
dc3fe572 972 MyTraceLevel : Integer from Standard is protected;
973 MySharedLibrary : SharedLibrary from OSD is protected;
974 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
eb4320f2 975 myDeviceLostFlag : Boolean from Standard is protected;
7fd59977 976
977end GraphicDriver from Graphic3d;