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