0026033: Coding rules - get rid from _Handle classes
[occt.git] / src / V3d / V3d_View.cdl
1 -- Created on: 1992-01-15
2 -- Created by: GG
3 -- Copyright (c) 1992-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 -- Modified:    FMN - 24/12/97 -> Suppression GEOMLITE
18 --              stt:25-02-98; S3558: ajout IfManageStandardEvent
19 --              stt:08-04-98; suppr IfManageStandardEvent
20 --              CAL - 18/08/98 -> S3892. Ajout grilles 3d.
21 --              BGN - 16-09-98; Points d'entree du Triedre (S3819, Phase 1)
22 --              22-09-98 ; BGN : S3989 (anciennement S3819)
23 --                               TypeOfTriedron* from Aspect(et pas V3d)
24 --              CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
25 --              29-OCT-98 : DCB : Adding ScreenCopy () method.
26 --      GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
27 --                method instead.
28 --              -> Rename internal RefToPix() to Convert() method.
29 --              -> Add ConvertToGrid() methods,
30 --                 the Compute() internal method become private.
31 --              -> Add SetProjModel() method.
32 --      VKH - 15/11/99 : G004
33 --              -> Add method Dump()
34 --      THA  - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
35 --              -> Add Print method (works only under Windows).
36 --              SAV - 22/10/01
37 --                              -> Add EnableDepthTest() & IsDepthTestEnabled().
38 --              VSV - 28/05/02: ZBUFFER mode of Trihedron
39 --              SAV - 23/12/02  -> Added methods to set background image
40 --              NKV - 23/07/07  -> Define custom projection and model view matrixes
41 --              NKV - 08/02/07  -> Add ConvertWithProj() method
42
43 class View from V3d inherits TShared from MMgt
44
45         ---Purpose: Defines the application object VIEW for the
46         --          VIEWER application.
47         --          The methods of this class allow the editing
48         --          and inquiring the parameters linked to the view.
49         --          (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
50         --           et Conversions) .
51         --          Provides a set of services common to all types of view.
52         --  Warning: The default parameters are defined by the class
53         --          Viewer (Example : SetDefaultViewSize()).
54         --          Certain methods are mouse oriented, and it is
55         --          necessary to know the difference between the start and
56         --          the continuation of this gesture in putting the method
57         --          into operation.
58         --          Example : Shifting the eye-view along the screen axes.
59         --
60         --              View->Move(10.,20.,0.,True)     (Starting motion)
61         --              View->Move(15.,-5.,0.,False)    (Next motion)
62
63 uses
64
65         -- S3892
66         Pnt                     from gp,
67         Dir                     from gp,
68         Ax3                     from gp,
69         LayerMgr                from V3d,
70         ColorScale              from V3d,
71         ColorScale              from Aspect,
72         Array2OfReal            from TColStd,
73         Grid                    from Aspect,
74         Handle                  from Aspect,
75         Structure               from Graphic3d,
76         Group                   from Graphic3d,
77
78         ListOfTransient                   from V3d,
79         ListIteratorOfListOfTransient     from TColStd,
80         TypeOfView                        from V3d,
81         TypeOfAxe                         from V3d,
82         TypeOfOrientation                 from V3d,
83         TypeOfShadingModel                from V3d,
84         TypeOfSurfaceDetail               from V3d,
85         TextureEnv                        from Graphic3d,
86         TypeOfVisualization               from V3d,
87         TypeOfZclipping                   from V3d,
88         TypeOfBackfacingModel             from V3d,
89         StereoDumpOptions                 from V3d,
90         Viewer                            from V3d,
91         Light                             from V3d,
92         View                              from Visual3d,
93         ContextView                       from Visual3d,
94         Vector                            from Graphic3d,
95         Vertex                            from Graphic3d,
96         Camera                            from Graphic3d,
97         Window                            from Aspect,
98         PixMap                            from Image,
99         BufferType                        from Graphic3d,
100         Background                        from Aspect,
101         GradientBackground                from Aspect,
102         TypeOfColor                       from Quantity,
103         NameOfColor                       from Quantity,
104         Color                             from Quantity,
105         Length                            from Quantity,
106         PlaneAngle                        from Quantity,
107         Parameter                         from Quantity,
108         Factor                            from Quantity,
109         Ratio                             from Quantity,
110         Coefficient                       from Quantity,
111         Coordinate                        from V3d,
112         Array2OfReal                      from TColStd,
113         ViewerPointer                     from V3d,
114         TypeOfTriedronEcho                from Aspect,
115         TypeOfTriedronPosition            from Aspect,
116         RenderingContext                  from Aspect,
117         GraphicCallbackProc               from Aspect,
118         FillMethod                        from Aspect,
119         GradientFillMethod                from Aspect,
120         FontAspect                        from Font,
121         AsciiString                       from TCollection,
122         ExtendedString                    from TCollection,
123         PrintAlgo                         from Aspect,
124         ClipPlane                         from Graphic3d,
125         GraduatedTrihedron               from Graphic3d,
126         SequenceOfHClipPlane              from Graphic3d,
127         RenderingMode                     from Graphic3d,
128         RenderingParams                   from Graphic3d,
129         XYZ                               from gp,
130         Box                               from Bnd
131 raises
132
133         BadValue from V3d, TypeMismatch from Standard,
134         MultiplyDefined from Standard,UnMapped from V3d
135
136 is
137
138         Create ( VM : Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
139         ---Purpose: Initializes the view.
140
141         Create (theVM : Viewer; theView : View from V3d);
142         ---Purpose: Initializes the view by copying.
143
144         --------------------------------------------------------
145         ---Category: Methods to modify the Status of the view
146         --------------------------------------------------------
147
148         SetWindow ( me : mutable ; IdWin : Window )
149         ---Purpose: Activates the view in the window specified and Map the
150         --          Window to the screen.
151         raises MultiplyDefined from Standard;
152         ---Level: Public
153         ---Purpose:  Warning! raises MultiplyDefined from Standard
154         --      if the view is already activated in a window.
155         --  Warning: The view is centered and resized to preserve
156         --          the height/width ratio of the window.
157
158         SetWindow ( me            : mutable ;
159                     aWindow       : Window from Aspect;
160                     aContext      : RenderingContext from Aspect;
161                     aDisplayCB    : GraphicCallbackProc from Aspect;
162                     aClientData   : Address from Standard
163           )
164         ---Purpose: Activates the view in the specified Window
165         --      If <aContext> is not NULL the graphic context is used
166         --          to draw something in this view.
167         --      Otherwise an internal graphic context is created.
168         --      If <aDisplayCB> is not NULL then a user display CB is
169         --      call at the end of the OCC graphic traversal and just
170         --      before the swap of buffers. The <aClientData> is pass
171         --      to this call back.
172         raises MultiplyDefined from Standard;
173         ---Level: Public
174         ---Purpose:  Warning! raises MultiplyDefined from Standard
175         --      if the view is already activated in a window.
176         --  Warning: The view is centered and resized to preserve
177         --          the height/width ratio of the window.
178
179         SetMagnify (me: mutable; IdWin            : Window;
180                                  aPreviousView    : View from V3d;
181                                  x1 , y1 , x2 , y2: Integer from Standard)
182         is static;
183
184         Remove ( me );
185         ---Level: Public
186         ---Purpose: Destroys the view.
187
188         Update ( me ) is static;
189         ---Level: Public
190         ---Purpose: Deprecated, Redraw() should be used instead.
191
192         Redraw ( me );
193         ---Level: Public
194         ---Purpose: Redisplays the view even if there has not
195         --          been any modification.
196         --          Must be called if the view is shown.
197         --          (Ex: DeIconification ) .
198
199         RedrawImmediate ( me );
200         ---Level: Public
201         ---Purpose: Updates layer of immediate presentations.
202
203         Invalidate ( me );
204         ---Level: Public
205         ---Purpose: Invalidates view content but does not redraw it.
206
207         Redraw ( me ;x,y,width,height: Integer from Standard);
208         ---Level: Public
209         ---Purpose: Redisplays the view area after esxposure.
210     -- [x,y] define the min xy area position
211     -- [width,height] the size of the area in pixel unit.
212
213         MustBeResized ( me : mutable )
214         ---Level: Public
215         ---Purpose: Must be called when the window supporting the
216         --          view changes size.
217         raises UnMapped from V3d;
218         ---Purpose:      if the view is not mapped on a window.
219         --  Warning: The view is centered and resized to preserve
220         --          the height/width ratio of the window.
221
222         DoMapping ( me : mutable );
223         ---Level: Advanced
224         ---Purpose: Must be called when the window supporting the
225         --          view is mapped or unmapped.
226
227         IsEmpty ( me ) returns Boolean;
228         ---Level: Public
229         ---Purpose: Returns the status of the view regarding
230         --          the displayed structures inside
231         --          Returns True is The View is empty
232
233         UpdateLights (me);
234         ---Level: Public
235         ---Purpose: Updates the lights of the view. The view is redrawn.
236
237         AutoZFit (me : mutable);
238         ---Level: Public
239         ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
240         --          projection volume planes with call to ZFitAll.
241
242         ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
243         ---Level: Public
244         ---Purpose: Change Z-min and Z-max planes of projection volume to match the
245         --          displayed objects. 
246
247         --------------------------------------------------------
248         ---Category: Methods to modify the Attributes of the view
249         --------------------------------------------------------
250
251         SetBackgroundColor ( me : mutable ;
252                         Type : TypeOfColor; V1, V2, V3 : Parameter );
253         ---Level: Public
254         ---Purpose: Defines the background colour of the view
255         --          by supplying :
256         --          the colour definition type,
257         --          and the three corresponding values.
258
259         SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
260         ---Level: Public
261         ---Purpose: Defines the background colour of the view
262         --          by supplying :
263         --          the colour object.
264
265         SetBackgroundColor ( me : mutable ; Name : NameOfColor );
266         ---Level: Public
267         ---Purpose: Defines the background colour of the view
268         --          by supplying :
269         --          the colour name in the form Quantity_NOC_xxxx .
270
271         SetBgGradientColors ( me : mutable ;
272                               Color1 : Color from Quantity;
273                               Color2 : Color from Quantity;
274                               FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
275                               update    : Boolean from Standard = Standard_False );
276         ---Level: Public
277         ---Purpose: Defines the gradient background colours of the view
278         --          by supplying :
279         --          two colour objects,
280         --          and fill method (horizontal by default)
281
282         SetBgGradientColors ( me : mutable ;
283                               Color1 : NameOfColor;
284                               Color2 : NameOfColor;
285                               FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
286                               update    : Boolean from Standard = Standard_False );
287         ---Level: Public
288         ---Purpose: Defines the gradient background colours of the view
289         --          by supplying :
290         --          two colour names in the form Quantity_NOC_xxxx,
291         --          and fill method (horizontal by default)
292
293         SetBgGradientStyle( me : mutable ;
294                             AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
295                             update  : Boolean from Standard = Standard_False);
296         ---Level: Public
297         ---Purpose: Defines the gradient background fill method of the view
298
299         SetBackgroundImage( me : mutable; FileName  : CString from Standard;
300               FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
301                   update    : Boolean from Standard = Standard_False );
302         ---Level: Public
303         ---Purpose: Defines the background texture of the view
304         ---         by supplying :
305         ---         texture image file name,
306         ---         and fill method (centered by default)
307
308         SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
309                                    update    : Boolean from Standard = Standard_False );
310         ---Level: Public
311         ---Purpose: Defines the textured background fill method of the view
312
313         SetAxis ( me : mutable; X,Y,Z : Coordinate ;
314                                 Vx,Vy,Vz : Parameter )
315         ---Level: Public
316         ---Purpose: Definition of an axis from its origin and
317         --          its orientation .
318         --          This will be the current axis for rotations and movements.
319         raises BadValue from V3d;
320         ---Purpose:  Warning! raises BadValue from V3d if the vector normal is NULL. .
321
322         SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
323         ---Level: Public
324         ---Purpose: Defines the shading model for the
325         --          visualisation ZBUFFER mode.
326         --          Various models are available.
327
328         SetSurfaceDetail(me  : mutable; SurfaceDetail : TypeOfSurfaceDetail);
329         ---Level: Public
330         ---Purpose: select the kind of rendering for texture mapping
331         --          no texture mapping by default
332
333         SetTextureEnv(me  : mutable; ATexture  :  TextureEnv  from  Graphic3d);
334         ---Level: Public
335         ---Purpose: set the environment texture to use
336         --          no environment texture by default
337
338         SetVisualization ( me : mutable;
339                                 Mode : TypeOfVisualization from V3d );
340         ---Level: Public
341         ---Purpose: Defines the visualisation mode in the view.
342
343         SetAntialiasingOn ( me : mutable );
344         ---Level: Public
345         ---Purpose: Activates antialiasing in the view.
346
347         SetAntialiasingOff ( me : mutable );
348         ---Level: Public
349         ---Purpose: Desactivates antialiasing in the view.
350
351         SetZClippingDepth ( me : mutable; Depth : Length );
352         ---Level: Public
353         ---Purpose: Defines the depth of the medium clipping plane.
354
355         SetZClippingWidth ( me : mutable; Width : Length )
356         ---Level: Public
357         ---Purpose: Defines the thicknes around the medium clippling plane.   .
358                 raises BadValue from V3d;
359         --      If the thickness is <= 0
360
361         SetZClippingType ( me : mutable; Type : TypeOfZclipping );
362         ---Level: Public
363         ---Purpose: Defines the type of ZClipping.
364
365         SetZCueingDepth ( me : mutable; Depth : Length );
366         ---Level: Public
367         ---Purpose: Defines the depth of the medium plane.
368
369         SetZCueingWidth ( me : mutable; Width : Length )
370         ---Level: Public
371         ---Purpose: Defines the thickness around the medium plane.
372                 raises BadValue from V3d;
373         --      If thickness is <= 0
374
375         SetZCueingOn ( me : mutable );
376         ---Level: Public
377         ---Purpose: Activates ZCueing in the view.
378
379         SetZCueingOff ( me : mutable );
380         ---Level: Public
381         ---Purpose: Desactivates ZCueing in the view.
382
383         SetLightOn( me : mutable ; MyLight : Light from V3d )
384         ---Level: Public
385         ---Purpose: Activates MyLight in the view.
386                 raises BadValue from V3d;
387         --      If No More Light can be activated in MyView .
388
389         SetLightOn( me : mutable )
390         ---Level: Public
391         ---Purpose: Activates all the lights defined in this view.
392                 raises BadValue from V3d;
393         --      If No More Light can be activated in MyView .
394
395         SetLightOff( me : mutable ; MyLight : Light  from V3d );
396         ---Level: Public
397         ---Purpose: Desactivate MyLight in this view.
398
399         SetLightOff( me : mutable );
400         ---Level: Public
401         ---Purpose: Deactivate all the Lights defined in this view.
402
403         IsActiveLight( me ; aLight: Light  from V3d )
404         returns Boolean from Standard;
405         ---Level: Public
406         ---Purpose: Returns TRUE when the light is active in this view.
407
408         SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
409         returns Boolean from Standard;
410           ---Purpose: sets the immediate update mode and returns the previous one.
411
412         ---------------------------------------------------
413         --           Triedron methods
414         ---------------------------------------------------
415
416         ZBufferTriedronSetup ( me      : mutable;
417                            XColor  : NameOfColor from Quantity = Quantity_NOC_RED;
418                            YColor  : NameOfColor from Quantity = Quantity_NOC_GREEN;
419                            ZColor  : NameOfColor from Quantity = Quantity_NOC_BLUE1;
420                    SizeRatio : Real from Standard = 0.8;
421                    AxisDiametr : Real from Standard = 0.05;
422                    NbFacettes  : Integer from Standard = 12)
423          is static;
424         ---Level: Advanced
425         ---Purpose: Customization of the ZBUFFER Triedron.
426         ---         XColor,YColor,ZColor - colors of axis
427         ---         SizeRatio - ratio of decreasing of the trihedron size when its phisical
428         ---                     position comes out of the view
429         ---         AxisDiametr - diameter relatively to axis length
430         ---         NbFacettes - number of facettes of cylinders and cones
431
432         TriedronDisplay ( me            : mutable;
433                           APosition     : TypeOfTriedronPosition from Aspect  = Aspect_TOTP_CENTER;
434                           AColor        : NameOfColor from Quantity = Quantity_NOC_WHITE ;
435                           AScale        : Real from Standard  =  0.02;
436                           AMode         : TypeOfVisualization from V3d = V3d_WIREFRAME )
437                 is static;
438         ---Level: Advanced
439         ---Purpose: Display of the Triedron.
440         ---         Initialize position, color and length of Triedron axes.
441         ---         The scale is a percent of the window width.
442         ---Category:
443
444         TriedronErase ( me : mutable )
445                 is static;
446         ---Level: Advanced
447         ---Purpose: Erases the Triedron.
448         ---Category:
449
450         TriedronEcho ( me       : mutable;
451                        AType    : TypeOfTriedronEcho from Aspect  = Aspect_TOTE_NONE )
452                 is static;
453         ---Level: Advanced
454         ---Purpose: Highlights the echo zone of the Triedron.
455         ---Category:
456
457         ---------------------------------
458         ---Category: Graduated trihedron
459         ---------------------------------
460
461         GetGraduatedTrihedron (me)
462         returns GraduatedTrihedron from Graphic3d
463         ---Purpose: Returns data of a graduated trihedron.
464         ---C++: return const&
465         is static;
466
467         GraduatedTrihedronDisplay(me : mutable;
468                                   theTrigedronData: in GraduatedTrihedron from Graphic3d)
469         ---Purpose: Displays a graduated trihedron.
470         is static;
471
472         GraduatedTrihedronErase(me : mutable)
473         ---Purpose: Erases a graduated trihedron from the view.
474         is static;
475
476         ---------------------------------------------------
477         --           Color Scale methods
478         ---------------------------------------------------
479
480         SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
481
482         ColorScaleDisplay(me : mutable);
483
484         ColorScaleErase(me : mutable);
485
486         ColorScaleIsDisplayed(me)
487         returns Boolean from Standard;
488
489         ColorScale(me)
490         returns ColorScale from Aspect;
491
492         --------------------------------------------------------
493         ---Category: Methods to modify the Projection of the view
494         --------------------------------------------------------
495
496         SetFront(me: mutable);
497         ---Level: Public
498         ---Purpose: modify the Projection of the view perpendicularly to
499         --          the privileged plane of the viewer.
500
501         Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
502                                 Start    : Boolean = Standard_True )
503         ---Level: Public
504         ---Purpose: Rotates the eye about the coordinate system of
505         --          reference of the screen
506         --          for which the origin is the view point of the projection,
507         --          with a relative angular value in RADIANS with respect to
508         --          the initial position expressed by Start = Standard_True
509         raises BadValue from V3d;
510         ---Purpose:  Warning! raises BadValue from V3d
511         --      If the eye, the view point, or the high point are
512         --          aligned or confused.
513
514         Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
515                                 X,Y,Z    : Coordinate ;
516                                 Start    : Boolean = Standard_True )
517         ---Level: Public
518         ---Purpose: Rotates the eye about the coordinate system of
519         --          reference of the screen
520         --          for which the origin is Gravity point {X,Y,Z},
521         --          with a relative angular value in RADIANS with respect to
522         --          the initial position expressed by Start = Standard_True
523                 raises BadValue from V3d;
524         ---Purpose:      If the eye, the view point, or the high point are
525         --          aligned or confused.
526
527         Rotate ( me : mutable ; Axe      : TypeOfAxe ; Angle : PlaneAngle ;
528                                 X,Y,Z    : Coordinate ;
529                                 Start    : Boolean = Standard_True );
530         ---Level: Public
531         ---Purpose: Rotates the eye about one of the coordinate axes of
532         --          of the view for which the origin is the Gravity point{X,Y,Z}
533         --          with an relative angular value in RADIANS with
534         --          respect to the initial position expressed by
535         --          Start = Standard_True
536
537         Rotate ( me : mutable ; Axe    : TypeOfAxe ; Angle : PlaneAngle ;
538                                 Start : Boolean = Standard_True ) ;
539         ---Level: Public
540         ---Purpose: Rotates the eye about one of the coordinate axes of
541         --          of the view for which the origin is the view point of the
542         --          projection with an relative angular value in RADIANS with
543         --          respect to the initial position expressed by
544         --          Start = Standard_True
545
546         Rotate ( me : mutable ; Angle : PlaneAngle ;
547                                 Start : Boolean = Standard_True );
548         ---Level: Public
549         ---Purpose: Rotates the eye around the current axis a relative
550         --          angular value in RADIANS with respect to the initial
551         --          position expressed by Start = Standard_True
552
553         Move ( me : mutable ; Dx,Dy,Dz : Length ;
554                               Start    : Boolean = Standard_True )
555         ---Level: Public
556         ---Purpose: Movement of the eye parallel to the coordinate system
557         --          of reference of the screen a distance relative to the
558         --          initial position expressed by Start = Standard_True.
559                 raises BadValue from V3d;
560         --      If the eye, the view point, or the high point are
561         --      aligned or confused.
562
563         Move ( me : mutable ; Axe   : TypeOfAxe ; Length : Length ;
564                               Start : Boolean = Standard_True )
565         ---Level: Public
566         ---Purpose: Movement of the eye parallel to one of the axes of the
567         --          coordinate system of reference of the view a distance
568         --          relative to the initial position expressed by
569         --          Start = Standard_True.
570                 raises BadValue from V3d;
571         --      If the eye, view point, or high point are aligned or confused.
572
573         Move ( me : mutable ; Length : Length ;
574                               Start  : Boolean = Standard_True )
575         ---Level: Public
576         ---Purpose: Movement of the eye parllel to the current axis
577         --          a distance relative to the initial position
578         --          expressed by Start = Standard_True
579                 raises BadValue from V3d;
580         --      If the eye, view point, or high point are aligned or confused.
581
582         Translate ( me : mutable ; Dx,Dy,Dz : Length ;
583                                    Start    : Boolean = Standard_True )
584         ---Level: Public
585         ---Purpose: Movement of the ye and the view point parallel to the
586         --          frame of reference of the screen a distance relative
587         --          to the initial position expressed by
588         --          Start = Standard_True
589                 raises BadValue from V3d;
590         --      If the eye, view point, or high point are aligned or confused.
591
592         Translate ( me : mutable ; Axe   : TypeOfAxe ; Length : Length ;
593                                    Start : Boolean = Standard_True );
594         ---Level: Public
595         ---Purpose: Movement of the eye and the view point parallel to one
596         --          of the axes of the fame of reference of the view a
597         --          distance relative to the initial position
598         --          expressed by Start = Standard_True
599
600         Translate ( me : mutable ; Length : Length ;
601                                    Start  : Boolean = Standard_True );
602         ---Level: Public
603         ---Purpose: Movement of the eye and view point parallel to
604         --          the current axis a distance relative to the initial
605         --          position expressed by Start = Standard_True
606
607         Place (me            : mutable;
608                theXp         : Integer from Standard;
609                theYp         : Integer from Standard;
610                theZoomFactor : Factor from Quantity = 1)
611         ---Level: Public
612         ---Purpose: places the point of the view corresponding
613         --          at the pixel position x,y at the center of the window
614         --          and updates the view.
615         is static;
616
617         Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
618                               Start    : Boolean = Standard_True )
619         ---Level: Public
620         ---Purpose: Rotation of the view point around the frame of reference
621         --          of the screen for which the origin is the eye of the
622         --          projection with a relative angular value in RADIANS
623         --          with respect to the initial position expressed by
624         --          Start = Standard_True
625                 raises BadValue from V3d;
626         --      If the eye, view point, or high point are aligned or confused.
627
628         Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
629                               Start : Boolean = Standard_True )
630        ;
631         ---Level: Public
632         ---Purpose: Rotation of the view point around one of the axes of the
633         --          frame of reference of the view for which the origin is
634         --          the eye of the projection with an angular value in
635         --          RADIANS relative to the initial position expressed by
636         --          Start = Standard_True
637
638         Turn ( me : mutable ; Angle : PlaneAngle ;
639                               Start : Boolean = Standard_True );
640         ---Level: Public
641         ---Purpose: Rotation of the view point around the current axis an
642         --          angular value in RADIANS relative to the initial
643         --          position expressed by Start = Standard_True
644
645         SetTwist ( me : mutable ; Angle : PlaneAngle )
646         ---Level: Public
647         ---Purpose: Defines the angular position of the high point of
648         --          the reference frame of the view with respect to the
649         --          Y screen axis with an absolute angular value in
650         --          RADIANS.
651                 raises BadValue from V3d;
652         --      If the eye, view point, or high point are aligned or confused.
653
654         SetEye( me : mutable ; X,Y,Z : Coordinate )
655         ---Level: Public
656         ---Purpose: Defines the position of the eye..
657                 raises BadValue from V3d ;
658         --      If the eye, view point, or high point are aligned or confused.
659
660         SetDepth( me : mutable ; Depth : Length )
661         ---Level: Public
662         ---Purpose: Defines the Depth of the eye from the view point
663         --          without update the projection .
664                 raises BadValue from V3d ;
665         --      If the Depth is <= 0.
666
667         SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
668         ---Level: Public
669         ---Purpose: Defines the orientation of the projection.
670                 raises BadValue from V3d ;
671         --      If the eye, view point, or high point are aligned or confused.
672
673         SetProj( me : mutable ; Orientation : TypeOfOrientation )
674         ---Level: Public
675         ---Purpose: Defines the orientation of the projection .
676                 raises BadValue from V3d ;
677         --      If the eye, view point, or high point are aligned or confused.
678         --          Updates the view
679
680         SetAt( me : mutable ; X,Y,Z : Coordinate )
681         ---Level: Public
682         ---Purpose: Defines the position of the view point.
683                 raises BadValue from V3d ;
684         --      If the eye, view point, or high point are aligned or confused.
685
686         SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
687         ---Level: Public
688         ---Purpose: Defines the orientation of the high point.
689                 raises BadValue from V3d ;
690         --      If the eye, view point, or high point are aligned or confused.
691
692         SetUp( me : mutable ; Orientation : TypeOfOrientation )
693         ---Level: Public
694         ---Purpose: Defines the orientation(SO) of the high point.
695                 raises BadValue from V3d ;
696         --      If the eye, view point, or high point are aligned or confused.
697
698         SetViewOrientationDefault( me : mutable );
699         ---Level: Public
700         ---Purpose: Saves the current state of the orientation of the view
701         --          which will be the return state at ResetViewOrientation.
702
703         ResetViewOrientation ( me : mutable );
704         ---Level: Public
705         ---Purpose: Resets the orientation of the view.
706         --          Updates the view
707
708         --------------------------------------------------------
709         ---Category: Methods to modify the Mapping of the view
710         --------------------------------------------------------
711
712         Panning (me            : mutable;
713                  theDXv        : Real from Standard;
714                  theDYv        : Real from Standard;
715                  theZoomFactor : Factor from Quantity = 1;
716                  theToStart    : Boolean = Standard_True);
717         ---Level: Public
718         ---Purpose: Translates the center of the view along "x" and "y" axes of
719         -- view projection. Can be used to perform interactive panning operation.
720         -- In that case the DXv, DXy parameters specify panning relative to the
721         -- point where the operation is started.
722         -- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
723         -- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
724         -- @param theZoomFactor [in] the zooming factor.
725         -- @param theToStart [in] pass TRUE when starting panning to remember view
726         -- state prior to panning for relative arguments. If panning is started,
727         -- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
728         -- Performs update of view.
729
730         SetCenter (me : mutable; theXp, theYp : Integer from Standard)
731         ---Level: Public
732         ---Purpose: Relocates center of screen to the point, determined by
733         -- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
734         -- screen. To calculate pixel coordinates for any point from world
735         -- coordinate space, it can be projected using "Project".
736         -- @param theXp [in] the x coordinate.
737         -- @param theYp [in] the y coordinate.
738         raises BadValue from V3d;
739         -- If one of the dimensions of the projection is NULL.
740
741         SetSize ( me : mutable; theSize : Length )
742         ---Level: Public
743         ---Purpose: Defines the view projection size in its maximum dimension,
744         --          keeping the inital height/width ratio unchanged.
745                 raises BadValue from V3d;
746         --      If <theSize> is <= 0.0
747
748         SetZSize ( me : mutable ; Size : Length )
749         ---Level: Public
750         ---Purpose: Defines the Depth size of the view
751         --          Front Plane will be set to Size/2.
752         --          Back  Plane will be set to -Size/2.
753         --          Any Object located Above the Front Plane or
754         --                             behind the Back Plane will be Clipped .
755         --          NOTE than the XY Size of the View is NOT modified .
756                 raises BadValue from V3d ;
757         --      If the size of the view is <= 0
758
759         SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
760         ---Level: Public
761         ---Purpose: Zooms the view by a factor relative to the initial
762         --          value expressed by Start = Standard_True
763         --          Updates the view.
764                 raises BadValue from V3d ;
765         --      If the zoom coefficient is <= 0
766
767         SetScale ( me : mutable ; Coef : Factor )
768         ---Level: Public
769         ---Purpose: Zooms the view by a factor relative to the value
770         --          initialised by SetViewMappingDefault().
771         --          Updates the view.
772                 raises BadValue from V3d ;
773         --      If the zoom coefficient is <= 0
774
775     SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
776         ---Level: Public
777         ---Purpose: Sets  anisotropic (axial)  scale  factors  <Sx>, <Sy>, <Sz>  for  view <me>.
778     -- Anisotropic  scaling  operation  is  performed  through  multiplying
779     -- the current view  orientation  matrix  by  a  scaling  matrix:
780     -- || Sx  0   0   0 ||
781     -- || 0   Sy  0   0 ||
782     -- || 0   0   Sz  0 ||
783     -- || 0   0   0   1 ||
784         -- Updates the view.
785                 raises BadValue from V3d ;
786         --      If the one of factors <= 0
787
788         FitAll (me : mutable;
789                 theMargin : Coefficient = 0.01;
790                 theToUpdate : Boolean from Standard = Standard_True);
791         ---Level: Public
792         ---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
793         --          The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
794         --          Throws program error exception if margin coefficient is < 0 or >= 1.
795         --          Updates the view.
796         --          @param theMargin [in] the margin coefficient for view borders.
797         --          @param theToUpdate [in] flag to perform view update.
798
799         DepthFitAll( me : mutable ;   Aspect : Coefficient = 0.01;
800                                       Margin : Coefficient = 0.01 );
801         ---Level: Public
802         ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
803         --          and back clipping planes. Also sets depth value automatically depending on the
804         --          calculated Z size and Aspect parameter.
805         --          NOTE than the original XY size of the view is NOT modified .
806
807         FitAll (me : mutable;
808                 theMinXv : Real from Standard;
809                 theMinYv : Real from Standard;
810                 theMaxXv : Real from Standard;
811                 theMaxYv : Real from Standard)
812         ---Level: Public
813         ---Purpose: Centers the defined projection window so that it occupies
814         --          the maximum space while respecting the initial
815         --          height/width ratio.
816         --          NOTE than the original Z size of the view is NOT modified .
817                 raises BadValue from V3d;
818         --              If the defined projection window has zero size.
819
820         WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
821         ---Level: Public
822         ---Purpose: Centers the defined PIXEL window so that it occupies
823         -- the maximum space while respecting the initial height/width ratio.
824         -- NOTE than the original Z size of the view is NOT modified.
825         -- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
826         -- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
827         -- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
828         -- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
829         is static;
830         SetViewMappingDefault( me : mutable );
831         ---Level: Public
832         ---Purpose: Saves the current view mapping. This will be the
833         --          state returned from ResetViewmapping.
834
835         ResetViewMapping ( me : mutable );
836         ---Level: Public
837         ---Purpose: Resets the centering of the view.
838         --          Updates the view
839
840         Reset ( me : mutable; update : Boolean from Standard = Standard_True );
841         ---Level: Public
842         ---Purpose: Resets the centering and the orientation of the view
843         --          Updates the view
844         ---------------------------------------------------
845         ---Category: Inquire methods
846         ---------------------------------------------------
847
848         Convert( me ; Vp : Integer ) returns Length
849         ---Level: Public
850         ---Purpose : Converts the PIXEL value
851         --           to a value in the projection plane.
852         raises UnMapped from V3d;
853         --      If the view is not mapped on the window.
854
855         Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
856         ---Level: Public
857         ---Purpose : Converts the point PIXEL into a point projected
858         --           in the reference frame of the projection plane.
859         raises UnMapped from V3d;
860         --      If the view is not mapped on the window.
861
862         Convert( me ; Vv : Length ) returns Integer
863         ---Level: Public
864         ---Purpose : Converts tha value of the projection plane into
865         --           a PIXEL value.
866         raises UnMapped from V3d;
867         --      If the view is not mapped on the window.
868
869         Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
870         ---Level: Public
871         ---Purpose : Converts the point defined in the reference frame
872         --           of the projection plane into a point PIXEL.
873         raises UnMapped from V3d;
874         --      If the view is not mapped on the window.
875
876         Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
877         ---Level: Public
878         ---Purpose : Converts the projected point into a point
879         --           in the reference frame of the view corresponding
880         --           to the intersection with the projection plane
881         --           of the eye/view point vector.
882         raises UnMapped from V3d;
883         --      If the view is not mapped on the window.
884
885         ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
886         ---Level: Public
887         ---Purpose : Converts the projected point into a point
888         --           in the reference frame of the view corresponding
889         --           to the intersection with the projection plane
890         --           of the eye/view point vector and returns the
891         --           projection ray for further computations.
892         raises UnMapped from V3d;
893         --      If the view is not mapped on the window.
894
895         ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
896         ---Level: Public
897         ---Purpose : Converts the projected point into the nearest grid point
898         --           in the reference frame of the view corresponding
899         --           to the intersection with the projection plane
900         --           of the eye/view point vector and display the grid marker.
901     --  Warning: When the grid is not active the result is identical to the above Convert() method.
902     -- How to use:
903     -- 1) Enable the grid echo display
904     --    myViewer->SetGridEcho(Standard_True);
905     -- 2) When application receive a move event:
906     --   2.1) Check if any object is detected
907     --     if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
908     --   2.2) Check if the grid is active
909         --     if( myViewer->Grid()->IsActive() ) {
910     --   2.3) Display the grid echo and gets the grid point
911         --       myView->ConvertToGrid(x,y,X,Y,Z);
912         --       myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z));
913         --       myView->RedrawImmediate();
914     --   2.4) Else this is the standard case
915         --     } else myView->Convert(x,y,X,Y,Z);
916         raises UnMapped from V3d;
917         --      If the view is not mapped on the window.
918
919         ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
920         ---Level: Public
921         ---Purpose : Converts the point into the nearest grid point
922         --           and display the grid marker.
923     ---Warning: When the grid is not active the result is identical
924     --     to the previous point.
925         raises UnMapped from V3d;
926         --      If the view is not mapped on the window.
927
928         Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
929         ---Level: Public
930         ---Purpose : Projects the point defined in the reference frame of
931         --           the view into the projected point in the associated window.
932
933 --        RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
934 --        ---Purpose : Projects the point defined in the reference frame of
935 --        --           the view into the projected point in the associated window.
936 --  Obsolete : Use Convert(X,Y,Z,Xp,Yp);
937
938 --        PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
939 --        ---Purpose : Converts the projected point in the associated window of
940 --        --           the view into the point defined in the reference frame.
941 --  Obsolete : Use Convert(Xp,Yp,X,Y,Z);
942
943         Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
944         ---Level: Public
945         ---Purpose : Converts the point defined in the user space of
946         --           the view to the projected view plane point at z 0.
947
948         BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
949         ---Level: Public
950         ---Purpose: Returns the Background color values of the view
951         --          depending of the color Type.
952
953         BackgroundColor( me ) returns Color from Quantity;
954         ---Level: Public
955         ---Purpose: Returns the Background color object of the view.
956
957         GradientBackgroundColors( me;
958                                   Color1 : out Color from Quantity;
959                                   Color2 : out Color from Quantity) ;
960         ---Level: Public
961         ---Purpose: Returns the gradient background colour objects of the view.
962
963         GradientBackground ( me ) returns GradientBackground from Aspect;
964         ---Level: Public
965         ---Purpose: Returns the gradient background of the view.
966
967         Scale ( me ) returns Factor ;
968         ---Level: Public
969         ---Purpose: Returns the current value of the zoom expressed with
970         --          respect to SetViewMappingDefault().
971
972     AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
973         ---Level: Public
974         ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
975
976         Size ( me; Width, Height : out Length );
977         ---Level: Public
978         ---Purpose: Returns the height and width of the view.
979
980         ZSize ( me ) returns Real ;
981         ---Level: Public
982         ---Purpose: Returns the Depth of the view .
983
984         Eye( me ; X,Y,Z : out Coordinate );
985         ---Level: Public
986         ---Purpose: Returns the position of the eye.
987
988         FocalReferencePoint (me ; X,Y,Z : out Coordinate );
989         ---Level: Public
990         ---Purpose: Returns the position of point which emanating the
991         --          projections.
992
993         ProjReferenceAxe( me ; Xpix,Ypix           : Integer ;
994                                XP,YP,ZP,VX,VY,VZ   : out Coordinate );
995         ---Level: Public
996         ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
997         --          in the view (XP,YP,ZP), and the projection vector of the
998         --          view passing by the point (for PerspectiveView).
999
1000         Depth( me ) returns Length ;
1001         ---Level: Public
1002         ---Purpose: Returns the Distance between the Eye and View Point.
1003
1004         Proj( me ; Vx,Vy,Vz : out Parameter );
1005         ---Level: Public
1006         ---Purpose: Returns the projection vector.
1007
1008         At( me ; X,Y,Z : out Coordinate );
1009         ---Level: Public
1010         ---Purpose: Returns the position of the view point.
1011
1012         Up( me ; Vx,Vy,Vz : out Parameter );
1013         ---Level: Public
1014         ---Purpose: Returns the vector giving the position of the high point.
1015
1016         Twist( me ) returns PlaneAngle ;
1017         ---Level: Public
1018         ---Purpose: Returns in RADIANS the orientation of the view around
1019         --          the visual axis measured from the Y axis of the screen.
1020
1021         ShadingModel ( me ) returns TypeOfShadingModel ;
1022         ---Level: Public
1023         ---Purpose: Returns the current shading model.
1024
1025         SurfaceDetail(me) returns  TypeOfSurfaceDetail;
1026         ---Level: Public
1027         -- purpose: returns the current SurfaceDetail mode
1028
1029         TextureEnv(me)  returns  TextureEnv  from  Graphic3d;
1030         ---Level: Public
1031         -- purpose: return the current environment texture used
1032
1033         Visualization ( me ) returns TypeOfVisualization from V3d;
1034         ---Level: Public
1035         ---Purpose: Returns the current visualisation mode.
1036
1037         Antialiasing ( me ) returns Boolean;
1038         ---Level: Public
1039         ---Purpose: Indicates if the antialiasing is active (True) or
1040         --          inactive (False).
1041
1042         ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1043         ---Level: Public
1044         ---Purpose: Returns activity and information on the Zcueing.
1045         --          <Depth> : Depth of plane.
1046         --          <Width> : Thickness around the plane.
1047
1048         ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1049         ---Level: Public
1050         ---Purpose: Returns current information on the ZClipping.
1051         --          <Depth> : Depth of plane.
1052         --          <Width> : Thickness around the plane.
1053         --          <TypeOfZclipping>  :        "BACK"
1054         --                                      "FRONT"
1055         --                                      "SLICE"
1056         --                                      "OFF"
1057
1058         IfMoreLights( me ) returns Boolean;
1059         ---Level: Advanced
1060         ---Purpose: Returns True if One light more can be
1061         --          activated in this View.
1062
1063         InitActiveLights(me: mutable);
1064         ---Level: Advanced
1065         ---Purpose: initializes an iteration on the active Lights.
1066
1067         MoreActiveLights (me) returns Boolean from Standard;
1068         ---Level: Advanced
1069         ---Purpose: returns true if there are more active Light(s) to return.
1070
1071         NextActiveLights (me: mutable);
1072         ---Level: Advanced
1073         ---Purpose : Go to the next active Light
1074         --           (if there is not, ActiveLight will raise an exception)
1075
1076         ActiveLight(me) returns Light from V3d;
1077         ---Level: Advanced
1078
1079         Viewer ( me ) returns Viewer from V3d;
1080         ---Level: Advanced
1081         ---Purpose: Returns the viewer in which the view has been created.
1082
1083         IfWindow ( me ) returns Boolean;
1084         ---Level: Public
1085         ---Purpose: Returns True if MyView is associated with a window .
1086
1087         Window ( me ) returns Window from Aspect
1088         ---Level: Public
1089         ---Purpose: Returns the Aspect Window associated with the view.
1090                 raises BadValue from V3d;
1091         --      If MyView is not associated with a window
1092
1093         Type( me ) returns TypeOfView from V3d;
1094         ---Level: Public
1095         ---Purpose: Returns the Type of the View
1096
1097         Pan (me            : mutable;
1098              theDXp        : Integer from Standard;
1099              theDYp        : Integer from Standard;
1100              theZoomFactor : Factor from Quantity = 1;
1101              theToStart    : Boolean = Standard_True);
1102         ---Level: Public
1103         ---Purpose: Translates the center of the view along "x" and "y" axes of
1104         -- view projection. Can be used to perform interactive panning operation.
1105         -- In that case the DXp, DXp parameters specify panning relative to the
1106         -- point where the operation is started.
1107         -- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
1108         -- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
1109         -- @param theZoomFactor [in] the zooming factor.
1110         -- @param theToStart [in] pass TRUE when starting panning to remember view
1111         -- state prior to panning for relative arguments. Passing 0 for relative
1112         -- panning parameter should return view panning to initial state.
1113         -- Performs update of view.
1114
1115         Zoom (me     : mutable;
1116               theXp1 : Integer from Standard;
1117               theYp1 : Integer from Standard;
1118               theXp2 : Integer from Standard;
1119               theYp2 : Integer from Standard)
1120         is static;
1121         ---Level: Public
1122         ---Purpose: Zoom the view according to a zoom factor computed
1123         -- from the distance between the 2 mouse position.
1124         -- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
1125         -- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
1126         -- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
1127         -- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
1128
1129         StartZoomAtPoint (me    : mutable;
1130                           theXp : Integer from Standard;
1131                           theYp : Integer from Standard);
1132         ---Level: Public
1133         ---Purpose: Defines starting point for ZoomAtPoint view operation.
1134         -- @param theXp [in] the x mouse coordinate, in pixels.
1135         -- @param theYp [in] the y mouse coordinate, in pixels.
1136
1137         ZoomAtPoint(me : mutable;
1138                     theMouseStartX : Integer from Standard;
1139                     theMouseStartY : Integer from Standard;
1140                     theMouseEndX   : Integer from Standard;
1141                     theMouseEndY   : Integer from Standard);
1142         ---Level: Public
1143         ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1144
1145         AxialScale  ( me: mutable; Dx, Dy: Integer from Standard;  Axis:  TypeOfAxe  from  V3d );
1146         ---Level: Public
1147         ---Purpose: Performs  anisotropic scaling  of  <me>  view  along  the  given  <Axis>.
1148             -- The  scale  factor  is  calculated on a basis of
1149             -- the mouse pointer displacement <Dx,Dy>.
1150         -- The  calculated  scale  factor  is  then  passed  to  SetAxialScale(Sx,  Sy,  Sz)  method.
1151
1152         StartRotation(me : mutable ; X,Y :Integer from Standard;
1153                zRotationThreshold: Ratio from Quantity = 0.0);
1154         ---Level: Public
1155     ---Purpose: Begin the rotation of the view around the screen axis
1156     -- according to the mouse position <X,Y>.
1157     --  Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1158     -- factor is > 0 soon the distance from the start point and the center
1159     -- of the view is > (medium viewSize * <zRotationThreshold> ).
1160     -- Generally a value of 0.4 is usable to rotate around XY screen axis
1161     -- inside the circular threshold area and to rotate around Z screen axis
1162     -- outside this area.
1163
1164         Rotation(me:mutable;  X,Y :Integer from Standard);
1165         ---Level: Public
1166     ---Purpose: Continues the rotation of the view
1167     -- with an angle computed from the last and new mouse position <X,Y>.
1168
1169         FitAll ( me : mutable ; aWindow: Window from Aspect;
1170                       Umin, Vmin, Umax, Vmax : Coordinate )
1171         is static private;
1172         ---Level: Public
1173     ---Purpose: Change the scale factor and position of the view
1174     -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1175     -- in the view.
1176
1177
1178         -----------------------------------------
1179         ---Category: Private or Protected methods
1180         -----------------------------------------
1181
1182         SetFocale( me : mutable ; Focale : Length )
1183         ---Purpose: Change View Plane Distance for Perspective Views
1184         raises TypeMismatch from Standard
1185         ---Purpose:  Warning! raises TypeMismatch from Standard if the view
1186         --          is not a perspective view.
1187         is static ;
1188
1189         Focale( me ) returns Length;
1190         ---Purpose: Returns the View Plane Distance for Perspective Views
1191
1192         View ( me) returns View from Visual3d is static ;
1193         ---Level: Advanced
1194         ---Purpose: Returns the associated Visual3d view.
1195
1196         ScreenAxis( myclass ; Vpn,Vup        : Dir from gp ;
1197                               Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1198                                         returns Boolean is private ;
1199         ---Purpose: Determines the screen axes in the reference
1200         --          framework of the view.
1201
1202
1203         TrsPoint( myclass ; V : Vertex from Graphic3d ;
1204                                 Matrix : Array2OfReal from TColStd )
1205                                 returns Vertex from Graphic3d is private ;
1206         ---Purpose: Transforms the Vertex V according to the matrice Matrix .
1207         
1208         ImmediateUpdate (me) is static protected;
1209           ---Purpose: 
1210
1211         SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1212         is static;
1213         ---Level: Advanced
1214         ---Purpose: Switches computed HLR mode in the view
1215         ---Category: Methods to modify the class definition
1216
1217         ComputedMode ( me )
1218         returns Boolean from Standard
1219         is static;
1220         ---Level: Advanced
1221         ---Purpose: Returns the computed HLR mode state
1222         ---Category: Inquire methods
1223
1224         MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1225         ---Purpose: Returns the objects number and the projection window
1226         --          of the objects contained in the view.
1227         is static private;
1228
1229         MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1230         returns Integer
1231         ---Purpose: Returns the objects number and the box encompassing
1232         --          the objects contained in the view
1233         is static private;
1234
1235         Gravity ( me; X,Y,Z : out Coordinate )
1236         ---Purpose: Returns the Objects number and the gravity center
1237         --          of ALL viewable points in the view
1238         is static private;
1239
1240         Init(me: mutable) is private;
1241
1242         ---Category: for compatibility.
1243
1244         WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1245         ---Purpose: idem than WindowFit
1246
1247         Compute ( me; AVertex   : Vertex from Graphic3d )
1248                 returns Vertex from Graphic3d
1249                 is static private;
1250         ---Level: Internal
1251         ---Purpose: Returns a new vertex when the grid is activated.
1252
1253         SetGrid ( me    : mutable;
1254                   aPlane: Ax3 from gp;
1255                   aGrid : Grid from Aspect )
1256                 is static;
1257         ---Level: Internal
1258         ---Purpose: Defines or Updates the definition of the
1259         --          grid in <me>
1260         ---Category: Methods to modify the class definition
1261
1262         SetGridGraphicValues ( me       : mutable;
1263                                aGrid    : Grid from Aspect )
1264                 is static;
1265         ---Level: Internal
1266         ---Purpose: Defines or Updates the graphic definition of the
1267         --          grid in <me>
1268         ---Category: Methods to modify the class definition
1269
1270         SetGridActivity ( me    : mutable;
1271                           aFlag : Boolean from Standard )
1272                 is static;
1273         ---Level: Internal
1274         ---Purpose: Defines or Updates the activity of the
1275         --          grid in <me>
1276         ---Category: Methods to modify the class definition
1277
1278         Dump ( me: mutable;
1279                theFile       : CString from Standard;
1280                theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1281     returns Boolean from Standard;
1282         ---Level: Public
1283         ---Purpose: dump the full contents of the view at the same
1284         --          scale in the file <theFile>. The file name
1285         --          extension must be one of ".png",".bmp",".jpg",".gif".
1286         --          Returns FALSE when the dump has failed
1287
1288       Print (me; hPrnDC: Handle from Aspect = 0;
1289              showDialog: Boolean = Standard_True;
1290              showBackground : Boolean = Standard_True;
1291              filename: CString = NULL;
1292              printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1293       returns Boolean from Standard is static;
1294
1295         ---Level: Public
1296         ---Purpose: print the contents of the view to printer with preview.
1297     -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1298     -- then you can pass it to the print routines.
1299         -- If you don't have an PrinterDeviceContext, then this parameter should
1300     -- be NULL.
1301     -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1302     -- open a Print Dialog box.
1303         -- If you want to do this, then set showDialog to TRUE
1304         -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1305     -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1306     -- <showBackground> : When set to FALSE then print the view without background color
1307     -- (background is white)
1308         -- else set to TRUE for printing with current background color.
1309     -- <filename>: If != NULL, then the view will be printed to a file.
1310     -- <printAlgorithm>: If you want to select the print algorithm, then you can
1311         -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1312     -- Returns Standard_True if the data is passed to the printer, otherwise
1313     -- Standard_False if the print operation failed. This might be related to
1314     -- insufficient memory or some internal errors. All this errors are
1315     -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1316     --  Warning: This function can reuse FBO assigned to the 
1317     --  view on level of OpenGl_GraphicDriver; Please take it into account if
1318     --  you use it for your purposes;
1319     --  Warning: Works only under Windows.
1320
1321         ToPixMap (me : mutable;
1322                   theImage  : in out PixMap from Image;
1323                   theWidth  : Integer from Standard;
1324                   theHeight : Integer from Standard;
1325                   theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1326                   theToKeepAspect : Boolean from Standard = Standard_True;
1327                   theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
1328         returns Boolean from Standard;
1329         ---Level   : Public
1330         ---Purpose : Dumps the full contents of the view
1331         --           to a pixmap of pixel size <theWidth> * <theHeight> and
1332         --           buffer type <theBufferType>. If <theToKeepAspect> is true
1333         --           the aspect ratio of view will be kept if <theWidth> and <theHeight>
1334         --           define another ratio.
1335         --           Pixmap will be automatically (re)allocated when needed.
1336         --           When dumping stereographic camera - the corresponding
1337         --           middle-point monographic projection will be used for dumping by default.
1338         --           <theStereoOptions> flags are to be used for dumping then left or
1339         --           right eye projections.
1340
1341         SetBackFacingModel ( me     : mutable;
1342             aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1343             is static;
1344          ---Level   : Public
1345          ---Purpose : Manages display of the back faces
1346      -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1347      -- are displayed only for surface objects and
1348      -- never displayed for solid objects.
1349      -- this was the previous mode.
1350      --      <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1351      --       are always displayed both for surfaces or solids.
1352      --      <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1353      --       are never displayed.
1354
1355         BackFacingModel ( me )
1356             returns TypeOfBackfacingModel from V3d
1357         is static;
1358          ---Level   : Public
1359          ---Purpose : Returns current state of the back faces display
1360
1361         EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1362         is static;
1363      ---Level: Public
1364      ---Purpose: turns on/off opengl depth testing
1365
1366         IsDepthTestEnabled( me ) returns Boolean from Standard
1367         is static;
1368      ---Level: Public
1369      ---Purpose: returns the current state of the depth testing
1370
1371         EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1372         is static;
1373      ---Level: Public
1374      ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1375
1376         IsGLLightEnabled( me ) returns Boolean from Standard
1377         is static;
1378      ---Level: Public
1379      ---Purpose: returns the current state of the gl lighting
1380      --          currently used in triedron displaying
1381
1382      AddClipPlane (me : mutable; thePlane : ClipPlane from Graphic3d) is virtual;
1383      ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
1384      -- rendering space to convex volume. Number of supported clip planes can be consulted
1385      -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
1386      -- which exceed the limit are ignored during rendering. 
1387      -- @param thePlane [in] the clip plane to be added to view.
1388
1389      RemoveClipPlane (me : mutable; thePlane : ClipPlane from Graphic3d) is virtual;
1390      ---Purpose: Removes clip plane from the view.
1391      -- @param thePlane [in] the clip plane to be removed from view.
1392
1393      SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
1394      ---Purpose: Sets sequence of clip planes to the view. The planes that have been set
1395      -- before are removed from the view. The composition of clip planes
1396      -- truncates the rendering space to convex volume. Number of supported
1397      -- clip planes can be consulted by PlaneLimit method of associated
1398      -- Visual3d_View. Please be aware that the planes which exceed the limit
1399      -- are ignored during rendering. 
1400      -- @param thePlanes [in] the clip planes to set.
1401
1402      GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
1403      ---C++: return const&
1404      ---Purpose: Get clip planes.
1405      -- @return sequence clip planes that have been set for the view
1406
1407     SetCamera (me : mutable; theCamera : Camera from Graphic3d) is static;
1408     ---Level: Public
1409     ---Purpose: Change camera used by view.
1410
1411     Camera (me) returns Camera from Graphic3d is static;
1412     ---Level: Public
1413     ---C++: return const&
1414     ---Purpose: Returns camera object of the view.
1415     -- @return: handle to camera object, or NULL if 3D view does not use
1416     -- the camera approach.
1417
1418     FitMinMax (me;
1419                theCamera          : Camera from Graphic3d;
1420                theBox             : Box from Bnd;
1421                theMargin          : Real from Standard;
1422                theResolution      : Real from Standard = 0.0;
1423                theToEnlargeIfLine : Boolean from Standard = Standard_True)
1424                returns Boolean from Standard is protected;
1425     ---Level: Protected
1426     ---Purpose: Transform camera eye, center and scale to fit in the
1427     -- passed bounding box specified in WCS.
1428     -- @param theCamera [in] the camera.
1429     -- @param theBox [in] the bounding box.
1430     -- @param theMargin [in] the margin coefficient for view borders.
1431     -- @param theResolution [in] the minimum size of projection of
1432     --        bounding box in Xv or Yv direction when it considered to
1433     --        be a thin plane or point (without a volume).
1434     --        In this case only the center of camera is adjusted.
1435     -- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
1436     -- whole bounding box projected into thin line going along
1437     -- Z-axis of screen, the view plane is enlarged such that
1438     -- we see the whole line on rotation, otherwise only the
1439     -- center of camera is adjusted.
1440     -- @return TRUE if the fit all operation can be done.
1441
1442     Scale (me;
1443            theCamera : Camera from Graphic3d;
1444            theSizeXv : Real from Standard;
1445            theSizeYv : Real from Standard) is protected;
1446     ---Level: Protected
1447     ---Purpose: Scales camera to fit the view frame of defined width and height
1448     -- keeping the aspect. For orthogonal camera the method changes scale,
1449     -- for perspective adjusts Eye location about the Center point.
1450     -- @param theSizeXv [in] size of viewport frame on "x" axis.
1451     -- @param theSizeYv [in] size of viewport frame on "y" axis.
1452
1453     Translate (me;
1454          theCamera : Camera from Graphic3d;
1455          theDXv    : Real from Standard;
1456          theDYv    : Real from Standard) is protected;
1457     ---Level: Protected
1458     -- Purpose: Translates camera eye and center along the view plane.
1459     -- @param theCamera [in] the camera to translate.
1460     -- @param theDXv [in] the translation in "x" direction.
1461     -- @param theDYv [in] the translation in "y" direction.
1462
1463     RenderingParams (me) returns RenderingParams from Graphic3d is static;
1464     ---C++: return const &
1465     ---Level: Public
1466     ---Purpose: Returns current rendering parameters and effect settings.
1467     
1468     ChangeRenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
1469     ---C++: return &
1470     ---Level: Public
1471     ---Purpose: Returns reference to current rendering parameters and effect settings.
1472
1473         IsCullingEnabled (me) returns Boolean from Standard is static;
1474      ---Level: Public
1475      ---Purpose: @return flag value of objects culling mechanism
1476
1477         SetFrustumCulling (me : mutable; theMode : Boolean from Standard) is static;
1478      ---Level: Public
1479      ---Purpose: Turn on/off automatic culling of objects outside frustrum (ON by default)
1480
1481 fields
1482
1483         myOldMouseX : Real is protected;
1484         myOldMouseY : Real is protected;
1485         myCamStartOpUp : Dir from gp is protected;
1486         myCamStartOpEye : Pnt from gp is protected;
1487         myCamStartOpBnd : Real[6] is protected;
1488         myCamStartOpCenter : Pnt from gp is protected;
1489         myCamera : Camera from Graphic3d is protected;
1490
1491         MyViewer :              ViewerPointer from V3d ;
1492         MyActiveLights:         ListOfTransient from V3d;
1493
1494         MyView :                View from Visual3d is protected ;
1495         MyViewContext :         ContextView from Visual3d ;
1496         MyBackground:           Background from Aspect ;
1497         MyGradientBackground:   GradientBackground from Aspect ;
1498         MyDefaultViewAxis:      Vector from Graphic3d ;
1499         MyDefaultViewPoint:     Vertex from Graphic3d ;
1500
1501         MyWindow:               Window from Aspect;
1502
1503         myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1504
1505         sx,sy: Integer from Standard;
1506         rx,ry: Real from Standard;
1507         gx,gy,gz: Real from Standard;
1508         myComputedMode: Boolean from Standard;
1509         SwitchSetFront: Boolean from Standard;
1510         MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1511
1512         -- the 3d grid
1513         MyGrid                  :       Grid from Aspect;
1514         MyPlane                 :       Ax3 from gp;
1515
1516         --MyColorScale            :       ColorScale from V3d;
1517         MyLayerMgr              :       LayerMgr from V3d;
1518
1519         -- the transformation between XoY and the grid plane
1520         MyTrsf                  :       Array2OfReal from TColStd;
1521
1522         -- echo
1523         MyGridEchoStructure             :       Structure from Graphic3d;
1524         MyGridEchoGroup                 :       Group from Graphic3d;
1525
1526         myImmediateUpdate: Boolean from Standard is protected;
1527
1528         myXscreenAxis           : Vector from Graphic3d;
1529         myYscreenAxis           : Vector from Graphic3d;
1530         myZscreenAxis           : Vector from Graphic3d;
1531         myViewAxis              : Vector from Graphic3d;
1532         myGravityReferencePoint : Vertex from Graphic3d;
1533
1534 friends
1535
1536         SetViewOn from class Viewer from V3d ( me : mutable ),
1537         SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1538         SetViewOff from class Viewer from V3d ( me : mutable ),
1539         SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )
1540
1541 end View;