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