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