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