0023712: Remove dependency on Aspect_GraphicDevice from Aspect_Window
[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
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
7fd59977 5--
b311480e 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.
10--
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.
13--
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.
20
7fd59977 21deferred class GraphicDriver from Graphic3d inherits GraphicDriver from Aspect
22
23 ---Version:
24
2166f0fa
SK
25 ---Purpose: This class allows the definition of a graphic driver
26 -- (currently only OpenGl driver is used).
7fd59977 27
2166f0fa 28 ---Keywords: OpenGl
7fd59977 29
30 ---Warning:
31 ---References:
32
33uses
34
35 SharedLibrary from OSD,
36
37 Array1OfInteger from TColStd,
38 Array1OfReal from TColStd,
39 Array2OfReal from TColStd,
40
f0430952 41 AsciiString from TCollection,
7fd59977 42 ExtendedString from TCollection,
43
44 NameOfColor from Quantity,
45 Color from Quantity,
46
47 PlaneAngle from Quantity,
48
49 AlienImage from AlienImage,
692613e5 50 PixMap from Image,
7fd59977 51
52 Array1OfEdge from Aspect,
53 CLayer2d from Aspect,
54 GraphicDriver from Aspect,
55 TypeOfTriedronEcho from Aspect,
56 TypeOfTriedronPosition from Aspect,
57 Handle from Aspect,
58 Display from Aspect,
7edf74fd 59 PrintAlgo from Aspect,
dc3fe572 60 DisplayConnection_Handle from Aspect,
7fd59977 61
62 AspectLine3d from Graphic3d,
63 AspectMarker3d from Graphic3d,
64 AspectText3d from Graphic3d,
65 AspectFillArea3d from Graphic3d,
66 HorizontalTextAlignment from Graphic3d,
67 CBitFields20 from Graphic3d,
68 CGroup from Graphic3d,
69 CLight from Graphic3d,
70 CPick from Graphic3d,
71 CPlane from Graphic3d,
72 CStructure from Graphic3d,
73 CView from Graphic3d,
692613e5 74 BufferType from Graphic3d,
7fd59977 75 Structure from Graphic3d,
76 TextPath from Graphic3d,
77 TypeOfComposition from Graphic3d,
7fd59977 78 TypeOfPrimitive from Graphic3d,
79 Vector from Graphic3d,
80 Array1OfVertex from Graphic3d,
81 Array2OfVertex from Graphic3d,
82 Vertex from Graphic3d,
7fd59977 83 VerticalTextAlignment from Graphic3d,
7fd59977 84 PrimitiveArray from Graphic3d,
85 PtrFrameBuffer from Graphic3d,
86 HArray1OfByte from TColStd,
87 FillMethod from Aspect,
88 GradientFillMethod from Aspect,
89 ExportFormat from Graphic3d,
90 SortType from Graphic3d,
91 HArray1OfReal from TColStd,
92 CUserDraw from Graphic3d,
93 NListOfHAsciiString from Graphic3d,
eeaaaefb 94 FontAspect from Font,
7fd59977 95 CGraduatedTrihedron from Graphic3d
96
97raises
98
99 TransformError from Graphic3d
100
101is
102 Initialize ( AShrName : CString from Standard )
103 returns mutable GraphicDriver from Graphic3d;
104 ---Level: Public
105 ---Purpose: Initialises the Driver
106
107 -------------------------
108 -- Category: Init methods
109 -------------------------
110
dc3fe572 111 Begin (me: mutable;
112 theDisplayConnection: DisplayConnection_Handle from Aspect)
113 returns Boolean from Standard
114 is deferred;
115 ---Purpose: Starts graphic driver with given connection
7fd59977 116
117 End ( me : mutable )
118 is deferred;
119 ---Purpose: call_togl_end
120
121 ----------------------------
122 -- Category: Inquire methods
123 ----------------------------
124
125 InquireLightLimit ( me : mutable )
126 returns Integer from Standard
127 is deferred;
128 ---Purpose: call_togl_inquirelight
129
130 InquireMat ( me : mutable;
131 ACView : CView from Graphic3d;
132 AMatO : out Array2OfReal from TColStd;
133 AMatM : out Array2OfReal from TColStd )
134 is deferred;
135 ---Purpose: call_togl_inquiremat
136
137 InquirePlaneLimit ( me : mutable )
138 returns Integer from Standard
139 is deferred;
140 ---Purpose: call_togl_inquireplane
141
142 InquireViewLimit ( me : mutable )
143 returns Integer from Standard
144 is deferred;
145 ---Purpose: call_togl_inquireview
146
7fd59977 147 ------------------------------
148 -- Category: Highlight methods
149 ------------------------------
150
151 Blink ( me : mutable;
152 ACStructure : CStructure from Graphic3d;
153 Create : Boolean from Standard )
154 is deferred;
155 ---Purpose: call_togl_blink
156
157 BoundaryBox ( me : mutable;
158 ACStructure : CStructure from Graphic3d;
159 Create : Boolean from Standard )
160 is deferred;
161 ---Purpose: call_togl_boundarybox
162
163 HighlightColor ( me : mutable;
164 ACStructure : CStructure from Graphic3d;
165 R : ShortReal from Standard;
166 G : ShortReal from Standard;
167 B : ShortReal from Standard;
168 Create : Boolean from Standard )
169 is deferred;
170 ---Purpose: call_togl_highlightcolor
171
172 NameSetStructure ( me : mutable;
173 ACStructure : CStructure from Graphic3d )
174 is deferred;
175 ---Purpose: call_togl_namesetstructure
176
177 -------------------------------------
178 -- Category: Group management methods
179 -------------------------------------
180
181 ClearGroup ( me : mutable;
182 ACGroup : CGroup from Graphic3d )
183 is deferred;
184 ---Purpose: call_togl_cleargroup
185
7fd59977 186 FaceContextGroup ( me : mutable;
187 ACGroup : CGroup from Graphic3d;
188 NoInsert : Integer from Standard )
189 is deferred;
190 ---Purpose: call_togl_facecontextgroup
191
192 Group ( me : mutable;
193 ACGroup : in out CGroup from Graphic3d )
194 is deferred;
195 ---Purpose: call_togl_group
196
197 LineContextGroup ( me : mutable;
198 ACGroup : CGroup from Graphic3d;
199 NoInsert : Integer from Standard )
200 is deferred;
201 ---Purpose: call_togl_linecontextgroup
202
203 MarkerContextGroup ( me : mutable;
204 ACGroup : CGroup from Graphic3d;
205 NoInsert : Integer from Standard )
206 is deferred;
207 ---Purpose: call_togl_markercontextgroup
208
209 MarkerContextGroup ( me : mutable;
210 ACGroup : CGroup from Graphic3d;
211 NoInsert : Integer from Standard;
212 AMarkWidth : Integer from Standard;
213 AMarkHeight: Integer from Standard;
214 ATexture : HArray1OfByte from TColStd )
215 is deferred;
216 ---Purpose: call_togl_markercontextgroup
217
7fd59977 218 RemoveGroup ( me : mutable;
219 ACGroup : CGroup from Graphic3d )
220 is deferred;
221 ---Purpose: call_togl_removegroup
222
223 TextContextGroup ( me : mutable;
224 ACGroup : CGroup from Graphic3d;
225 NoInsert : Integer from Standard )
226 is deferred;
227 ---Purpose: call_togl_textcontextgroup
228
229 -----------------------------------------
230 -- Category: Structure management methods
231 -----------------------------------------
232
233 ClearStructure ( me : mutable;
234 ACStructure : CStructure from Graphic3d )
235 is deferred;
236 ---Purpose: call_togl_clearstructure
237
238 Connect ( me : mutable;
239 AFather : CStructure from Graphic3d;
240 ASon : CStructure from Graphic3d )
241 is deferred;
242 ---Purpose: call_togl_connect
243
244 ContextStructure ( me : mutable;
245 ACStructure : CStructure from Graphic3d )
246 is deferred;
247 ---Purpose: call_togl_contextstructure
248
249 Disconnect ( me : mutable;
250 AFather : CStructure from Graphic3d;
251 ASon : CStructure from Graphic3d )
252 is deferred;
253 ---Purpose: call_togl_disconnect
254
255 DisplayStructure ( me : mutable;
256 ACView : CView from Graphic3d;
257 ACStructure : CStructure from Graphic3d;
258 APriority : Integer from Standard )
259 is deferred;
260 ---Purpose: call_togl_displaystructure
261
262 EraseStructure ( me : mutable;
263 ACView : CView from Graphic3d;
264 ACStructure : CStructure from Graphic3d )
265 is deferred;
266 ---Purpose: call_togl_erasestructure
267
268 RemoveStructure ( me : mutable;
269 ACStructure : CStructure from Graphic3d )
270 is deferred;
271 ---Purpose: call_togl_removestructure
272
273 Structure ( me : mutable;
274 ACStructure : in out CStructure from Graphic3d )
275 is deferred;
276 ---Purpose: call_togl_structure
277
7fd59977 278 ------------------------------------
279 -- Category: Structured mode methods
280 ------------------------------------
281
282 ActivateView ( me : mutable;
283 ACView : CView from Graphic3d )
284 is deferred;
285 ---Purpose: call_togl_activateview
286
287 AntiAliasing ( me : mutable;
288 ACView : CView from Graphic3d;
289 AFlag : Boolean from Standard )
290 is deferred;
291 ---Purpose: call_togl_antialiasing
292
293 Background ( me : mutable;
294 ACView : CView from Graphic3d )
295 is deferred;
296 ---Purpose: call_togl_background
297
298 GradientBackground ( me : mutable;
299 ACView : CView from Graphic3d;
300 AColor1: Color from Quantity;
301 AColor2: Color from Quantity;
302 FillStyle : GradientFillMethod from Aspect
303 )
2166f0fa 304 is deferred;
7fd59977 305 ---Purpose: call_togl_gradient_background
306
307
308 BackgroundImage( me : mutable;
309 FileName : CString from Standard;
310 ACView : CView from Graphic3d;
311 FillStyle : FillMethod from Aspect )
312 is deferred;
313
314 SetBgImageStyle( me : mutable;
315 ACView : CView from Graphic3d;
316 FillStyle : FillMethod from Aspect )
317 is deferred;
318
319 SetBgGradientStyle( me : mutable;
320 ACView : CView from Graphic3d;
321 FillStyle : GradientFillMethod from Aspect )
2166f0fa 322 is deferred;
7fd59977 323
324 ClipLimit ( me : mutable;
325 ACView : CView from Graphic3d;
326 AWait : Boolean from Standard )
327 is deferred;
328 ---Purpose: call_togl_cliplimit
329
330 DeactivateView ( me : mutable;
331 ACView : CView from Graphic3d )
332 is deferred;
333 ---Purpose: call_togl_deactivateview
334
335 DepthCueing ( me : mutable;
336 ACView : CView from Graphic3d;
337 AFlag : Boolean from Standard )
338 is deferred;
339 ---Purpose: call_togl_cliplimit
340
341 ProjectRaster ( me : mutable;
342 ACView : CView from Graphic3d;
343 AX : ShortReal from Standard;
344 AY : ShortReal from Standard;
345 AZ : ShortReal from Standard;
346 AU : out Integer from Standard;
347 AV : out Integer from Standard )
348 returns Boolean from Standard
349 is deferred;
350 ---Purpose: call_togl_unproject_raster
351
352 UnProjectRaster ( me : mutable;
353 ACView : CView from Graphic3d;
354 Axm : Integer from Standard;
355 Aym : Integer from Standard;
356 AXM : Integer from Standard;
357 AYM : Integer from Standard;
358 AU : Integer from Standard;
359 AV : Integer from Standard;
360 AX : out ShortReal from Standard;
361 AY : out ShortReal from Standard;
362 AZ : out ShortReal from Standard )
363 returns Boolean from Standard
364 is deferred;
365 ---Purpose: call_togl_unproject_raster
366
367 UnProjectRasterWithRay ( me : mutable;
368 ACView : CView from Graphic3d;
369 Axm : Integer from Standard;
370 Aym : Integer from Standard;
371 AXM : Integer from Standard;
372 AYM : Integer from Standard;
373 AU : Integer from Standard;
374 AV : Integer from Standard;
375 AX : out ShortReal from Standard;
376 AY : out ShortReal from Standard;
377 AZ : out ShortReal from Standard;
378 DX : out ShortReal from Standard;
379 DY : out ShortReal from Standard;
380 DZ : out ShortReal from Standard )
381 returns Boolean from Standard
382 is deferred;
383 ---Purpose: call_togl_unproject_raster_with_ray
384
385 RatioWindow ( me : mutable;
386 ACView : CView from Graphic3d )
387 is deferred;
388 ---Purpose: call_togl_ratio_window
389
390 Redraw ( me : mutable;
391 ACView : CView from Graphic3d;
392 ACUnderLayer : CLayer2d from Aspect;
393 ACOverLayer : CLayer2d from Aspect;
394 x : Integer = 0;
395 y : Integer = 0;
396 width : Integer = 0;
397 height : Integer = 0 )
398 is deferred;
399 ---Purpose: call_togl_redraw
400 -- Warning: when the redraw area has a null size, the full view is redrawn
401
402 RemoveView ( me : mutable;
403 ACView : CView from Graphic3d )
404 is deferred;
405 ---Purpose: call_togl_removeview
406
407 SetLight ( me : mutable;
408 ACView : CView from Graphic3d )
409 is deferred;
410 ---Purpose: call_togl_setlight
411
412 SetPlane ( me : mutable;
413 ACView : CView from Graphic3d )
414 is deferred;
415 ---Purpose: call_togl_setplane
416
417 SetVisualisation ( me : mutable;
418 ACView : CView from Graphic3d )
419 is deferred;
420 ---Purpose: call_togl_setvisualisation
421
422 TransformStructure ( me : mutable;
423 ACStructure : CStructure from Graphic3d )
424 is deferred;
425 ---Purpose: call_togl_transformstructure
426
427 DegenerateStructure ( me : mutable;
428 ACStructure : CStructure from Graphic3d )
429 is deferred;
430 ---Purpose: call_togl_degeneratestructure
431
432 Transparency ( me : mutable;
433 ACView : CView from Graphic3d;
434 AFlag : Boolean from Standard )
435 is deferred;
436 ---Purpose: call_togl_transparency
437
438 Update ( me : mutable;
439 ACView : CView from Graphic3d;
440 ACUnderLayer : CLayer2d from Aspect;
441 ACOverLayer : CLayer2d from Aspect )
442 is deferred;
443 ---Purpose: call_togl_update
444
445 View ( me : mutable;
446 ACView : in out CView from Graphic3d )
447 returns Boolean from Standard
448 is deferred;
449 ---Purpose: call_togl_view
450
451 ViewMapping ( me : mutable;
452 ACView : CView from Graphic3d;
453 AWait : Boolean from Standard )
454 is deferred;
455 ---Purpose: call_togl_viewmapping
456
457 ViewOrientation ( me : mutable;
458 ACView : CView from Graphic3d;
459 AWait : Boolean from Standard )
460 is deferred;
461 ---Purpose: call_togl_vieworientation
462
463 Environment ( me : mutable;
464 ACView : CView from Graphic3d )
465 is deferred;
466 ---Purpose:
467
468 ----------------------------------------
469 -- Category: Methods to create Marker
470 -- for Purpose : see Graphic3d_Group.cdl
471 ----------------------------------------
472
473 Marker ( me : mutable;
474 ACGroup : CGroup from Graphic3d;
b8ddfc2f 475 APoint : Vertex from Graphic3d )
7fd59977 476 is deferred;
477
478 MarkerSet ( me : mutable;
479 ACGroup : CGroup from Graphic3d;
b8ddfc2f 480 ListVertex : Array1OfVertex from Graphic3d )
7fd59977 481 is deferred;
482
7fd59977 483 ----------------------------------------
484 -- Category: Methods to create Text
485 -- for Purpose : see Graphic3d_Group.cdl
486 ----------------------------------------
487
488 Text ( me : mutable;
489 ACGroup : CGroup from Graphic3d;
490 AText : CString from Standard;
491 APoint : Vertex from Graphic3d;
492 AHeight : Real from Standard;
493 AAngle : PlaneAngle from Quantity;
494 ATp : TextPath from Graphic3d;
495 AHta : HorizontalTextAlignment from Graphic3d;
496 AVta : VerticalTextAlignment from Graphic3d;
497 EvalMinMax : Boolean from Standard = Standard_True )
498 is deferred;
499 ---Purpose: call_togl_text
500
501 Text ( me : mutable;
502 ACGroup : CGroup from Graphic3d;
503 AText : CString from Standard;
504 APoint : Vertex from Graphic3d;
505 AHeight : Real from Standard;
506 EvalMinMax : Boolean from Standard = Standard_True )
507 is deferred;
508 ---Purpose: call_togl_text
509
510 Text ( me : mutable;
511 ACGroup : CGroup from Graphic3d;
512 AText : ExtendedString from TCollection;
513 APoint : Vertex from Graphic3d;
514 AHeight : Real from Standard;
515 AAngle : PlaneAngle from Quantity;
516 ATp : TextPath from Graphic3d;
517 AHta : HorizontalTextAlignment from Graphic3d;
518 AVta : VerticalTextAlignment from Graphic3d;
519 EvalMinMax : Boolean from Standard = Standard_True )
520 is deferred;
521 ---Purpose: call_togl_text
522
523 Text ( me : mutable;
524 ACGroup : CGroup from Graphic3d;
525 AText : ExtendedString from TCollection;
526 APoint : Vertex from Graphic3d;
527 AHeight : Real from Standard;
528 EvalMinMax : Boolean from Standard = Standard_True )
529 is deferred;
530 ---Purpose: call_togl_text
531
532 ----------------------------------------
533 ---Category: Methods to create Triangle
534 -- for Purpose : see Graphic3d_Group.cdl
535 ----------------------------------------
536
7fd59977 537 PrimitiveArray( me : mutable;
538 ACGroup : CGroup from Graphic3d;
539 parray : PrimitiveArray from Graphic3d;
540 EvalMinMax : Boolean from Standard = Standard_True )
541 is deferred;
542 ---Purpose: call_togl_parray
543
544 UserDraw( me : mutable;
545 ACGroup : CGroup from Graphic3d;
546 AUserDraw : CUserDraw from Graphic3d )
547 is deferred;
548 ---Purpose: call_togl_userdraw
549
550 EnableVBO( me : mutable;
551 status : Boolean from Standard )
2166f0fa 552 is deferred;
7fd59977 553 ---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
554
f0430952 555 MemoryInfo (me;
556 theFreeBytes : out Size from Standard;
557 theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
558 ---Purpose: Returns information about GPU memory usage.
559
7fd59977 560 ----------------------------------------
561 ---Category: Methods to create Triedron
562 -- for Purpose : see Graphic3d_Group.cdl
563 ----------------------------------------
564
565 ZBufferTriedronSetup ( me : mutable;
566 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
567 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
568 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
569 SizeRatio : Real from Standard = 0.8;
570 AxisDiametr : Real from Standard = 0.05;
571 NbFacettes : Integer from Standard = 12)
572 is deferred;
573 ---Purpose: call_togl_ztriedron_setup
574
575 TriedronDisplay ( me : mutable;
576 ACView : CView from Graphic3d;
577 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
578 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
579 AScale : Real from Standard = 0.02;
580 AsWireframe : Boolean from Standard = Standard_True )
581 is deferred;
582 ---Purpose: call_togl_triedron_display
583
584
585 TriedronErase ( me : mutable;
586 ACView : CView from Graphic3d)
587 is deferred;
588 ---Purpose: call_togl_triedron_erase
589
590
591 TriedronEcho ( me : mutable;
592 ACView : CView from Graphic3d;
593 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
594 is deferred;
595 ---Purpose: call_togl_triedron_echo
596
597 ---------------------------------
598 ---Category: Graduated trihedron
599 ---------------------------------
600
7fd59977 601 GraduatedTrihedronDisplay(me : mutable;
602 view : CView from Graphic3d;
13a22457 603 cubic : CGraduatedTrihedron from Graphic3d)
7fd59977 604 ---Purpose: call_togl_graduatedtrihedron_display
605 is deferred;
606
607 GraduatedTrihedronErase(me : mutable;
608 view : CView from Graphic3d)
609 ---Purpose: call_togl_graduatedtrihedron_erase
610 is deferred;
611
612 GraduatedTrihedronMinMaxValues(me : mutable;
613 xmin : ShortReal from Standard;
614 ymin : ShortReal from Standard;
615 zmin : ShortReal from Standard;
616 xmax : ShortReal from Standard;
617 ymax : ShortReal from Standard;
618 zmax : ShortReal from Standard)
619 ---Purpose: call_togl_graduatedtrihedron_minmaxvalues
620 is deferred;
621
7fd59977 622 ---------------------------
623 -- Category: Animation mode
624 ---------------------------
625
626 BeginAnimation ( me : mutable;
627 ACView : CView from Graphic3d)
628 is deferred;
629 ---Purpose: call_togl_begin_animation
630
631 EndAnimation ( me : mutable;
632 ACView : CView from Graphic3d)
633 is deferred;
634 ---Purpose: call_togl_end_animation
635
636 ----------------------------------
637 -- Category: Ajout mode methods
638 ----------------------------------
639
640 BeginAddMode ( me : mutable;
641 ACView : CView from Graphic3d)
642 returns Boolean from Standard
643 is deferred;
644 ---Purpose: call_togl_begin_ajout_mode
645
646 EndAddMode ( me : mutable)
647 is deferred;
648 ---Purpose: call_togl_end_ajout_mode
649
650 ----------------------------------
651 -- Category: Immediat mode methods
652 ----------------------------------
653
1981cb22 654 SetImmediateModeDrawToFront (me : mutable;
655 theCView : CView from Graphic3d;
656 theDrawToFrontBuffer : Boolean from Standard)
657 returns Boolean from Standard
658 is deferred;
659 ---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
660 -- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
661 -- Fast, so preferred for interactive work (used by default).
662 -- However these extra drawings will be missed in image dump since it is performed from back buffer.
663 -- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
664 -- in run-time (in case of slow hardware) and/or tearing may appear.
665 -- So this is strongly recommended to draw only simple (fast) structures.
666 -- 2. FALSE. Drawing immediate mode structures to the back buffer.
667 -- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
668 -- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
669 -- @return previous mode.
670
7fd59977 671 BeginImmediatMode ( me : mutable;
672 ACView : CView from Graphic3d;
673 ACUnderLayer : CLayer2d from Aspect;
674 ACOverLayer : CLayer2d from Aspect;
675 DoubleBuffer : Boolean from Standard;
676 RetainMode : Boolean from Standard)
677 returns Boolean from Standard
678 is deferred;
679 ---Purpose: call_togl_begin_immediat_mode
680
7fd59977 681 ClearImmediatMode ( me : mutable; ACView : CView from Graphic3d;
682 aFlush : Boolean from Standard = Standard_True)
683 is deferred;
684 ---Purpose: call_togl_clear_immediat_mode
685
7fd59977 686 DrawStructure ( me : mutable;
687 ACStructure : CStructure from Graphic3d )
688 is deferred;
689 ---Purpose: call_togl_draw_structure
690
691 EndImmediatMode ( me : mutable;
692 Synchronize : Integer from Standard )
693 is deferred;
694 ---Purpose: call_togl_end_immediat_mode
695
7fd59977 696 -------------------------------
697 -- Category: Layer mode methods
698 -------------------------------
699
700 Layer ( me : mutable;
701 ACLayer : in out CLayer2d from Aspect )
702 is deferred;
703 ---Purpose: call_togl_layer2d
704
705 RemoveLayer ( me : mutable;
706 ACLayer : CLayer2d from Aspect )
707 is deferred;
708 ---Purpose: call_togl_removelayer2d
709
710 BeginLayer ( me : mutable;
711 ACLayer : CLayer2d from Aspect )
712 is deferred;
713 ---Purpose: call_togl_begin_layer2d
714
715 BeginPolygon2d ( me : mutable )
716 is deferred;
717 ---Purpose: call_togl_begin_polygon2d
718
719 BeginPolyline2d ( me : mutable )
720 is deferred;
721 ---Purpose: call_togl_begin_polyline2d
722
723 ClearLayer ( me : mutable;
724 ACLayer : CLayer2d from Aspect )
725 is deferred;
726 ---Purpose: call_togl_clear_layer2d
727
728 Draw ( me : mutable;
729 X : ShortReal from Standard;
730 Y : ShortReal from Standard )
731 is deferred;
732 ---Purpose: call_togl_draw2d
733
734 Edge ( me : mutable;
735 X : ShortReal from Standard;
736 Y : ShortReal from Standard )
737 is deferred;
738 ---Purpose: call_togl_edge2d
739
740 EndLayer ( me : mutable )
741 is deferred;
742 ---Purpose: call_togl_end_layer2d
743
744 EndPolygon2d ( me : mutable )
745 is deferred;
746 ---Purpose: call_togl_end_polygon2d
747
748 EndPolyline2d ( me : mutable )
749 is deferred;
750 ---Purpose: call_togl_end_polyline2d
751
752 Move ( me : mutable;
753 X : ShortReal from Standard;
754 Y : ShortReal from Standard )
755 is deferred;
756 ---Purpose: call_togl_move2d
757
758 Rectangle ( me : mutable;
759 X, Y : ShortReal from Standard;
760 Width, Height : ShortReal from Standard )
761 is deferred;
762 ---Purpose: call_togl_rectangle2d
763
764 SetColor ( me : mutable;
765 R : ShortReal from Standard;
766 G : ShortReal from Standard;
767 B : ShortReal from Standard )
768 is deferred;
769 ---Purpose: call_togl_set_color
770
771 SetTransparency ( me : mutable;
772 ATransparency : ShortReal from Standard )
773 is deferred;
774 ---Purpose: call_togl_set_transparency
775
776 UnsetTransparency ( me : mutable )
777 is deferred;
778 ---Purpose: call_togl_unset_transparency
779
780 SetLineAttributes ( me : mutable;
781 Type : Integer from Standard;
782 Width : ShortReal from Standard )
783 is deferred;
784 ---Purpose: call_togl_set_line_attributes
785
786
787 SetTextAttributes ( me : mutable;
788 Font : CString from Standard;
789 Type : Integer from Standard;
790 R : ShortReal from Standard;
791 G : ShortReal from Standard;
792 B : ShortReal from Standard )
2166f0fa 793 is deferred;
25289ec1 794 ---Purpose: Set text attributes for under-/overlayer.
795 -- <Font> argument defines the name of the font to be used,
796 -- <Type> argument defines the display type of the text,
797 -- <R> <G> <B> values define the color of decal or subtitle background.
798 -- To set the color of the text you can use the SetColor method.
7fd59977 799
800 Text ( me : mutable;
801 AText : CString from Standard;
802 X, Y : ShortReal from Standard;
803 AHeight : ShortReal from Standard )
804 is deferred;
805 ---Purpose: call_togl_text2d
806 -- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
807
808 DefaultTextHeight( me )
809 returns ShortReal from Standard
810 is deferred;
811
812
813 TextSize( me;
814 AText : CString from Standard;
815 AHeight : ShortReal from Standard;
816 AWidth : in out ShortReal from Standard;
817 AnAscent : in out ShortReal from Standard;
818 ADescent : in out ShortReal from Standard )
819 is deferred;
820 ---Purpose: call_togl_textsize2d
821
822 SetBackFacingModel ( me : mutable;
823 aView : CView from Graphic3d )
824 is deferred;
825 ---Purpose: call_togl_backfacing
826
827 SetDepthTestEnabled( me; view : CView from Graphic3d;
828 isEnabled : Boolean from Standard )
829 is deferred;
830 ---Purpose: call_togl_depthtest
831
832 IsDepthTestEnabled( me; view : CView from Graphic3d )
833 returns Boolean from Standard is deferred;
834 ---Purpose: call_togl_isdepthtest
835
836 ReadDepths( me;
837 view : CView from Graphic3d;
838 x, y : Integer;
839 width, height : Integer;
840 buffer : Address )
841 is deferred;
842 ---Purpose: Reads depths of shown pixels of the given
843 -- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
844
845 FBOCreate( me : mutable;
846 view : CView from Graphic3d;
847 width, height : Integer from Standard )
848 returns PtrFrameBuffer from Graphic3d
849 is deferred;
850 ---Purpose: Generate offscreen FBO in the graphic library.
851 -- If not supported on hardware returns NULL.
852
853 FBORelease( me : mutable;
854 view : CView from Graphic3d;
855 fboPtr : in out PtrFrameBuffer from Graphic3d )
856 is deferred;
857 ---Purpose: Remove offscreen FBO from the graphic library
858
859 FBOGetDimensions( me : mutable;
860 view : CView from Graphic3d;
861 fboPtr : PtrFrameBuffer from Graphic3d;
862 width, height : out Integer from Standard;
863 widthMax, heightMax : out Integer from Standard )
864 is deferred;
865 ---Purpose: Read offscreen FBO configuration.
866
867 FBOChangeViewport( me : mutable;
868 view : CView from Graphic3d;
869 fboPtr : in out PtrFrameBuffer from Graphic3d;
870 width, height : Integer from Standard )
871 is deferred;
872 ---Purpose: Change offscreen FBO viewport.
873
874 BufferDump( me : mutable;
692613e5 875 theCView : CView from Graphic3d;
876 theImage : in out PixMap from Image;
877 theBufferType : BufferType from Graphic3d )
7fd59977 878 returns Boolean from Standard
879 is deferred;
880 ---Purpose: Dump active rendering buffer into specified memory buffer.
881
882 SetGLLightEnabled( me; view : CView from Graphic3d;
883 isEnabled : Boolean from Standard )
884 is deferred;
885 ---Purpose: call_togl_gllight
886
887 IsGLLightEnabled( me; view : CView from Graphic3d )
888 returns Boolean from Standard is deferred;
889 ---Purpose: call_togl_isgllight
890
891 Print (me;
892 ACView : CView from Graphic3d;
893 ACUnderLayer : CLayer2d from Aspect;
894 ACOverLayer : CLayer2d from Aspect;
895 hPrnDC : Handle from Aspect;
896 showBackground : Boolean;
7edf74fd
A
897 filename : CString;
898 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
899 theScaleFactor : Real from Standard = 1.0 )
900 returns Boolean from Standard is deferred;
7fd59977 901 ---Level: Internal
902 ---Purpose: print the contents of all layers of the view to the printer.
903 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
904 -- <showBackground> : When set to FALSE then print the view without background color
905 -- (background is white)
906 -- else set to TRUE for printing with current background color.
907 -- <filename>: If != NULL, then the view will be printed to a file.
7edf74fd
A
908 -- <printAlgorithm>: Select print algorithm: stretch, tile.
909 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
910 -- printings accordingly to the scale factor selected in the printer
911 -- properties dialog.
912 -- Returns Standard_True if the data is passed to the printer, otherwise
913 -- Standard_False if the print operation failed due to the printer errors,
914 -- or insufficient system memory available.
7fd59977 915 ---Warning: Works only under Windows.
916
7fd59977 917 Export( me: mutable;
5cedc27f
K
918 theFileName : CString from Standard;
919 theFormat : ExportFormat from Graphic3d;
920 theSortType : SortType from Graphic3d;
921 theWidth, theHeight : Integer from Standard;
922 theView : CView from Graphic3d;
923 theLayerUnder : CLayer2d from Aspect;
924 theLayerOver : CLayer2d from Aspect;
925 thePrecision : Real from Standard = 0.005;
926 theProgressBarFunc : Address from Standard = NULL;
927 theProgressObject : Address from Standard = NULL )
928 returns Boolean from Standard
929 is deferred;
930 ---Purpose:
931 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
932 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
933 -- Notice however that results may differ a lot and do not contain some elements.
7fd59977 934
59f45b7c 935 AddZLayer( me : mutable;
936 theCView : CView from Graphic3d;
937 theLayerId : Integer from Standard )
938 is deferred;
939 ---Purpose: Add a new top-level z layer with ID <theLayerId> for
940 -- the view. Z layers allow drawing structures in higher layers
941 -- in foreground of structures in lower layers. To add a structure
942 -- to desired layer on display it is necessary to set the layer
943 -- ID for the structure.
944
945 RemoveZLayer( me : mutable;
946 theCView : CView from Graphic3d;
947 theLayerId : Integer from Standard )
948 is deferred;
949 ---Purpose: Remove Z layer from the specified view. All structures
950 -- displayed at the moment in layer will be displayed in default layer
951 -- ( the bottom-level z layer ). To unset layer ID from associated
952 -- structures use method UnsetZLayer (...).
953
954 UnsetZLayer( me : mutable;
955 theLayerId : Integer from Standard )
956 is deferred;
957 ---Purpose: Unset Z layer ID for all structures. The structure
958 -- indexes will be set to default layer ( the bottom-level z layer
959 -- with ID = 0 ).
960
961 ChangeZLayer( me : mutable;
962 theCStructure : CStructure from Graphic3d;
963 theLayerId : Integer from Standard )
964 is deferred;
965 ---Purpose: Change Z layer of a structure. The new z layer ID will
966 -- be used to define the associated layer for structure on display.
967
968 ChangeZLayer( me : mutable;
969 theCStructure : CStructure from Graphic3d;
970 theCView : CView from Graphic3d;
971 theNewLayerId : Integer from Standard )
972 is deferred;
973 ---Purpose: Change Z layer of a structure already presented in view.
974
975 GetZLayer( me;
976 theCStructure : CStructure from Graphic3d )
977 returns Integer from Standard is deferred;
978 ---Purpose: Get Z layer ID of structure. If the structure doesn't
979 -- exists in graphic driver, the method returns -1.
980
7fd59977 981 --------------------------
982 -- Category: Class methods
983 --------------------------
984
985 Light ( myclass;
986 ACLight : CLight from Graphic3d;
987 Update : Boolean from Standard )
988 returns Integer from Standard;
989 ---Purpose: call_togl_light
990
991 Plane ( myclass;
992 ACPlane : CPlane from Graphic3d;
993 Update : Boolean from Standard )
994 returns Integer from Standard;
995 ---Purpose: call_togl_plane
996
997 -----------------------------
998 -- Category: Internal methods
999 -----------------------------
1000
1001 PrintBoolean ( me;
1002 AComment : CString from Standard;
1003 AValue : Boolean from Standard );
1004
1005 PrintCGroup ( me;
1006 ACGroup : CGroup from Graphic3d;
1007 AField : Integer from Standard );
1008
1009 PrintCLight ( me;
1010 ACLight : CLight from Graphic3d;
1011 AField : Integer from Standard );
1012
1013 PrintCPick ( me;
1014 ACPick : CPick from Graphic3d;
1015 AField : Integer from Standard );
1016
1017 PrintCPlane ( me;
1018 ACPlane : CPlane from Graphic3d;
1019 AField : Integer from Standard );
1020
1021 PrintCStructure ( me;
1022 ACStructure : CStructure from Graphic3d;
1023 AField : Integer from Standard );
1024
1025 PrintCView ( me;
1026 ACView : CView from Graphic3d;
1027 AField : Integer from Standard );
1028
1029 PrintFunction ( me;
1030 AFunc : CString from Standard );
1031
1032 PrintInteger ( me;
1033 AComment : CString from Standard;
1034 AValue : Integer from Standard );
1035
1036 PrintIResult ( me;
1037 AFunc : CString from Standard;
1038 AResult : Integer from Standard );
1039
1040 PrintShortReal ( me;
1041 AComment : CString from Standard;
1042 AValue : ShortReal from Standard );
1043
1044 PrintMatrix ( me;
1045 AComment : CString from Standard;
1046 AMatrix : Array2OfReal from TColStd )
1047 raises TransformError from Graphic3d;
1048
1049 PrintString ( me;
1050 AComment : CString from Standard;
1051 AString : CString from Standard );
1052
1053 SetTrace ( me : mutable;
1054 ALevel : Integer from Standard )
1055 is static;
1056
1057 Trace ( me )
1058 returns Integer from Standard
1059 is static;
1060
1061 --ListOfAvalableFontNames( me;
1062 -- lst: out NListOfHAsciiString from Graphic3d )
1063 -- returns Boolean from Standard
1064 -- is deferred;
1065 -- Purpose: Initialize list of names of avalable system fonts
1066 -- returns Standard_False if fails
1067 -- ABD Integration support of system fonts (using FTGL and FreeType)
1068
dc3fe572 1069 GetDisplayConnection (me)
1070 returns DisplayConnection_Handle from Aspect;
1071 ---C++: return const &
1072
1073 ---Purpose: returns Handle to display connection
1074
7fd59977 1075fields
1076
dc3fe572 1077 MyTraceLevel : Integer from Standard is protected;
1078 MySharedLibrary : SharedLibrary from OSD is protected;
1079 myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
7fd59977 1080
1081end GraphicDriver from Graphic3d;