0024637: Visualization - clean up implementation of rendering in immediate mode
[occt.git] / src / Visual3d / Visual3d_View.cdl
CommitLineData
b311480e 1-- Created on: 1991-09-17
2-- Created by: NW,JPB,CAL
3-- Copyright (c) 1991-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
7fd59977 17-- 05-97: CAL; Ajout du Clear sur les TOS_COMPUTED.
18-- 10-97: CAL; Retrait des DataStructure.
19-- 11-97: CAL; Retrait de la dependance avec math.Calcul developpe.
20-- 11-97: CAL; Ajout de NumberOfDisplayedStructures
21-- 05-98: CAL; Perfs. Connection entre structures COMPUTED.
22-- 16-09-98: BGN; Points d'entree du Triedre (S3819, Phase 1)
23-- 22-09-98: BGN; S3989 (anciennement S3819)
24-- TypeOfTriedron* from Aspect(et pas Visual3d)
25-- 02-12-98: S4062. Ajout des layers.
26-- 13-09-99: GG; GER61454 Adds LightLimit() and PlaneLimit() methods
27-- 10-11-99: GG; Add PRO19603 Redraw( area ) method
28-- 14-01-00: GG; Add IMP140100 ViewManager() method
7fd59977 29-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
30-- -> Add Print methods (works only under Windows).-
31-- GG - RIC120302 Add NEW SetWindow method.
7fd59977 32-- 30-04-02: JMB; MyDisplayedStructure is now a Map instead
33-- of a Set. Improves performance of Selection
34-- mechanisms
7fd59977 35
36-- SAV - 22/10/01 -> Add EnableDepthTest() & IsDepthTestEnabled() methods.
37-- SAV - 25/10/01 -> Add EnableGLLight() & IsGLLightEnabled() methods.
38-- VSV - 28/05/02: ZBUFFER mode of Trihedron
39-- SAV - 23/12/02 Added methods too set background image
7fd59977 40
41class View from Visual3d inherits DataStructureManager from Graphic3d
42
43 ---Version:
44
45 ---Purpose: Creation and edition of a view in a 3D visualiser.
46 -- A 3D view is composed of an "orientation" part defined
47 -- by the position of the observer, the direction of view,
48 -- and a "mapping" part defined by the type of projection
49 -- (parallel or perspective) and by the window-viewport
50 -- couple which allows passage from the projected coordinate
51 -- space into the screen space.
52 -- Summary of 3D Viewing
53 -- To define a view, you must define:
54 -- - The view orientation transformation
55 -- - The view mapping transformation
56 -- - The view representation.
57 -- To activate a view, you must define:
58 -- - The associated window.
59
60
61uses
62
63 Array2OfReal from TColStd,
64
65 Background from Aspect,
66 GradientBackground from Aspect,
7fd59977 67 Window from Aspect,
68 TypeOfUpdate from Aspect,
69 TypeOfHighlightMethod from Aspect,
70 TypeOfTriedronEcho from Aspect,
71 TypeOfTriedronPosition from Aspect,
72 Handle from Aspect,
73 RenderingContext from Aspect,
74 GraphicCallbackProc from Aspect,
75 ColorScale from Aspect,
7edf74fd 76 PrintAlgo from Aspect,
7fd59977 77
692613e5 78 BufferType from Graphic3d,
7fd59977 79 CBitFields8 from Graphic3d,
80 CView from Graphic3d,
81 GraphicDriver from Graphic3d,
82 PtrFrameBuffer from Graphic3d,
83 Plotter from Graphic3d,
84 Structure from Graphic3d,
85 SequenceOfStructure from Graphic3d,
86 MapOfStructure from Graphic3d,
b5ac8292 87 Camera_Handle from Graphic3d,
7fd59977 88
89 ContextView from Visual3d,
7fd59977 90 Layer from Visual3d,
91 Light from Visual3d,
7fd59977 92 SetOfLight from Visual3d,
93 TypeOfAnswer from Visual3d,
7fd59977 94 ViewManager from Visual3d,
95 ViewManagerPtr from Visual3d,
96
97 TypeOfBackfacingModel from Visual3d,
98
99 NameOfColor from Quantity,
100 FillMethod from Aspect,
101 GradientFillMethod from Aspect,
102 ExportFormat from Graphic3d,
103 SortType from Graphic3d,
104 Color from Quantity,
eeaaaefb 105 FontAspect from Font,
13a22457
S
106 AsciiString from TCollection,
107 ExtendedString from TCollection,
692613e5 108 CGraduatedTrihedron from Graphic3d,
109
110 PixMap from Image
7fd59977 111
112raises
113 TransformError from Visual3d,
114 ViewDefinitionError from Visual3d
115
116is
117
118 ----------------------------------------------
119 -- Summary of 3D Viewing --
120 -- --
121 -- To define a view, you must define --
122 -- --
123 -- The view orientation transformation --
124 -- The view mapping transformation --
125 -- The view representation. --
126 -- --
127 -- To activate a view, you must define --
128 -- --
129 -- The associated window. --
130 ----------------------------------------------
131
132 Create ( AManager : mutable ViewManager from Visual3d )
133 returns mutable View from Visual3d;
134 ---Level: Public
135 ---Purpose: Creates a view in the viewer <AManager> with a default
136 -- orientation and a default mapping.
137
7fd59977 138 ---------------------------------------------------
139 -- Category: Methods to modify the class definition
140 ---------------------------------------------------
141
142 Activate ( me : mutable )
143 ---Level: Public
144 ---Purpose: Activates the view <me>.
145 -- Map the associated window on the screen and
146 -- post the view in this window.
147 -- Category: Methods to modify the class definition
148 -- Warning: Raises ViewDefinitionError if the associated
149 -- window isn't defined.
150 raises ViewDefinitionError from Visual3d is static;
151
152 Deactivate ( me : mutable )
153 ---Level: Public
154 ---Purpose: Deactivates the view <me>.
155 -- Unmap the associated window on the screen and
156 -- unpost the view in this window.
157 -- Category: Methods to modify the class definition
158 -- Warning: Raises ViewDefinitionError if the associated
159 -- window isn't defined.
160 raises ViewDefinitionError from Visual3d is static;
161
162 Destroy ( me : mutable )
163 is redefined;
164 ---Level: Public
165 ---Purpose: Deletes and erases the view <me>.
166 ---Category: Methods to modify the class definition
167 ---C++: alias ~
168
169 Redraw ( me : mutable )
170 is static;
171 ---Level: Public
172 ---Purpose: Updates screen in all cases.
173 ---Category: Methods to modify the class definition
174
679ecdee 175 RedrawImmediate ( me : mutable )
176 is static;
177 ---Level: Public
178 ---Purpose: Updates layer of immediate presentations.
179
7fd59977 180 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
181 is static;
182 ---Level: Public
183 ---Purpose: Updates screen area in all cases.
184 -- area is given by his xy min corner and size in pixel coordinates
185 ---Category: Methods to modify the class definition
186
187 Redraw ( me : mutable;
188 AnUnderLayer : Layer from Visual3d;
189 AnOverLayer : Layer from Visual3d )
190 is static;
191 ---Level: Internal
192 ---Purpose: Updates screen in all cases.
193 ---Category: Methods to modify the class definition
194
679ecdee 195 RedrawImmediate ( me : mutable;
196 theUnderLayer : Layer from Visual3d;
197 theOverLayer : Layer from Visual3d )
198 is static;
199 ---Level: Public
200 ---Purpose: Updates layer of immediate presentations.
201
202 Invalidate ( me : mutable )
203 is static;
204 ---Level: Public
205 ---Purpose: Invalidates view content but does not redraw it.
206
7fd59977 207 Redraw ( me : mutable;
208 AnUnderLayer : Layer from Visual3d;
209 AnOverLayer : Layer from Visual3d;
210 x,y,width,height: Integer from Standard )
211 is static;
212 ---Level: Internal
213 ---Purpose: Updates screen area in all cases.
214 -- area is given by his xy min corner and size in pixel coordinates
215 ---Category: Methods to modify the class definition
216
217 Remove ( me : mutable )
218 is static;
219 ---Level: Public
220 ---Purpose: Deletes and erases the view <me>.
221 -- Warning: No more graphic operations in <me> after this call.
222 ---Category: Methods to modify the class definition
223
224 Resized ( me : mutable )
225 ---Level: Public
226 ---Purpose: Updates the view <me> after the modification
227 -- of the associated window.
228 -- Category: Methods to modify the class definition
229 -- Warning: Raises ViewDefinitionError if the associated
230 -- window isn't defined.
231 raises ViewDefinitionError from Visual3d is static;
232
233 SetBackground ( me : mutable;
234 ABack : Background from Aspect )
235 ---Level: Internal
236 ---Purpose: Modifies the default window background.
237 -- Category: Methods to modify the class definition
238 -- Warning: Raises ViewDefinitionError if the associated
239 -- window isn't defined.
240 raises ViewDefinitionError from Visual3d is static;
241
242 SetBackgroundImage( me : mutable; FileName : CString from Standard;
243 FillStyle : FillMethod from Aspect;
244 update : Boolean from Standard )
245 ---Level: Internal
246 ---Purpose:
247 -- Category: Methods to modify the class definition
248 -- Warning: Raises ViewDefinitionError if the associated
249 -- window isn't defined.
250 raises ViewDefinitionError from Visual3d is static;
251
252 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
253 update : Boolean from Standard )
254 ---Level: Internal
255 ---Purpose:
256 -- Category: Methods to modify the class definition
257 -- Warning: Raises ViewDefinitionError if the associated
258 -- window isn't defined.
259 raises ViewDefinitionError from Visual3d is static;
260
261 SetGradientBackground ( me : mutable;
262 ABack : GradientBackground from Aspect;
263 update : Boolean from Standard )
264 ---Level: Internal
265 ---Purpose: Modifies the gradient window background.
266 -- Category: Methods to modify the class definition
267 -- Warning: Raises ViewDefinitionError if the associated
268 -- window isn't defined.
269 raises ViewDefinitionError from Visual3d is static;
270
271 SetBgGradientStyle( me : mutable;
272 FillStyle : GradientFillMethod from Aspect;
273 update : Boolean from Standard )
274 ---Level: Internal
275 ---Purpose:
276 -- Category: Methods to modify the class definition
277 -- Warning: Raises ViewDefinitionError if the associated
278 -- window isn't defined.
279 raises ViewDefinitionError from Visual3d is static;
280
281 SetBackFacingModel ( me : mutable;
282 aModel : TypeOfBackfacingModel from Visual3d
283 ) is static;
284 ---Level : Public
285 ---Purpose : Manages display of the back faces
286
287 BackFacingModel ( me )
288 returns TypeOfBackfacingModel from Visual3d is static;
289 ---Level : Public
290 ---Purpose : Returns current state of the back faces display
291
292 SetContext ( me : mutable;
293 CTX : ContextView from Visual3d )
294 is static;
295 ---Level: Public
296 ---Purpose: Sets the context <CTX> in the view <me>.
297 ---Category: Methods to modify the class definition
298
299 SetTransform ( me : mutable;
300 AMatrix : Array2OfReal from TColStd )
301 ---Level: Internal
302 ---Purpose: Sets the transformation matrix that is applied
303 -- to <MyViewOrientation> field of the view <me>.
304 --
305 -- <AMatrix> is defined as a 4*4 real matrix.
306 --
307 -- -------------------
308 -- | a11 a12 a13 t1 |
309 -- | a21 a22 a23 t2 |
310 -- | a31 a32 a33 t3 |
311 -- | 0 0 0 1 |
312 -- -------------------
313 --
314 -- Category: Methods to modify the class definition
315 -- Warning: Raises TransformError if the matrix isn't a 4x4 matrix.
316 raises TransformError from Visual3d is static;
317
7fd59977 318 SetViewMappingDefault ( me : mutable )
319 is static;
320 ---Level: Public
321 ---Purpose: Saves the current mapping which will be the
322 -- reference value for the reset of the mapping
323 -- done by the ViewmappingReset method.
324 ---Category: Methods to modify the class definition
325
7fd59977 326 SetViewOrientationDefault ( me : mutable )
327 is static;
328 ---Level: Public
329 ---Purpose: Saves the current orientation which will be the
330 -- reference value for the reset of the orientation
331 -- done by the ViewOrientationReset method.
332 ---Category: Methods to modify the class definition
333
334 SetWindow ( me : mutable;
335 AWindow : Window from Aspect )
336 ---Level: Public
337 ---Purpose: Associates the window <AWindow> to the view <me>.
338 -- No new association if the window is already defined.
339 -- Category: Methods to modify the class definition
340 -- Warning: Raises ViewDefinitionError if it is impossible
341 -- to associate a view and a window.
342 -- (association already done or another problem)
343 -- Modifies the viewmapping of the associated view
344 -- when it calls the SetRatio method.
345 raises ViewDefinitionError from Visual3d is static;
346 ---Purpose:
347 -- After this call, each view is mapped in an unique window.
348 --
349 -- Programming example :
350 --
351 -- An example when we have 1 view and 1 window
352 -- -------------------------------------------
353 --
dc3fe572 354 -- Handle(Aspect_DisplayConnection) aDisplayConnection;
355 --
356 -- // Display connection initialization only needed on Linux platform
357 -- // and on Mac OS X, in cases when you use Xlib for windows drawing.
358 -- aDisplayConnection = new Aspect_DisplayConnection();
359 --
360 -- // Graphic driver initialization
361 -- Handle(Graphic3d_GraphicDriver) aGraphicDriver =
362 -- Graphic3d::InitGraphicDriver (aDisplayConnection);
7fd59977 363 --
364 -- // Define a view manager
dc3fe572 365 -- Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
7fd59977 366 --
367 -- // Define a view
dc3fe572 368 -- Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
7fd59977 369 --
370 -- // Define a window
dc3fe572 371 -- Handle(Xw_Window) aWindow = new Xw_Window
372 -- (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
7fd59977 373 --
374 -- // Associate the view and the window
dc3fe572 375 -- aView->SetWindow (aWindow);
7fd59977 376 --
377 -- // Map the window
dc3fe572 378 -- aWindow->Map ();
7fd59977 379 --
380 -- // Activate the view
dc3fe572 381 -- aView->Activate ();
7fd59977 382 --
383
384 SetWindow ( me : mutable;
385 AWindow : Window from Aspect;
386 AContext: RenderingContext from Aspect;
387 ADisplayCB: GraphicCallbackProc from Aspect;
388 AClientData: Address from Standard
389 )
390 ---Level: Public
391 ---Purpose: Associates the window <AWindow> and context <AContext>
392 -- to the view <me>.
393 -- If <AContext> is not NULL the graphic context is used
394 -- directly to draw something in this view.
395 -- Otherwise an internal context is created.
396 -- If <ADisplayCB> is not NULL then a user display CB is
397 -- call at the end of the OCC graphic traversal and just
398 -- before the swap of buffers. The <aClientData> is pass
399 -- to this call back.
400 -- No new association if the window is already defined.
401 -- Category: Methods to modify the class definition
402 -- Warning: Raises ViewDefinitionError if it is impossible
403 -- to associate a view and a window.
404 -- (association already done or another problem)
405 -- Modifies the viewmapping of the associated view
406 -- when it calls the SetRatio method.
407 raises ViewDefinitionError from Visual3d is static;
408 ---Purpose:
409 -- After this call, each view is mapped in an unique window.
7fd59977 410
411 Update ( me : mutable )
412 is static;
413 ---Level: Public
414 ---Purpose: Updates screen in function of modifications of
415 -- the structures.
416 ---Category: Methods to modify the class definition
417
418 Update ( me : mutable;
419 AnUnderLayer : Layer from Visual3d;
420 AnOverLayer : Layer from Visual3d )
421 is static;
422 ---Level: Internal
423 ---Purpose: Updates screen in function of modifications of
424 -- the structures.
425 ---Category: Methods to modify the class definition
426
427 ViewMappingReset ( me : mutable )
428 is static;
429 ---Level: Public
430 ---Purpose: Sets the value of the mapping to be the same as
431 -- the mapping saved by the SetViewMappingDefaut method.
432 ---Category: Methods to modify the class definition
433
434 ViewOrientationReset ( me : mutable )
435 is static;
436 ---Level: Public
437 ---Purpose: Sets the value of the orientation to be the same as the
438 -- orientation saved by the SetViewOrientationDefaut method.
439 ---Category: Methods to modify the class definition
440
7fd59977 441 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
442 ---Level: Advanced
443 ---Purpose: Switches computed HLR mode in the view
444 ---Category: Methods to modify the class definition
445
446 ComputedMode ( me ) returns Boolean from Standard is static;
447 ---Level: Advanced
448 ---Purpose: Returns the computed HLR mode state
449 ---Category: Inquire methods
450
451 ---------------------------------------------------
452 -- Category: Methods to modify the class definition
453 -- Triedron methods
454 ---------------------------------------------------
455
456 ZBufferTriedronSetup ( me : mutable;
457 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
458 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
459 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
460 SizeRatio : Real from Standard = 0.8;
461 AxisDiametr : Real from Standard = 0.05;
462 NbFacettes : Integer from Standard = 12)
463 is static;
464 ---Level: Advanced
465 ---Purpose: Customization of the ZBUFFER Triedron.
466 --- Initializes Colors of X Y and axis
467 --- Scale ratio defines decreasing of trihedron size when
468 --- its position is out of a View
469
470 TriedronDisplay ( me : mutable;
471 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
472 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
473 AScale : Real from Standard = 0.02;
474 AsWireframe : Boolean from Standard = Standard_True )
475 is static;
476 ---Level: Public
477 ---Purpose: Display of the Triedron.
478 --- Initialize position, color and length of Triedron axes.
479 --- The scale is a percent of the window width.
480 --- If AsWireframe is FALSE triedron is shown in shaded mode
481 --- AColor is not considered for ZBUFFER mode
482 ---Category:
483
484 TriedronErase ( me : mutable )
485 is static;
486 ---Level: Public
487 ---Purpose: Erases the Triedron.
488 ---Category:
489
490 TriedronEcho ( me : mutable;
491 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
492 is static;
493 ---Level: Public
494 ---Purpose: Highlights the echo zone of the Triedron.
495 ---Category:
496
497 ------------------------------------------
498 ---Category: Graduated trihedron
499 ------------------------------------------
500
501 GetGraduatedTrihedron(me;
502 -- Names of axes --
13a22457 503 xname, yname, zname : out ExtendedString from TCollection;
7fd59977 504 -- Draw names --
13a22457 505 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
7fd59977 506 -- Draw values --
13a22457 507 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
7fd59977 508 -- Draw grid --
509 drawgrid : out Boolean from Standard;
510 -- Draw axes --
511 drawaxes : out Boolean from Standard;
512 -- Number of splits along axes --
13a22457 513 nbx, nby, nbz : out Integer from Standard;
7fd59977 514 -- Offset for drawing values --
13a22457 515 xoffset, yoffset, zoffset : out Integer from Standard;
7fd59977 516 -- Offset for drawing names of axes --
13a22457 517 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
7fd59977 518 -- Draw tickmarks --
13a22457 519 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
7fd59977 520 -- Length of tickmarks --
13a22457 521 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
7fd59977 522 -- Grid color --
523 gridcolor : out Color from Quantity;
13a22457
S
524 -- Colors of axis names --
525 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
526 -- Colors of axis and values --
527 xcolor, ycolor, zcolor : out Color from Quantity;
7fd59977 528 -- Name of font for names of axes --
13a22457 529 fontOfNames : out AsciiString from TCollection;
7fd59977 530 -- Style of names of axes --
eeaaaefb 531 styleOfNames : out FontAspect from Font;
7fd59977 532 -- Size of names of axes --
533 sizeOfNames : out Integer from Standard;
534 -- Name of font for values --
13a22457 535 fontOfValues : out AsciiString from TCollection;
7fd59977 536 -- Style of values --
eeaaaefb 537 styleOfValues : out FontAspect from Font;
7fd59977 538 -- Size of values --
539 sizeOfValues : out Integer from Standard)
13a22457 540 returns Boolean from Standard
7fd59977 541 is static;
13a22457 542 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
7fd59977 543
544 GraduatedTrihedronDisplay(me : mutable;
545 -- Names of axes --
13a22457 546 xname, yname, zname : ExtendedString from TCollection;
7fd59977 547 -- Draw names --
13a22457 548 xdrawname, ydrawname, zdrawname : Boolean from Standard;
7fd59977 549 -- Draw values --
13a22457 550 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
7fd59977 551 -- Draw grid --
552 drawgrid : Boolean from Standard;
553 -- Draw axes --
554 drawaxes : Boolean from Standard;
555 -- Number of splits along axes --
13a22457 556 nbx, nby, nbz : Integer from Standard;
7fd59977 557 -- Offset for drawing values --
13a22457 558 xoffset, yoffset, zoffset : Integer from Standard;
7fd59977 559 -- Offset for drawing names of axes --
13a22457 560 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
7fd59977 561 -- Draw tickmarks --
13a22457 562 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
7fd59977 563 -- Length of tickmarks --
13a22457 564 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
7fd59977 565 -- Grid color --
566 gridcolor : Color from Quantity;
13a22457
S
567 -- Colors of axis names --
568 xnamecolor, ynamecolor, znamecolor : Color from Quantity;
569 -- Colors of axis and values --
570 xcolor, ycolor, zcolor : Color from Quantity;
7fd59977 571 -- Name of font for names of axes --
13a22457 572 fontOfNames : AsciiString from TCollection;
7fd59977 573 -- Style of names of axes --
eeaaaefb 574 styleOfNames : FontAspect from Font;
7fd59977 575 -- Size of names of axes --
576 sizeOfNames : Integer from Standard;
577 -- Name of font for values --
13a22457 578 fontOfValues : AsciiString from TCollection;
7fd59977 579 -- Style of values --
eeaaaefb 580 styleOfValues : FontAspect from Font;
7fd59977 581 -- Size of values --
582 sizeOfValues : Integer from Standard)
583 ---Purpose: Displays a graduated trihedron.
584 is static;
585
586 GraduatedTrihedronErase(me : mutable)
587 ---Purpose: Erases a graduated trihedron from the view.
588 is static;
589
590 ----------------------------
591 ---Category: Inquire methods
592 ----------------------------
593
594 Background ( me )
595 returns Background from Aspect
596 is static;
597 ---Level: Internal
598 ---Purpose: Returns the value of the default window background.
599
600 GradientBackground ( me )
601 returns GradientBackground from Aspect
602 is static;
603 ---Level: Internal
604 ---Purpose: Returns the value of the window background.
605
606 ContainsFacet ( me )
607 returns Boolean from Standard
608 is static;
609 ---Level: Public
610 ---Purpose: Returns Standard_True if one of the structures
611 -- displayed in the view <me> contains Polygons,
612 -- Triangles or Quadrangles.
613
614 ContainsFacet ( me;
615 ASet : MapOfStructure from Graphic3d )
616 returns Boolean from Standard
617 is static;
618 ---Level: Public
619 ---Purpose: Returns Standard_True if one of the structures
620 -- in the set <ASet> contains Polygons, Triangles
621 -- or Quadrangles.
622
623 Context ( me )
624 returns ContextView from Visual3d
625 is static;
626 ---Level: Public
627 ---Purpose: Returns the current context of the view <me>.
628 ---C++: return const &
629
630 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
631 is static;
632 ---Level: Internal
633 ---Purpose: Returns the set of structures displayed in
634 -- the view <me>.
635
636 IsActive ( me )
637 returns Boolean from Standard
638 is static;
639 ---Level: Public
640 ---Purpose: Returns the activity flag of the view <me>.
641
642 IsDefined ( me )
643 returns Boolean from Standard
644 is static;
645 ---Level: Public
646 ---Purpose: Returns True if the window associated to the view
647 -- <me> is defined.
648
649 IsDeleted ( me )
650 returns Boolean from Standard
651 is static;
652 ---Level: Public
653 ---Purpose: Returns Standard_True is the view <me> is deleted.
654 -- <me> is deleted after the call Remove (me).
655 ---Category: Inquire methods
656
197ac94e 657 MinMaxValues (me;
658 theXMin, theYMin, theZMin : out Real from Standard;
659 theXMax, theYMax, theZMax : out Real from Standard;
660 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
661 is static;
662 ---Level: Public
663 ---Purpose: Returns the coordinates of the boundary box of all
664 -- structures displayed in the view <me>.
665 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
666 -- also includes minimum and maximum limits of graphical elements
667 -- forming parts of infinite structures.
668
669 MinMaxValues (me;
670 theSet : MapOfStructure from Graphic3d;
671 theXMin, theYMin, theZMin : out Real from Standard;
672 theXMax, theYMax, theZMax : out Real from Standard;
673 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
674 is static;
675 ---Level: Public
676 ---Purpose: Returns the coordinates of the boundary box of all
677 -- structures in the set <theSet>.
678 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
679 -- also includes minimum and maximum limits of graphical elements
680 -- forming parts of infinite structures.
681
682 MinMaxValues (me;
683 theXMin, theYMin : out Real from Standard;
684 theXMax, theYMax : out Real from Standard;
685 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
686 is static;
687 ---Level: Public
688 ---Purpose: Returns the coordinates of the projection of the
689 -- boundary box of all structures displayed in the view <me>.
690 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
691 -- also includes minimum and maximum limits of graphical elements
692 -- forming parts of infinite structures.
693
694 MinMaxValues (me;
695 theSet : MapOfStructure from Graphic3d;
696 theXMin, theYMin : out Real from Standard;
697 theXMax, theYMax : out Real from Standard;
698 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
699 is static;
700 ---Level: Public
701 ---Purpose: Returns the coordinates of the projection of the
702 -- boundary box of all structures in the set <ASet>.
703 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
704 -- also includes minimum and maximum limits of graphical elements
705 -- forming parts of infinite structures.
7fd59977 706
707 NumberOfDisplayedStructures ( me )
708 returns Integer from Standard
709 is static;
710 ---Level: Internal
711 ---Purpose: Returns number of displayed structures in
712 -- the view <me>.
713
197ac94e 714 Projects (me;
7fd59977 715 AX, AY, AZ : Real from Standard;
716 APX, APY, APZ : out Real from Standard )
717 is static;
718 ---Level: Public
719 ---Purpose: Returns the coordinates of the projection of the
720 -- 3d coordinates <AX>, <AY>, <AZ>.
721
b5ac8292 722 DefaultCamera (me)
723 returns Camera_Handle from Graphic3d
724 is static;
725 ---Level: Public
726 ---Purpose: @return the default camera of <me>.
727 ---C++: return const &
7fd59977 728
b5ac8292 729 Camera (me)
730 returns Camera_Handle from Graphic3d
731 is static;
732 ---Level: Public
733 ---Purpose: @return the camera of <me>.
734 ---C++: return const &
7fd59977 735
b5ac8292 736 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
737 ---Level: Public
738 ---Purpose: Set camera object to provide orientation and projection matrices
739 -- for graphic driver.
7fd59977 740
741 Window ( me )
742 returns Window from Aspect
743 ---Level: Public
744 ---Purpose: Returns the window associated to the view <me>.
745 -- Warning: Raises ViewDefinitionError if the associated
746 -- window isn't defined.
747 raises ViewDefinitionError from Visual3d is static;
748
749 LightLimit ( me ) returns Integer is static;
750 ---Level: Public
751 ---Purpose: Returns the MAX number of light associated to the view <me>.
752
753 PlaneLimit ( me ) returns Integer is static;
754 ---Level: Public
755 ---Purpose: Returns the MAX number of clipping planes
756 -- associated to the view <me>.
757
758 ViewManager ( me ) returns ViewManager from Visual3d is static;
759 ---Level: Advanced
760 ---Purpose: Returns the view manager handle which manage this view
761
762 ----------------------------
763 -- Category: Private methods
764 ----------------------------
765
766 AcceptDisplay ( me;
767 AStructure : Structure from Graphic3d )
768 returns TypeOfAnswer from Visual3d
769 is static private;
770 ---Level: Internal
771 ---Purpose: Is it possible to display the structure
772 -- <AStructure> in the view <me> ?
773 ---Category: Private methods
774
775 ReCompute ( me : mutable;
776 AStructure : Structure from Graphic3d );
777 ---Level: Advanced
778 ---Purpose: Computes the new presentation of the
779 -- structure <AStructure> displayed in <me>
780 -- with the type Graphic3d_TOS_COMPUTED.
781 ---Category: Private methods
782
783 Compute ( me : mutable ) is static private;
784 ---Level: Internal
785 ---Purpose: Computes the new presentation of the
786 -- Structures displayed in <me> with the type
787 -- Graphic3d_TOS_COMPUTED.
788 ---Category: Private methods
789
790 ChangeDisplayPriority ( me : mutable;
791 AStructure : Structure from Graphic3d;
792 OldPriority : Integer from Standard;
793 NewPriority : Integer from Standard )
794 is static private;
795 ---Level: Internal
796 ---Purpose: Changes the display priority of the structure <AStructure>.
797 ---Category: Private methods
798
59f45b7c 799 AddZLayer ( me : mutable;
800 theLayerId : Integer from Standard )
801 is static private;
802 ---Purpose: Add a new top-level Z layer to the view with ID
803 -- <theLayerId>. The z layer mechanism allows to display
804 -- structures in higher layers in overlay of structures in lower layers.
805 -- The layers in a particular view should be managed centrally
806 -- by its view manager so to avoid IDs mismatching and provide correct
807 -- display of graphics in all views.
808
809 RemoveZLayer ( me : mutable;
810 theLayerId : Integer from Standard )
811 is static private;
812 ---Purpose: Remove z layer from the view by its ID.
813
814 ChangeZLayer ( me : mutable;
815 theStructure : Structure from Graphic3d;
816 theLayerId : Integer from Standard )
817 is static private;
818 ---Purpose: Change Z layer of already displayed structure in the view.
819
7fd59977 820 Clear ( me : mutable;
821 AStructure : Structure from Graphic3d;
822 WithDestruction : Boolean from Standard )
823 is static private;
824 ---Level: Internal
825 ---Purpose: Clears the structure <AStructure> to the view <me>.
826 ---Category: Private methods
827
828 Connect ( me : mutable;
829 AMother : Structure from Graphic3d;
830 ADaughter : Structure from Graphic3d )
831 is static private;
832 ---Level: Internal
833 ---Purpose: Connects the structures <AMother> and <ADaughter>.
834 ---Category: Private methods
835
836 Disconnect ( me : mutable;
837 AMother : Structure from Graphic3d;
838 ADaughter : Structure from Graphic3d )
839 is static private;
840 ---Level: Internal
841 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
842 ---Category: Private methods
843
844 Display ( me : mutable;
845 AStructure : Structure from Graphic3d )
846 is static private;
847 ---Level: Internal
848 ---Purpose: Display the structure <AStructure> to the view <me>.
849 ---Category: Private methods
850
851 Display ( me : mutable;
852 AStructure : Structure from Graphic3d;
853 AnUpdateMode : TypeOfUpdate from Aspect )
854 is static private;
855 ---Level: Internal
856 ---Purpose: Display the structure <AStructure> to the view <me>.
857 ---Category: Private methods
858
679ecdee 859 DisplayImmediate ( me : mutable;
860 theStructure : Structure from Graphic3d;
861 theIsSingleView : Boolean from Standard = Standard_True)
862 returns Boolean from Standard
863 is static;
864 ---Level: Internal
865 ---Purpose: Add structure to the list of immediate presentations.
866 -- @return true if structure has not been registered in this view
867
868 EraseImmediate ( me : mutable;
869 theStructure : Structure from Graphic3d )
870 returns Boolean from Standard
871 is static;
872 ---Level: Internal
873 ---Purpose: Removes the structure from the list of immediate presentations.
874 -- @return true if structure has been registered in view
875
876 ClearImmediate ( me : mutable )
877 returns Boolean from Standard
878 is static;
879 ---Level: Internal
880 ---Purpose: Clears list of immediate presentations.
881 -- @return true if list was not empty
882
7fd59977 883 Erase ( me : mutable;
884 AStructure : Structure from Graphic3d )
885 is static private;
886 ---Level: Internal
887 ---Purpose: Erases the structure <AStructure> from the view <me>.
888 ---Category: Private methods
889
890 Erase ( me : mutable;
891 AStructure : Structure from Graphic3d;
892 AnUpdateMode : TypeOfUpdate from Aspect )
893 is static private;
894 ---Level: Internal
895 ---Purpose: Erases the structure <AStructure> from the view <me>.
896 ---Category: Private methods
897
7fd59977 898 Highlight ( me : mutable;
899 AStructure : Structure from Graphic3d;
900 AMethod : TypeOfHighlightMethod from Aspect )
901 is static private;
902 ---Level: Internal
903 ---Purpose: Highlights the structure <AStructure> in the view <me>.
904 ---Category: Private methods
905
906 SetTransform ( me : mutable;
907 AStructure : Structure from Graphic3d;
908 ATrsf : Array2OfReal from TColStd )
909 is static private;
910 ---Level: Internal
911 ---Purpose: Transforms the structure <AStructure> in the view <me>.
912 ---Category: Private methods
913
914 UnHighlight ( me : mutable;
915 AStructure : Structure from Graphic3d )
916 is static private;
917 ---Level: Internal
918 ---Purpose: Suppress the highlighting on the structure <AStructure>
919 -- in the view <me>.
920 ---Category: Private methods
921
922 IsComputed ( me;
923 AStructure : Structure from Graphic3d )
924 returns Integer from Standard
925 is static private;
926 ---Level: Internal
927 ---Purpose: Returns an index != 0 if the structure <AStructure>
928 -- have another structure computed for the view <me>.
929 ---Category: Private methods
930
931 Identification ( me )
932 returns Integer from Standard
933 is static;
934 ---Level: Internal
935 ---Purpose: Returns the identification number of the view <me>.
936 ---Category: Private methods
937
938 IsDisplayed ( me;
939 AStructure : Structure from Graphic3d )
940 returns Boolean from Standard
941 is static private;
942 ---Level: Internal
943 ---Purpose: Returns true if the structure <AStructure> is
944 -- displayed in the view <me>.
945 ---Category: Private methods
946
7fd59977 947 SetRatio ( me : mutable )
948 is static private;
949 ---Level: Internal
950 ---Purpose: Modifies the aspect ratio of the view <me> when the
951 -- associated window is defined or resized.
952 ---Category: Private methods
953
954 UpdateLights ( me : mutable )
955 is static private;
956 ---Level: Internal
957 ---Purpose: Updates the lights when the associated window is defined
958 -- and when the view is activated.
959 ---Category: Private methods
960
961 UpdatePlanes ( me : mutable )
962 is static private;
963 ---Level: Internal
964 ---Purpose: Updates the planes when the associated window is defined
965 -- and when the view is activated.
966 ---Category: Private methods
967
968 UpdateView ( me : mutable )
969 is static private;
970 ---Level: Internal
971 ---Purpose: Updates the associated c structure before a call to the
972 -- graphic library.
973 ---Category: Private methods
974
975 -----------------------------
976 -- Category: Internal methods
977 -----------------------------
978
979 CView ( me )
980 returns Address from Standard
981 is static;
982 ---Level: Internal
983 ---Purpose: Returns the c structure associated to <me>.
984 ---Category: Private methods
985
986 GraphicDriver ( me )
6942f04a 987 returns GraphicDriver from Graphic3d
7fd59977 988 is static;
989 ---Level: Internal
990 ---Purpose: Returns the associated GraphicDriver.
991 ---Category: Internal methods
dc3fe572 992 ---C++: return const &
7fd59977 993
994 HaveTheSameOwner ( me;
995 AStructure : Structure from Graphic3d )
996 returns Integer from Standard
997 is static private;
998 ---Level: Internal
999 ---Purpose: Returns an index != 0 if the structure <AStructure>
1000 -- have the same owner than another structure in the
1001 -- sequence of the computed structures.
1002 ---Category: Private methods
1003
1004 Plot ( me;
1005 APlotter : Plotter from Graphic3d )
1006 is static;
1007 ---Level: Internal
1008 ---Purpose: Calls the method Plot for each Structure
1009 -- displayed in <me>.
1010 ---Category: Private methods
1011
7edf74fd
A
1012 Print (me; AnUnderLayer : Layer from Visual3d;
1013 AnOverLayer : Layer from Visual3d;
1014 hPrnDC : Handle from Aspect;
1015 showBackground : Boolean;
1016 filename : CString;
1017 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1018 theScaleFactor : Real from Standard = 1.0)
1019 returns Boolean from Standard is static;
7fd59977 1020
1021 ---Level: Internal
1022 ---Purpose: print the contents of all layers of the view to the printer.
1023 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1024 -- <showBackground> : When set to FALSE then print the view without background color
1025 -- (background is white)
1026 -- else set to TRUE for printing with current background color.
1027 -- <filename>: If != NULL, then the view will be printed to a file.
7edf74fd
A
1028 -- <printAlgo>: Select print algorithm: stretch, tile.
1029 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1030 -- printings accordingly to the scale factor selected in the printer
1031 -- properties dialog.
1032 -- Returns Standard_True if the data is passed to the printer, otherwise
1033 -- Standard_False if the print operation failed due to printer error
1034 -- or insufficient memory.
7fd59977 1035 -- Warning: Works only under Windows.
1036
7edf74fd
A
1037 Print (me; hPrnDC : Handle from Aspect;
1038 showBackground : Boolean;
1039 filename : CString;
1040 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1041 theScaleFactor : Real from Standard = 1.0 )
1042 returns Boolean from Standard is static;
7fd59977 1043
1044 ---Level: Internal
1045 ---Purpose: print the contents of the view to printer.
1046 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1047 -- <showBackground> : When set to FALSE then print the view without background color
1048 -- (background is white)
1049 -- else set to TRUE for printing with current background color.
1050 -- <filename>: If != NULL, then the view will be printed to a file.
7edf74fd
A
1051 -- <printAlgo>: Select print algorithm: stretch, tile.
1052 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1053 -- printings accordingly to the scale factor selected in the printer
1054 -- properties dialog.
1055 -- Returns Standard_True if the data is passed to the printer, otherwise
1056 -- Standard_False if the print operation failed due to printer error
1057 -- or insufficient memory.
7fd59977 1058 -- Warning: Works only under Windows.
1059
1060 SetTransparency ( me : mutable;
1061 AFlag : Boolean from Standard )
1062 is static;
1063 ---Level: Advanced
1064 ---Purpose: if <AFlag> is Standard_True then the transparency
1065 -- is managed in the view <me>.
1066 -- Default Standard_False
1067 ---Category: Internal methods
1068
1069 ZBufferIsActivated ( me )
1070 returns Boolean from Standard
1071 is static;
1072 ---Level: Advanced
1073 ---Purpose: Returns Standard_True if the ZBuffer is activated
1074 -- in the view <me> and Standard_False if not.
1075 ---Category: Internal methods
1076
1077 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1078 is static;
1079 ---Level: Advanced
1080 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1081 -- is equal to 1.
1082 -- Deactivates the ZBuffer if the integer <AnActivity>
1083 -- is equal to 0.
1084 -- If the integer <AnActivity> is equal to -1 then
1085 -- - the ZBuffer is activated if
1086 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1087 -- - the ZBuffer is deactivated if
1088 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1089 ---Category: Internal methods
1090
1091 UnderLayer ( me )
1092 returns Layer from Visual3d;
1093 ---Level: Internal
1094 ---Purpose: Returns the underlay of the view <me>.
1095 ---Category: Private methods
1096 ---C++: return const &
1097
1098 OverLayer ( me )
1099 returns Layer from Visual3d;
1100 ---Level: Internal
1101 ---Purpose: Returns the underlay of the view <me>.
1102 ---Category: Private methods
1103 ---C++: return const &
1104
1105 EnableDepthTest( me; enable : Boolean from Standard )
1106 is static;
1107 ---Level: Public
1108 ---Purpose: turns on/off opengl depth
1109
1110 IsDepthTestEnabled( me ) returns Boolean from Standard
1111 is static;
1112 ---Level: Public
1113 ---Purpose: returns current state of the opengl depth testing
1114
1115 ReadDepths( me; x,y,width,height: Integer from Standard;
1116 buffer : Address )
1117 is static;
1118 ---Purpose: Reads depths of shown pixels of the given rectangle
1119
1120 FBOCreate( me : mutable; width,height: Integer from Standard )
1121 returns PtrFrameBuffer from Graphic3d
1122 is static;
1123 ---Level: Public
1124 ---Purpose: Generate offscreen FBO in the graphic library
1125
1126 FBORelease( me : mutable;
1127 fboPtr : in out PtrFrameBuffer from Graphic3d )
1128 is static;
1129 ---Level: Public
1130 ---Purpose: Remove offscreen FBO from the graphic library
1131
1132 FBOGetDimensions( me : mutable;
1133 fboPtr : PtrFrameBuffer from Graphic3d;
1134 width, height : out Integer from Standard;
1135 widthMax, heightMax : out Integer from Standard )
1136 is static;
1137 ---Level: Public
1138 ---Purpose: Read offscreen FBO configuration.
1139
1140 FBOChangeViewport( me : mutable;
1141 fboPtr : in out PtrFrameBuffer from Graphic3d;
1142 width, height : Integer from Standard )
1143 is static;
1144 ---Level: Public
1145 ---Purpose: Change offscreen FBO viewport.
1146
1147 BufferDump( me : mutable;
692613e5 1148 theImage : in out PixMap from Image;
1149 theBufferType : BufferType from Graphic3d )
7fd59977 1150 returns Boolean from Standard
1151 is static;
1152 ---Level: Public
1153 ---Purpose: Dump active rendering buffer into specified memory buffer.
1154
1155 EnableGLLight( me; enable : Boolean from Standard )
1156 is static;
1157 ---Level: Public
1158 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1159
1160 IsGLLightEnabled( me ) returns Boolean from Standard
1161 is static;
1162 ---Level: Public
1163 ---Purpose: returns the current state of the gl lighting
1164 -- currently used in triedron displaying
1165
1166 Export( me;
5cedc27f
K
1167 theFileName : CString from Standard;
1168 theFormat : ExportFormat from Graphic3d;
1169 theSortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1170 thePrecision : Real from Standard = 0.005;
1171 theProgressBarFunc : Address from Standard = NULL;
1172 theProgressObject : Address from Standard = NULL )
1173 returns Boolean from Standard;
1174 ---Purpose:
1175 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1176 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1177 -- Notice however that results may differ a lot and do not contain some elements.
7fd59977 1178
1179fields
1180
1181--
679ecdee 1182-- Classe: Visual3d_View
7fd59977 1183--
679ecdee 1184-- Purpose: Declaration of the variables specific to views.
7fd59977 1185--
679ecdee 1186-- Reminder: A view is defined by:
1187-- - a ViewManager
1188-- - a ContextView
1189
1190 -- the associated C structure
1191 MyCView : CView from Graphic3d;
7fd59977 1192
679ecdee 1193 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1194 MyContext : ContextView from Visual3d;
7fd59977 1195
679ecdee 1196 -- the associated window
1197 MyWindow : Window from Aspect;
7fd59977 1198
679ecdee 1199 -- association Structure_COMPUTE and Structure_Computed
1200 MyTOCOMPUTESequence : SequenceOfStructure from Graphic3d;
1201 MyCOMPUTEDSequence : SequenceOfStructure from Graphic3d;
7fd59977 1202
679ecdee 1203 -- the graphic driver used
1204 MyGraphicDriver : GraphicDriver from Graphic3d;
7fd59977 1205
679ecdee 1206 -- the background of the associated window
1207 MyBackground : Background from Aspect;
7fd59977 1208
679ecdee 1209 -- the gradient background of the associated window
1210 MyGradientBackground : GradientBackground from Aspect;
7fd59977 1211
679ecdee 1212 -- the displayed structures in the view
1213 MyDisplayedStructure : MapOfStructure from Graphic3d;
7fd59977 1214
679ecdee 1215 myImmediateStructures : MapOfStructure from Graphic3d;
7fd59977 1216
679ecdee 1217 -- the ViewManager associated with the view
1218 MyPtrViewManager : ViewManagerPtr from Visual3d;
7fd59977 1219
679ecdee 1220 -- Booleans
1221 MyCBitFields : CBitFields8 from Graphic3d;
7fd59977 1222
679ecdee 1223 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
13a22457 1224
679ecdee 1225 myDefaultCamera : Camera_Handle from Graphic3d;
b5ac8292 1226
7fd59977 1227friends
1228
679ecdee 1229 class ViewManager from Visual3d
7fd59977 1230
1231end View;