0025765: Coding rules - clean up code from obsolete macro checks
[occt.git] / src / Visual3d / Visual3d_View.cdl
1 -- Created on: 1991-09-17
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
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 --              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.
29 --              30-04-02: JMB; MyDisplayedStructure is now a Map instead
30 --                             of a Set. Improves performance of Selection
31 --                             mechanisms
32
33 --              SAV  - 22/10/01 -> Add EnableDepthTest() & IsDepthTestEnabled() methods.
34 --              SAV  - 25/10/01 -> Add EnableGLLight() & IsGLLightEnabled() methods.
35 --              VSV - 28/05/02: ZBUFFER mode of Trihedron
36 --              SAV  - 23/12/02 Added methods too set background image
37
38 class View from Visual3d inherits DataStructureManager from Graphic3d
39
40         ---Version:
41
42         ---Purpose: Creation and edition of a view in a 3D visualiser.
43         --          A 3D view is composed of an "orientation" part defined
44         --          by the position of the observer, the direction of view,
45         --          and a "mapping" part defined by the type of projection
46         --          (parallel or perspective) and by the window-viewport
47         --          couple which allows passage from the projected coordinate
48         --          space into the screen space.
49         -- Summary of 3D Viewing
50         -- To define a view, you must define:
51         -- -   The view orientation transformation
52         -- -   The view mapping transformation
53         -- -   The view representation.
54         --  To activate a view, you must define:
55         -- -   The associated window.
56
57
58 uses
59
60     Array2OfReal            from TColStd,
61
62     Background              from Aspect,
63     GradientBackground      from Aspect,
64     Window                  from Aspect,
65     TypeOfUpdate            from Aspect,
66     TypeOfHighlightMethod   from Aspect,
67     TypeOfTriedronEcho      from Aspect,
68     TypeOfTriedronPosition  from Aspect,
69     Handle                  from Aspect,
70     RenderingContext        from Aspect,
71     GraphicCallbackProc     from Aspect,
72     ColorScale              from Aspect,
73     PrintAlgo               from Aspect,
74
75     BufferType              from Graphic3d,
76     CBitFields8             from Graphic3d,
77     CView                   from Graphic3d,
78     GraphicDriver           from Graphic3d,
79     PtrFrameBuffer          from Graphic3d,
80     Structure               from Graphic3d,
81     SequenceOfStructure     from Graphic3d,
82     MapOfStructure          from Graphic3d,
83     Camera_Handle           from Graphic3d,
84
85     ZLayerId                from Graphic3d,
86     ZLayerSettings          from Graphic3d,
87
88     ContextView             from Visual3d,
89     Layer                   from Visual3d,
90     Light                   from Visual3d,
91     SequenceOfLight         from Visual3d,
92     TypeOfAnswer            from Visual3d,
93     ViewManager             from Visual3d,
94     ViewManagerPtr          from Visual3d,
95
96     TypeOfBackfacingModel   from Visual3d,
97
98     NameOfColor             from Quantity,
99     FillMethod              from Aspect,
100     GradientFillMethod      from Aspect,
101     ExportFormat            from Graphic3d,
102     SortType                from Graphic3d,
103     Color                   from Quantity,
104     FontAspect              from Font,
105     AsciiString             from TCollection,
106     ExtendedString          from TCollection,
107     CGraduatedTrihedron     from Graphic3d,
108     TypeOfStructure         from Graphic3d,
109
110     PixMap                  from Image,
111     Box                     from Bnd
112
113 raises
114     TransformError          from Visual3d,
115     ViewDefinitionError     from Visual3d
116
117 is
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
133         Create ( AManager       : ViewManager from Visual3d )
134                 returns View from Visual3d;
135         ---Level: Public
136         ---Purpose: Creates a view in the viewer <AManager> with a default
137         --          orientation and a default mapping.
138
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
176   RedrawImmediate ( me : mutable )
177   is static;
178   ---Level: Public
179   ---Purpose: Updates layer of immediate presentations.
180
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
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
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
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
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         --
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);
345         --
346         -- // Define a view manager
347         -- Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
348         --
349         -- // Define a view
350         -- Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
351         --
352         -- // Define a window
353         -- Handle(Xw_Window) aWindow = new Xw_Window
354         --      (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
355         --
356         -- // Associate the view and the window
357         -- aView->SetWindow (aWindow);
358         --
359         -- // Map the window
360         -- aWindow->Map ();
361         --
362         -- // Activate the view
363         -- aView->Activate ();
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.
392
393         Update ( me     : mutable;
394     theUpdateMode  : TypeOfUpdate from Aspect )
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
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
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
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
516     GetGraduatedTrihedron(me;
517                           -- Names of axes --
518                           xname, yname, zname : out ExtendedString from TCollection;
519                           -- Draw names --
520                           xdrawname, ydrawname, zdrawname : out Boolean from Standard;
521                           -- Draw values --
522                           xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
523                           -- Draw grid --
524                           drawgrid : out Boolean from Standard;
525                           -- Draw axes --
526                           drawaxes : out Boolean from Standard;
527                           -- Number of splits along axes --
528                           nbx, nby, nbz : out Integer from Standard;
529                           -- Offset for drawing values --
530                           xoffset, yoffset, zoffset : out Integer from Standard;
531                           -- Offset for drawing names of axes --
532                           xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
533                           -- Draw tickmarks --
534                           xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
535                           -- Length of tickmarks --
536                           xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
537                           -- Grid color --
538                           gridcolor : out Color from Quantity;
539                           -- Colors of axis names --
540                           xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
541                           -- Colors of axis and values --
542                           xcolor, ycolor, zcolor : out Color from Quantity;
543                           -- Name of font for names of axes --
544                           fontOfNames : out AsciiString from TCollection;
545                           -- Style of names of axes --
546                           styleOfNames : out FontAspect from Font;
547                           -- Size of names of axes --
548                           sizeOfNames : out Integer from Standard;
549                           -- Name of font for values --
550                           fontOfValues : out AsciiString from TCollection;
551                           -- Style of values --
552                           styleOfValues : out FontAspect from Font;
553                           -- Size of values --
554                           sizeOfValues : out Integer from Standard)
555     returns Boolean from Standard
556     is static;
557     ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
558
559     GraduatedTrihedronDisplay(me : mutable;
560                               -- Names of axes --
561                               xname, yname, zname : ExtendedString from TCollection;
562                               -- Draw names --
563                               xdrawname, ydrawname, zdrawname : Boolean from Standard;
564                               -- Draw values --
565                               xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
566                               -- Draw grid --
567                               drawgrid : Boolean from Standard;
568                               -- Draw axes --
569                               drawaxes : Boolean from Standard;
570                               -- Number of splits along axes --
571                               nbx, nby, nbz : Integer from Standard;
572                               -- Offset for drawing values --
573                               xoffset, yoffset, zoffset : Integer from Standard;
574                               -- Offset for drawing names of axes --
575                               xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
576                               -- Draw tickmarks --
577                               xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
578                               -- Length of tickmarks --
579                               xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
580                               -- Grid color --
581                               gridcolor : Color from Quantity;
582                               -- Colors of axis names --
583                               xnamecolor, ynamecolor, znamecolor : Color from Quantity;
584                               -- Colors of axis and values --
585                               xcolor, ycolor, zcolor : Color from Quantity;
586                               -- Name of font for names of axes --
587                               fontOfNames : AsciiString from TCollection;
588                               -- Style of names of axes --
589                               styleOfNames : FontAspect from Font;
590                               -- Size of names of axes --
591                               sizeOfNames : Integer from Standard;
592                               -- Name of font for values --
593                               fontOfValues : AsciiString from TCollection;
594                               -- Style of values --
595                               styleOfValues : FontAspect from Font;
596                               -- Size of values --
597                               sizeOfValues : Integer from Standard)
598     ---Purpose: Displays a graduated trihedron.
599     is static;
600
601     GraduatedTrihedronErase(me : mutable)
602     ---Purpose: Erases a graduated trihedron from the view.
603     is static;
604
605         ----------------------------
606         ---Category: Inquire methods
607         ----------------------------
608
609         Background ( me )
610                 returns Background from Aspect
611                 is static;
612         ---Level: Internal
613         ---Purpose: Returns the value of the default window background.
614
615         GradientBackground ( me )
616                 returns GradientBackground from Aspect
617                 is static;
618         ---Level: Internal
619         ---Purpose: Returns the value of the window background.
620
621         ContainsFacet ( me )
622                 returns Boolean from Standard
623                 is static;
624         ---Level: Public
625         ---Purpose: Returns Standard_True if one of the structures
626         --          displayed in the view <me> contains Polygons,
627         --          Triangles or Quadrangles.
628
629         ContainsFacet ( me;
630                         ASet    : MapOfStructure from Graphic3d )
631                 returns Boolean from Standard
632                 is static;
633         ---Level: Public
634         ---Purpose: Returns Standard_True if one of the structures
635         --          in the set <ASet> contains Polygons, Triangles
636         --          or Quadrangles.
637
638         Context ( me )
639                 returns ContextView from Visual3d
640                 is static;
641         ---Level: Public
642         ---Purpose: Returns the current context of the view <me>.
643         ---C++: return const &
644
645         DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
646                 is static;
647         ---Level: Internal
648         ---Purpose: Returns the set of structures displayed in
649         --          the view <me>.
650
651         IsActive ( me )
652                 returns Boolean from Standard
653                 is static;
654         ---Level: Public
655         ---Purpose: Returns the activity flag of the view <me>.
656
657         IsDefined ( me )
658                 returns Boolean from Standard
659                 is static;
660         ---Level: Public
661         ---Purpose: Returns True if the window associated to the view
662         --          <me> is defined.
663
664         IsDeleted ( me )
665                 returns Boolean from Standard
666                 is static;
667         ---Level: Public
668         ---Purpose: Returns Standard_True is the view <me> is deleted.
669         --          <me> is deleted after the call Remove (me).
670         ---Category: Inquire methods
671
672     MinMaxValues (me;
673                   theToIgnoreInfiniteFlag   : Boolean from Standard = Standard_False)
674     returns Box from Bnd
675     is static;
676     ---Level: Public
677     ---Purpose: Returns the coordinates of the boundary box of all
678     --          structures displayed in the view <me>.
679     --          If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
680     --          also includes minimum and maximum limits of graphical elements
681     --          forming parts of infinite structures.
682
683     MinMaxValues (me;
684                   theSet : MapOfStructure from Graphic3d;
685                   theToIgnoreInfiniteFlag   : Boolean from Standard = Standard_False)
686     returns Box from Bnd
687     is static;
688     ---Level: Public
689     ---Purpose: Returns the coordinates of the boundary box of all
690     --          structures in the set <theSet>.
691     --          If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
692     --          also includes minimum and maximum limits of graphical elements
693     --          forming parts of infinite structures.
694
695         NumberOfDisplayedStructures ( me )
696                 returns Integer from Standard
697                 is static;
698         ---Level: Internal
699         ---Purpose: Returns number of displayed structures in
700         --          the view <me>.
701
702         Projects (me;
703                    AX, AY, AZ           : Real from Standard;
704                    APX, APY, APZ        : out Real from Standard )
705                 is static;
706         ---Level: Public
707         ---Purpose: Returns the coordinates of the projection of the
708         --          3d coordinates <AX>, <AY>, <AZ>.
709
710     DefaultCamera (me)
711         returns Camera_Handle from Graphic3d
712         is static;
713     ---Level: Public
714     ---Purpose: @return the default camera of <me>.
715     ---C++: return const &
716
717     Camera (me)
718         returns Camera_Handle from Graphic3d
719         is static;
720     ---Level: Public
721     ---Purpose: @return the camera of <me>.
722     ---C++: return const &
723
724     SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
725     ---Level: Public
726     ---Purpose: Set camera object to provide orientation and projection matrices
727     -- for graphic driver.
728
729         Window ( me )
730                 returns Window from Aspect
731         ---Level: Public
732         ---Purpose: Returns the window associated to the view <me>.
733         --  Warning: Raises ViewDefinitionError if the associated
734         --          window isn't defined.
735         raises ViewDefinitionError from Visual3d is static;
736
737         LightLimit ( me ) returns Integer is static;
738         ---Level: Public
739         ---Purpose: Returns the MAX number of light associated to the view <me>.
740
741         PlaneLimit ( me ) returns Integer is static;
742         ---Level: Public
743         ---Purpose: Returns the MAX number of clipping planes
744         -- associated to the view <me>.
745
746         ViewManager ( me ) returns ViewManager from Visual3d is static;
747         ---Level: Advanced
748         ---Purpose: Returns the view manager handle which manage this view
749
750         ----------------------------
751         -- Category: Private methods
752         ----------------------------
753
754   acceptDisplay ( me;
755                   theStructType : TypeOfStructure from Graphic3d )
756   returns TypeOfAnswer from Visual3d
757   is static private;
758   ---Level: Internal
759   ---Purpose: Is it possible to display the structure in the view?
760
761         ReCompute ( me  : mutable;
762                     AStructure  : Structure from Graphic3d );
763         ---Level: Advanced
764         ---Purpose: Computes the new presentation of the
765         --          structure <AStructure> displayed in <me>
766         --          with the type Graphic3d_TOS_COMPUTED.
767         ---Category: Private methods
768
769         Compute ( me    : mutable ) is static private;
770         ---Level: Internal
771         ---Purpose: Computes the new presentation of the
772         --          Structures displayed in <me> with the type
773         --          Graphic3d_TOS_COMPUTED.
774         ---Category: Private methods
775
776         ChangeDisplayPriority ( me              : mutable;
777                                 AStructure      : Structure from Graphic3d;
778                                 OldPriority     : Integer from Standard;
779                                 NewPriority     : Integer from Standard )
780                 is static private;
781         ---Level: Internal
782         ---Purpose: Changes the display priority of the structure <AStructure>.
783         ---Category: Private methods
784
785
786         SetZLayerSettings ( me          : mutable;
787                             theLayerId  : ZLayerId       from Graphic3d;
788                             theSettings : ZLayerSettings from Graphic3d )
789           is static private;
790         ---Purpose: Sets the settings for a single Z layer of specified view.
791
792         AddZLayer ( me         : mutable;
793                     theLayerId : ZLayerId from Graphic3d )
794           is static private;
795         ---Purpose: Add a new top-level Z layer to the view with ID
796         -- <theLayerId>. The z layer mechanism allows to display
797         -- structures in higher layers in overlay of structures in lower layers.
798         -- The layers in a particular view should be managed centrally
799         -- by its view manager so to avoid IDs mismatching and provide correct
800         -- display of graphics in all views.
801
802         RemoveZLayer ( me         : mutable;
803                        theLayerId : ZLayerId from Graphic3d )
804           is static private;
805         ---Purpose: Remove z layer from the view by its ID.
806
807         ChangeZLayer ( me           : mutable;
808                        theStructure : Structure from Graphic3d;
809                        theLayerId   : ZLayerId  from Graphic3d )
810            is static private;
811         ---Purpose: Change Z layer of already displayed structure in the view.
812
813         Clear ( me              : mutable;
814                 AStructure      : Structure from Graphic3d;
815                 WithDestruction : Boolean from Standard )
816                 is static private;
817         ---Level: Internal
818         ---Purpose: Clears the structure <AStructure> to the view <me>.
819         ---Category: Private methods
820
821         Connect ( me            : mutable;
822                   AMother       : Structure from Graphic3d;
823                   ADaughter     : Structure from Graphic3d )
824                 is static private;
825         ---Level: Internal
826         ---Purpose: Connects the structures <AMother> and <ADaughter>.
827         ---Category: Private methods
828
829         Disconnect ( me         : mutable;
830                      AMother    : Structure from Graphic3d;
831                      ADaughter  : Structure from Graphic3d )
832                 is static private;
833         ---Level: Internal
834         ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
835         ---Category: Private methods
836
837         Display ( me            : mutable;
838                   AStructure    : Structure from Graphic3d )
839                 is static private;
840         ---Level: Internal
841         ---Purpose: Display the structure <AStructure> to the view <me>.
842         ---Category: Private methods
843
844         Display ( me            : mutable;
845                   AStructure    : Structure from Graphic3d;
846                   AnUpdateMode  : TypeOfUpdate from Aspect )
847                 is static private;
848         ---Level: Internal
849         ---Purpose: Display the structure <AStructure> to the view <me>.
850         ---Category: Private methods
851
852   DisplayImmediate ( me : mutable;
853                      theStructure    : Structure from Graphic3d;
854                      theIsSingleView : Boolean   from Standard = Standard_True)
855   returns Boolean from Standard
856   is static;
857   ---Level: Internal
858   ---Purpose: Add structure to the list of immediate presentations.
859   -- @return true if structure has not been registered in this view
860
861   EraseImmediate ( me : mutable;
862                    theStructure : Structure from Graphic3d )
863   returns Boolean from Standard
864   is static;
865   ---Level: Internal
866   ---Purpose: Removes the structure from the list of immediate presentations.
867   -- @return true if structure has been registered in view
868
869   ClearImmediate ( me : mutable )
870   returns Boolean from Standard
871   is static;
872   ---Level: Internal
873   ---Purpose: Clears list of immediate presentations.
874   -- @return true if list was not empty
875
876         Erase ( me              : mutable;
877                 AStructure      : Structure from Graphic3d )
878                 is static private;
879         ---Level: Internal
880         ---Purpose: Erases the structure <AStructure> from the view <me>.
881         ---Category: Private methods
882
883         Erase ( me              : mutable;
884                 AStructure      : Structure from Graphic3d;
885                 AnUpdateMode    : TypeOfUpdate from Aspect )
886                 is static private;
887         ---Level: Internal
888         ---Purpose: Erases the structure <AStructure> from the view <me>.
889         ---Category: Private methods
890
891         Highlight ( me                  : mutable;
892                     AStructure          : Structure from Graphic3d;
893                     AMethod             : TypeOfHighlightMethod from Aspect )
894                 is static private;
895         ---Level: Internal
896         ---Purpose: Highlights the structure <AStructure> in the view <me>.
897         ---Category: Private methods
898
899         SetTransform ( me               : mutable;
900                        AStructure       : Structure from Graphic3d;
901                        ATrsf            : Array2OfReal from TColStd )
902                 is static private;
903         ---Level: Internal
904         ---Purpose: Transforms the structure <AStructure> in the view <me>.
905         ---Category: Private methods
906
907         UnHighlight ( me                : mutable;
908                       AStructure        : Structure from Graphic3d )
909                 is static private;
910         ---Level: Internal
911         ---Purpose: Suppress the highlighting on the structure <AStructure>
912         --          in the view <me>.
913         ---Category: Private methods
914
915         IsComputed ( me;
916                      AStructure : Structure from Graphic3d )
917                 returns Integer from Standard
918                 is static private;
919         ---Level: Internal
920         ---Purpose: Returns an index != 0 if the structure <AStructure>
921         --          have another structure computed for the view <me>.
922         ---Category: Private methods
923
924         Identification ( me )
925                 returns Integer from Standard
926                 is static;
927         ---Level: Internal
928         ---Purpose: Returns the identification number of the view <me>.
929         ---Category: Private methods
930
931         IsDisplayed ( me;
932                       AStructure        : Structure from Graphic3d )
933                 returns Boolean from Standard
934                 is static private;
935         ---Level: Internal
936         ---Purpose: Returns true if the structure <AStructure> is
937         --          displayed in the view <me>.
938         ---Category: Private methods
939
940         SetRatio ( me   : mutable )
941                 is static private;
942         ---Level: Internal
943         ---Purpose: Modifies the aspect ratio of the view <me> when the
944         --          associated window is defined or resized.
945         ---Category: Private methods
946
947         UpdateLights ( me       : mutable )
948                 is static private;
949         ---Level: Internal
950         ---Purpose: Updates the lights when the associated window is defined
951         --          and when the view is activated.
952         ---Category: Private methods
953
954         UpdatePlanes ( me       : mutable )
955                 is static private;
956         ---Level: Internal
957         ---Purpose: Updates the planes when the associated window is defined
958         --          and when the view is activated.
959         ---Category: Private methods
960
961         UpdateView ( me : mutable )
962                 is static private;
963         ---Level: Internal
964         ---Purpose: Updates the associated c structure before a call to the
965         --          graphic library.
966         ---Category: Private methods
967
968         -----------------------------
969         -- Category: Internal methods
970         -----------------------------
971
972         CView ( me )
973                 returns Address from Standard
974                 is static;
975         ---Level: Internal
976         ---Purpose: Returns the c structure associated to <me>.
977         ---Category: Private methods
978
979         GraphicDriver ( me )
980                 returns GraphicDriver from Graphic3d
981                 is static;
982         ---Level: Internal
983         ---Purpose: Returns the associated GraphicDriver.
984         ---Category: Internal methods
985   ---C++: return const &
986
987         HaveTheSameOwner ( me;
988                            AStructure   : Structure from Graphic3d )
989                 returns Integer from Standard
990                 is static private;
991         ---Level: Internal
992         ---Purpose: Returns an index != 0 if the structure <AStructure>
993         --          have the same owner than another structure in the
994         --          sequence of the computed structures.
995         ---Category: Private methods
996
997           Print (me; AnUnderLayer : Layer from Visual3d;
998                  AnOverLayer      : Layer from Visual3d;
999                  hPrnDC           : Handle from Aspect;
1000                  showBackground   : Boolean;
1001                  filename         : CString;
1002                  printAlgorithm   : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1003                  theScaleFactor   : Real from Standard = 1.0)
1004           returns Boolean from Standard is static;
1005
1006         ---Level: Internal
1007         ---Purpose: print the contents of all layers of the view to the printer.
1008         -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1009         -- <showBackground> : When set to FALSE then print the view without background color
1010         -- (background is white)
1011         -- else set to TRUE for printing with current background color.
1012         -- <filename>: If != NULL, then the view will be printed to a file.
1013         -- <printAlgo>: Select print algorithm: stretch, tile.
1014         -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1015         -- printings accordingly to the scale factor selected in the printer 
1016         -- properties dialog.
1017         -- Returns Standard_True if the data is passed to the printer, otherwise
1018         -- Standard_False if the print operation failed due to printer error
1019         -- or insufficient memory.
1020         --  Warning: Works only under Windows.
1021
1022           Print (me; hPrnDC     : Handle from Aspect;
1023                  showBackground : Boolean;
1024                  filename       : CString;
1025                  printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1026                  theScaleFactor : Real from Standard = 1.0 )
1027           returns Boolean from Standard is static;
1028
1029         ---Level: Internal
1030         ---Purpose: print the contents of the view to printer.
1031         -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1032         -- <showBackground> : When set to FALSE then print the view without background color
1033         -- (background is white)
1034         -- else set to TRUE for printing with current background color.
1035         -- <filename>: If != NULL, then the view will be printed to a file.
1036         -- <printAlgo>: Select print algorithm: stretch, tile.
1037         -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1038         -- printings accordingly to the scale factor selected in the printer 
1039         -- properties dialog.
1040         -- Returns Standard_True if the data is passed to the printer, otherwise
1041         -- Standard_False if the print operation failed due to printer error
1042         -- or insufficient memory.
1043         --  Warning: Works only under Windows.
1044
1045         ZBufferIsActivated ( me )
1046                 returns Boolean from Standard
1047                 is static;
1048         ---Level: Advanced
1049         ---Purpose: Returns Standard_True if the ZBuffer is activated
1050         --          in the view <me> and Standard_False if not.
1051         ---Category: Internal methods
1052
1053         SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1054                 is static;
1055         ---Level: Advanced
1056         ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1057         --          is equal to 1.
1058         --          Deactivates the ZBuffer if the integer <AnActivity>
1059         --          is equal to 0.
1060         --          If the integer <AnActivity> is equal to -1 then
1061         --          - the ZBuffer is activated if
1062         --              me->Context ().Visualization () == Visual3d_TOV_SHADING
1063         --          - the ZBuffer is deactivated if
1064         --              me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1065         ---Category: Internal methods
1066
1067         UnderLayer ( me )
1068                 returns Layer from Visual3d;
1069         ---Level: Internal
1070         ---Purpose: Returns the underlay of the view <me>.
1071         ---Category: Private methods
1072         ---C++: return const &
1073
1074         OverLayer ( me )
1075                 returns Layer from Visual3d;
1076         ---Level: Internal
1077         ---Purpose: Returns the underlay of the view <me>.
1078         ---Category: Private methods
1079         ---C++: return const &
1080
1081         EnableDepthTest( me; enable : Boolean from Standard )
1082         is static;
1083         ---Level: Public
1084         ---Purpose: turns on/off opengl depth
1085
1086         IsDepthTestEnabled( me ) returns Boolean from Standard
1087         is static;
1088         ---Level: Public
1089         ---Purpose: returns current state of the opengl depth testing
1090
1091         ReadDepths( me; x,y,width,height: Integer from Standard;
1092                         buffer : Address )
1093         is static;
1094         ---Purpose: Reads depths of shown pixels of the given rectangle
1095
1096         FBOCreate( me : mutable; width,height: Integer from Standard )
1097                   returns PtrFrameBuffer from Graphic3d
1098         is static;
1099         ---Level: Public
1100         ---Purpose: Generate offscreen FBO in the graphic library
1101
1102         FBORelease( me     : mutable;
1103                     fboPtr : in out PtrFrameBuffer from Graphic3d )
1104         is static;
1105         ---Level: Public
1106         ---Purpose: Remove offscreen FBO from the graphic library
1107
1108         FBOGetDimensions( me                  : mutable;
1109                           fboPtr              : PtrFrameBuffer from Graphic3d;
1110                           width, height       : out Integer from Standard;
1111                           widthMax, heightMax : out Integer from Standard )
1112         is static;
1113         ---Level: Public
1114         ---Purpose: Read offscreen FBO configuration.
1115
1116         FBOChangeViewport( me                  : mutable;
1117                            fboPtr              : in out PtrFrameBuffer from Graphic3d;
1118                            width, height       : Integer from Standard )
1119         is static;
1120         ---Level: Public
1121         ---Purpose: Change offscreen FBO viewport.
1122
1123         BufferDump( me            : mutable;
1124                     theImage      : in out PixMap from Image;
1125                     theBufferType : BufferType from Graphic3d )
1126                    returns Boolean from Standard
1127         is static;
1128         ---Level: Public
1129         ---Purpose: Dump active rendering buffer into specified memory buffer.
1130
1131         EnableGLLight( me; enable : Boolean from Standard )
1132         is static;
1133         ---Level: Public
1134         ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1135
1136         IsGLLightEnabled( me ) returns Boolean from Standard
1137         is static;
1138         ---Level: Public
1139         ---Purpose: returns the current state of the gl lighting
1140         --          currently used in triedron displaying
1141
1142         Export( me;
1143                 theFileName        : CString from Standard;
1144                 theFormat          : ExportFormat from Graphic3d;
1145                 theSortType        : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1146                 thePrecision       : Real from Standard = 0.005;
1147                 theProgressBarFunc : Address from Standard = NULL;
1148                 theProgressObject  : Address from Standard = NULL )
1149         returns Boolean from Standard;
1150     ---Purpose:
1151     -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1152     -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1153     -- Notice however that results may differ a lot and do not contain some elements.
1154
1155 fields
1156
1157   -- the ViewManager associated with the view
1158   myViewManager : ViewManagerPtr from Visual3d;
1159
1160   -- the associated C structure
1161   MyCView   : CView from Graphic3d;
1162
1163   -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1164   MyContext : ContextView from Visual3d;
1165
1166   -- the associated window
1167   MyWindow  : Window from Aspect;
1168
1169   -- association Structure_COMPUTE and Structure_Computed
1170   myStructsToCompute  : SequenceOfStructure from Graphic3d;
1171   myStructsComputed   : SequenceOfStructure from Graphic3d;
1172   myIsInComputedMode  : Boolean from Standard;
1173
1174   -- the graphic driver used
1175   myGraphicDriver : GraphicDriver from Graphic3d;
1176
1177   -- the background of the associated window
1178   MyBackground    : Background from Aspect;
1179
1180   -- the gradient background of the associated window
1181   MyGradientBackground  : GradientBackground from Aspect;
1182
1183   -- the displayed structures in the view
1184   myStructsDisplayed    : MapOfStructure from Graphic3d;
1185   myImmediateStructures : MapOfStructure from Graphic3d;
1186
1187   MyGTrihedron     : CGraduatedTrihedron from Graphic3d;
1188
1189   myDefaultCamera  : Camera_Handle from Graphic3d;
1190
1191   myAutoZFitIsOn          : Boolean from Standard;
1192   myAutoZFitScaleFactor   : Real from Standard;
1193
1194   myStructuresUpdated     : Boolean from Standard;
1195
1196 friends
1197
1198   class ViewManager from Visual3d
1199
1200 end View;