0025611: Displaying 'zbufftrihedron' interferes with 'graduatedtrihedron':
[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_Handle                     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_Handle                  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                               theTrigedronData: out GraduatedTrihedron from Graphic3d)
463         ---Purpose: Returns data of a graduated trihedron.
464         is static;
465
466         GraduatedTrihedronDisplay(me : mutable;
467                                   theTrigedronData: in GraduatedTrihedron from Graphic3d)
468         ---Purpose: Displays a graduated trihedron.
469         is static;
470
471         GraduatedTrihedronErase(me : mutable)
472         ---Purpose: Erases a graduated trihedron from the view.
473         is static;
474
475         ---------------------------------------------------
476         --           Color Scale methods
477         ---------------------------------------------------
478
479         SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
480
481         ColorScaleDisplay(me : mutable);
482
483         ColorScaleErase(me : mutable);
484
485         ColorScaleIsDisplayed(me)
486         returns Boolean from Standard;
487
488         ColorScale(me)
489         returns ColorScale from Aspect;
490
491         --------------------------------------------------------
492         ---Category: Methods to modify the Projection of the view
493         --------------------------------------------------------
494
495         SetFront(me: mutable);
496         ---Level: Public
497         ---Purpose: modify the Projection of the view perpendicularly to
498         --          the privileged plane of the viewer.
499
500         Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
501                                 Start    : Boolean = Standard_True )
502         ---Level: Public
503         ---Purpose: Rotates the eye about the coordinate system of
504         --          reference of the screen
505         --          for which the origin is the view point of the projection,
506         --          with a relative angular value in RADIANS with respect to
507         --          the initial position expressed by Start = Standard_True
508         raises BadValue from V3d;
509         ---Purpose:  Warning! raises BadValue from V3d
510         --      If the eye, the view point, or the high point are
511         --          aligned or confused.
512
513         Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
514                                 X,Y,Z    : Coordinate ;
515                                 Start    : Boolean = Standard_True )
516         ---Level: Public
517         ---Purpose: Rotates the eye about the coordinate system of
518         --          reference of the screen
519         --          for which the origin is Gravity point {X,Y,Z},
520         --          with a relative angular value in RADIANS with respect to
521         --          the initial position expressed by Start = Standard_True
522                 raises BadValue from V3d;
523         ---Purpose:      If the eye, the view point, or the high point are
524         --          aligned or confused.
525
526         Rotate ( me : mutable ; Axe      : TypeOfAxe ; Angle : PlaneAngle ;
527                                 X,Y,Z    : Coordinate ;
528                                 Start    : Boolean = Standard_True );
529         ---Level: Public
530         ---Purpose: Rotates the eye about one of the coordinate axes of
531         --          of the view for which the origin is the Gravity point{X,Y,Z}
532         --          with an relative angular value in RADIANS with
533         --          respect to the initial position expressed by
534         --          Start = Standard_True
535
536         Rotate ( me : mutable ; Axe    : TypeOfAxe ; Angle : PlaneAngle ;
537                                 Start : Boolean = Standard_True ) ;
538         ---Level: Public
539         ---Purpose: Rotates the eye about one of the coordinate axes of
540         --          of the view for which the origin is the view point of the
541         --          projection with an relative angular value in RADIANS with
542         --          respect to the initial position expressed by
543         --          Start = Standard_True
544
545         Rotate ( me : mutable ; Angle : PlaneAngle ;
546                                 Start : Boolean = Standard_True );
547         ---Level: Public
548         ---Purpose: Rotates the eye around the current axis a relative
549         --          angular value in RADIANS with respect to the initial
550         --          position expressed by Start = Standard_True
551
552         Move ( me : mutable ; Dx,Dy,Dz : Length ;
553                               Start    : Boolean = Standard_True )
554         ---Level: Public
555         ---Purpose: Movement of the eye parallel to the coordinate system
556         --          of reference of the screen a distance relative to the
557         --          initial position expressed by Start = Standard_True.
558                 raises BadValue from V3d;
559         --      If the eye, the view point, or the high point are
560         --      aligned or confused.
561
562         Move ( me : mutable ; Axe   : TypeOfAxe ; Length : Length ;
563                               Start : Boolean = Standard_True )
564         ---Level: Public
565         ---Purpose: Movement of the eye parallel to one of the axes of the
566         --          coordinate system of reference of the view a distance
567         --          relative to the initial position expressed by
568         --          Start = Standard_True.
569                 raises BadValue from V3d;
570         --      If the eye, view point, or high point are aligned or confused.
571
572         Move ( me : mutable ; Length : Length ;
573                               Start  : Boolean = Standard_True )
574         ---Level: Public
575         ---Purpose: Movement of the eye parllel to the current axis
576         --          a distance relative to the initial position
577         --          expressed by Start = Standard_True
578                 raises BadValue from V3d;
579         --      If the eye, view point, or high point are aligned or confused.
580
581         Translate ( me : mutable ; Dx,Dy,Dz : Length ;
582                                    Start    : Boolean = Standard_True )
583         ---Level: Public
584         ---Purpose: Movement of the ye and the view point parallel to the
585         --          frame of reference of the screen a distance relative
586         --          to the initial position expressed by
587         --          Start = Standard_True
588                 raises BadValue from V3d;
589         --      If the eye, view point, or high point are aligned or confused.
590
591         Translate ( me : mutable ; Axe   : TypeOfAxe ; Length : Length ;
592                                    Start : Boolean = Standard_True );
593         ---Level: Public
594         ---Purpose: Movement of the eye and the view point parallel to one
595         --          of the axes of the fame of reference of the view a
596         --          distance relative to the initial position
597         --          expressed by Start = Standard_True
598
599         Translate ( me : mutable ; Length : Length ;
600                                    Start  : Boolean = Standard_True );
601         ---Level: Public
602         ---Purpose: Movement of the eye and view point parallel to
603         --          the current axis a distance relative to the initial
604         --          position expressed by Start = Standard_True
605
606         Place (me            : mutable;
607                theXp         : Integer from Standard;
608                theYp         : Integer from Standard;
609                theZoomFactor : Factor from Quantity = 1)
610         ---Level: Public
611         ---Purpose: places the point of the view corresponding
612         --          at the pixel position x,y at the center of the window
613         --          and updates the view.
614         is static;
615
616         Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
617                               Start    : Boolean = Standard_True )
618         ---Level: Public
619         ---Purpose: Rotation of the view point around the frame of reference
620         --          of the screen for which the origin is the eye of the
621         --          projection with a relative angular value in RADIANS
622         --          with respect to the initial position expressed by
623         --          Start = Standard_True
624                 raises BadValue from V3d;
625         --      If the eye, view point, or high point are aligned or confused.
626
627         Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
628                               Start : Boolean = Standard_True )
629        ;
630         ---Level: Public
631         ---Purpose: Rotation of the view point around one of the axes of the
632         --          frame of reference of the view for which the origin is
633         --          the eye of the projection with an angular value in
634         --          RADIANS relative to the initial position expressed by
635         --          Start = Standard_True
636
637         Turn ( me : mutable ; Angle : PlaneAngle ;
638                               Start : Boolean = Standard_True );
639         ---Level: Public
640         ---Purpose: Rotation of the view point around the current axis an
641         --          angular value in RADIANS relative to the initial
642         --          position expressed by Start = Standard_True
643
644         SetTwist ( me : mutable ; Angle : PlaneAngle )
645         ---Level: Public
646         ---Purpose: Defines the angular position of the high point of
647         --          the reference frame of the view with respect to the
648         --          Y screen axis with an absolute angular value in
649         --          RADIANS.
650                 raises BadValue from V3d;
651         --      If the eye, view point, or high point are aligned or confused.
652
653         SetEye( me : mutable ; X,Y,Z : Coordinate )
654         ---Level: Public
655         ---Purpose: Defines the position of the eye..
656                 raises BadValue from V3d ;
657         --      If the eye, view point, or high point are aligned or confused.
658
659         SetDepth( me : mutable ; Depth : Length )
660         ---Level: Public
661         ---Purpose: Defines the Depth of the eye from the view point
662         --          without update the projection .
663                 raises BadValue from V3d ;
664         --      If the Depth is <= 0.
665
666         SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
667         ---Level: Public
668         ---Purpose: Defines the orientation of the projection.
669                 raises BadValue from V3d ;
670         --      If the eye, view point, or high point are aligned or confused.
671
672         SetProj( me : mutable ; Orientation : TypeOfOrientation )
673         ---Level: Public
674         ---Purpose: Defines the orientation of the projection .
675                 raises BadValue from V3d ;
676         --      If the eye, view point, or high point are aligned or confused.
677         --          Updates the view
678
679         SetAt( me : mutable ; X,Y,Z : Coordinate )
680         ---Level: Public
681         ---Purpose: Defines the position of the view point.
682                 raises BadValue from V3d ;
683         --      If the eye, view point, or high point are aligned or confused.
684
685         SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
686         ---Level: Public
687         ---Purpose: Defines the orientation of the high point.
688                 raises BadValue from V3d ;
689         --      If the eye, view point, or high point are aligned or confused.
690
691         SetUp( me : mutable ; Orientation : TypeOfOrientation )
692         ---Level: Public
693         ---Purpose: Defines the orientation(SO) of the high point.
694                 raises BadValue from V3d ;
695         --      If the eye, view point, or high point are aligned or confused.
696
697         SetViewOrientationDefault( me : mutable );
698         ---Level: Public
699         ---Purpose: Saves the current state of the orientation of the view
700         --          which will be the return state at ResetViewOrientation.
701
702         ResetViewOrientation ( me : mutable );
703         ---Level: Public
704         ---Purpose: Resets the orientation of the view.
705         --          Updates the view
706
707         --------------------------------------------------------
708         ---Category: Methods to modify the Mapping of the view
709         --------------------------------------------------------
710
711         Panning (me            : mutable;
712                  theDXv        : Real from Standard;
713                  theDYv        : Real from Standard;
714                  theZoomFactor : Factor from Quantity = 1;
715                  theToStart    : Boolean = Standard_True);
716         ---Level: Public
717         ---Purpose: Translates the center of the view along "x" and "y" axes of
718         -- view projection. Can be used to perform interactive panning operation.
719         -- In that case the DXv, DXy parameters specify panning relative to the
720         -- point where the operation is started.
721         -- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
722         -- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
723         -- @param theZoomFactor [in] the zooming factor.
724         -- @param theToStart [in] pass TRUE when starting panning to remember view
725         -- state prior to panning for relative arguments. If panning is started,
726         -- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
727         -- Performs update of view.
728
729         SetCenter (me : mutable; theXp, theYp : Integer from Standard)
730         ---Level: Public
731         ---Purpose: Relocates center of screen to the point, determined by
732         -- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
733         -- screen. To calculate pixel coordinates for any point from world
734         -- coordinate space, it can be projected using "Project".
735         -- @param theXp [in] the x coordinate.
736         -- @param theYp [in] the y coordinate.
737         raises BadValue from V3d;
738         -- If one of the dimensions of the projection is NULL.
739
740         SetSize ( me : mutable; theSize : Length )
741         ---Level: Public
742         ---Purpose: Defines the view projection size in its maximum dimension,
743         --          keeping the inital height/width ratio unchanged.
744                 raises BadValue from V3d;
745         --      If <theSize> is <= 0.0
746
747         SetZSize ( me : mutable ; Size : Length )
748         ---Level: Public
749         ---Purpose: Defines the Depth size of the view
750         --          Front Plane will be set to Size/2.
751         --          Back  Plane will be set to -Size/2.
752         --          Any Object located Above the Front Plane or
753         --                             behind the Back Plane will be Clipped .
754         --          NOTE than the XY Size of the View is NOT modified .
755                 raises BadValue from V3d ;
756         --      If the size of the view is <= 0
757
758         SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
759         ---Level: Public
760         ---Purpose: Zooms the view by a factor relative to the initial
761         --          value expressed by Start = Standard_True
762         --          Updates the view.
763                 raises BadValue from V3d ;
764         --      If the zoom coefficient is <= 0
765
766         SetScale ( me : mutable ; Coef : Factor )
767         ---Level: Public
768         ---Purpose: Zooms the view by a factor relative to the value
769         --          initialised by SetViewMappingDefault().
770         --          Updates the view.
771                 raises BadValue from V3d ;
772         --      If the zoom coefficient is <= 0
773
774     SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
775         ---Level: Public
776         ---Purpose: Sets  anisotropic (axial)  scale  factors  <Sx>, <Sy>, <Sz>  for  view <me>.
777     -- Anisotropic  scaling  operation  is  performed  through  multiplying
778     -- the current view  orientation  matrix  by  a  scaling  matrix:
779     -- || Sx  0   0   0 ||
780     -- || 0   Sy  0   0 ||
781     -- || 0   0   Sz  0 ||
782     -- || 0   0   0   1 ||
783         -- Updates the view.
784                 raises BadValue from V3d ;
785         --      If the one of factors <= 0
786
787         FitAll (me : mutable;
788                 theMargin : Coefficient = 0.01;
789                 theToUpdate : Boolean from Standard = Standard_True);
790         ---Level: Public
791         ---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
792         --          The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
793         --          Throws program error exception if margin coefficient is < 0 or >= 1.
794         --          Updates the view.
795         --          @param theMargin [in] the margin coefficient for view borders.
796         --          @param theToUpdate [in] flag to perform view update.
797
798         DepthFitAll( me : mutable ;   Aspect : Coefficient = 0.01;
799                                       Margin : Coefficient = 0.01 );
800         ---Level: Public
801         ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
802         --          and back clipping planes. Also sets depth value automatically depending on the
803         --          calculated Z size and Aspect parameter.
804         --          NOTE than the original XY size of the view is NOT modified .
805
806         FitAll (me : mutable;
807                 theMinXv : Real from Standard;
808                 theMinYv : Real from Standard;
809                 theMaxXv : Real from Standard;
810                 theMaxYv : Real from Standard)
811         ---Level: Public
812         ---Purpose: Centers the defined projection window so that it occupies
813         --          the maximum space while respecting the initial
814         --          height/width ratio.
815         --          NOTE than the original Z size of the view is NOT modified .
816                 raises BadValue from V3d;
817         --              If the defined projection window has zero size.
818
819         WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
820         ---Level: Public
821         ---Purpose: Centers the defined PIXEL window so that it occupies
822         -- the maximum space while respecting the initial height/width ratio.
823         -- NOTE than the original Z size of the view is NOT modified.
824         -- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
825         -- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
826         -- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
827         -- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
828         is static;
829         SetViewMappingDefault( me : mutable );
830         ---Level: Public
831         ---Purpose: Saves the current view mapping. This will be the
832         --          state returned from ResetViewmapping.
833
834         ResetViewMapping ( me : mutable );
835         ---Level: Public
836         ---Purpose: Resets the centering of the view.
837         --          Updates the view
838
839         Reset ( me : mutable; update : Boolean from Standard = Standard_True );
840         ---Level: Public
841         ---Purpose: Resets the centering and the orientation of the view
842         --          Updates the view
843         ---------------------------------------------------
844         ---Category: Inquire methods
845         ---------------------------------------------------
846
847         Convert( me ; Vp : Integer ) returns Length
848         ---Level: Public
849         ---Purpose : Converts the PIXEL value
850         --           to a value in the projection plane.
851         raises UnMapped from V3d;
852         --      If the view is not mapped on the window.
853
854         Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
855         ---Level: Public
856         ---Purpose : Converts the point PIXEL into a point projected
857         --           in the reference frame of the projection plane.
858         raises UnMapped from V3d;
859         --      If the view is not mapped on the window.
860
861         Convert( me ; Vv : Length ) returns Integer
862         ---Level: Public
863         ---Purpose : Converts tha value of the projection plane into
864         --           a PIXEL value.
865         raises UnMapped from V3d;
866         --      If the view is not mapped on the window.
867
868         Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
869         ---Level: Public
870         ---Purpose : Converts the point defined in the reference frame
871         --           of the projection plane into a point PIXEL.
872         raises UnMapped from V3d;
873         --      If the view is not mapped on the window.
874
875         Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
876         ---Level: Public
877         ---Purpose : Converts the projected point into a point
878         --           in the reference frame of the view corresponding
879         --           to the intersection with the projection plane
880         --           of the eye/view point vector.
881         raises UnMapped from V3d;
882         --      If the view is not mapped on the window.
883
884         ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
885         ---Level: Public
886         ---Purpose : Converts the projected point into a point
887         --           in the reference frame of the view corresponding
888         --           to the intersection with the projection plane
889         --           of the eye/view point vector and returns the
890         --           projection ray for further computations.
891         raises UnMapped from V3d;
892         --      If the view is not mapped on the window.
893
894         ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
895         ---Level: Public
896         ---Purpose : Converts the projected point into the nearest grid point
897         --           in the reference frame of the view corresponding
898         --           to the intersection with the projection plane
899         --           of the eye/view point vector and display the grid marker.
900     --  Warning: When the grid is not active the result is identical to the above Convert() method.
901     -- How to use:
902     -- 1) Enable the grid echo display
903     --    myViewer->SetGridEcho(Standard_True);
904     -- 2) When application receive a move event:
905     --   2.1) Check if any object is detected
906     --     if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
907     --   2.2) Check if the grid is active
908         --     if( myViewer->Grid()->IsActive() ) {
909     --   2.3) Display the grid echo and gets the grid point
910         --       myView->ConvertToGrid(x,y,X,Y,Z);
911         --       myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z));
912         --       myView->RedrawImmediate();
913     --   2.4) Else this is the standard case
914         --     } else myView->Convert(x,y,X,Y,Z);
915         raises UnMapped from V3d;
916         --      If the view is not mapped on the window.
917
918         ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
919         ---Level: Public
920         ---Purpose : Converts the point into the nearest grid point
921         --           and display the grid marker.
922     ---Warning: When the grid is not active the result is identical
923     --     to the previous point.
924         raises UnMapped from V3d;
925         --      If the view is not mapped on the window.
926
927         Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
928         ---Level: Public
929         ---Purpose : Projects the point defined in the reference frame of
930         --           the view into the projected point in the associated window.
931
932 --        RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
933 --        ---Purpose : Projects the point defined in the reference frame of
934 --        --           the view into the projected point in the associated window.
935 --  Obsolete : Use Convert(X,Y,Z,Xp,Yp);
936
937 --        PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
938 --        ---Purpose : Converts the projected point in the associated window of
939 --        --           the view into the point defined in the reference frame.
940 --  Obsolete : Use Convert(Xp,Yp,X,Y,Z);
941
942         Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
943         ---Level: Public
944         ---Purpose : Converts the point defined in the user space of
945         --           the view to the projected view plane point at z 0.
946
947         BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
948         ---Level: Public
949         ---Purpose: Returns the Background color values of the view
950         --          depending of the color Type.
951
952         BackgroundColor( me ) returns Color from Quantity;
953         ---Level: Public
954         ---Purpose: Returns the Background color object of the view.
955
956         GradientBackgroundColors( me;
957                                   Color1 : out Color from Quantity;
958                                   Color2 : out Color from Quantity) ;
959         ---Level: Public
960         ---Purpose: Returns the gradient background colour objects of the view.
961
962         GradientBackground ( me ) returns GradientBackground from Aspect;
963         ---Level: Public
964         ---Purpose: Returns the gradient background of the view.
965
966         Scale ( me ) returns Factor ;
967         ---Level: Public
968         ---Purpose: Returns the current value of the zoom expressed with
969         --          respect to SetViewMappingDefault().
970
971     AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
972         ---Level: Public
973         ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
974
975         Size ( me; Width, Height : out Length );
976         ---Level: Public
977         ---Purpose: Returns the height and width of the view.
978
979         ZSize ( me ) returns Real ;
980         ---Level: Public
981         ---Purpose: Returns the Depth of the view .
982
983         Eye( me ; X,Y,Z : out Coordinate );
984         ---Level: Public
985         ---Purpose: Returns the position of the eye.
986
987         FocalReferencePoint (me ; X,Y,Z : out Coordinate );
988         ---Level: Public
989         ---Purpose: Returns the position of point which emanating the
990         --          projections.
991
992         ProjReferenceAxe( me ; Xpix,Ypix           : Integer ;
993                                XP,YP,ZP,VX,VY,VZ   : out Coordinate );
994         ---Level: Public
995         ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
996         --          in the view (XP,YP,ZP), and the projection vector of the
997         --          view passing by the point (for PerspectiveView).
998
999         Depth( me ) returns Length ;
1000         ---Level: Public
1001         ---Purpose: Returns the Distance between the Eye and View Point.
1002
1003         Proj( me ; Vx,Vy,Vz : out Parameter );
1004         ---Level: Public
1005         ---Purpose: Returns the projection vector.
1006
1007         At( me ; X,Y,Z : out Coordinate );
1008         ---Level: Public
1009         ---Purpose: Returns the position of the view point.
1010
1011         Up( me ; Vx,Vy,Vz : out Parameter );
1012         ---Level: Public
1013         ---Purpose: Returns the vector giving the position of the high point.
1014
1015         Twist( me ) returns PlaneAngle ;
1016         ---Level: Public
1017         ---Purpose: Returns in RADIANS the orientation of the view around
1018         --          the visual axis measured from the Y axis of the screen.
1019
1020         ShadingModel ( me ) returns TypeOfShadingModel ;
1021         ---Level: Public
1022         ---Purpose: Returns the current shading model.
1023
1024         SurfaceDetail(me) returns  TypeOfSurfaceDetail;
1025         ---Level: Public
1026         -- purpose: returns the current SurfaceDetail mode
1027
1028         TextureEnv(me)  returns  TextureEnv  from  Graphic3d;
1029         ---Level: Public
1030         -- purpose: return the current environment texture used
1031
1032         Visualization ( me ) returns TypeOfVisualization from V3d;
1033         ---Level: Public
1034         ---Purpose: Returns the current visualisation mode.
1035
1036         Antialiasing ( me ) returns Boolean;
1037         ---Level: Public
1038         ---Purpose: Indicates if the antialiasing is active (True) or
1039         --          inactive (False).
1040
1041         ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1042         ---Level: Public
1043         ---Purpose: Returns activity and information on the Zcueing.
1044         --          <Depth> : Depth of plane.
1045         --          <Width> : Thickness around the plane.
1046
1047         ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1048         ---Level: Public
1049         ---Purpose: Returns current information on the ZClipping.
1050         --          <Depth> : Depth of plane.
1051         --          <Width> : Thickness around the plane.
1052         --          <TypeOfZclipping>  :        "BACK"
1053         --                                      "FRONT"
1054         --                                      "SLICE"
1055         --                                      "OFF"
1056
1057         IfMoreLights( me ) returns Boolean;
1058         ---Level: Advanced
1059         ---Purpose: Returns True if One light more can be
1060         --          activated in this View.
1061
1062         InitActiveLights(me: mutable);
1063         ---Level: Advanced
1064         ---Purpose: initializes an iteration on the active Lights.
1065
1066         MoreActiveLights (me) returns Boolean from Standard;
1067         ---Level: Advanced
1068         ---Purpose: returns true if there are more active Light(s) to return.
1069
1070         NextActiveLights (me: mutable);
1071         ---Level: Advanced
1072         ---Purpose : Go to the next active Light
1073         --           (if there is not, ActiveLight will raise an exception)
1074
1075         ActiveLight(me) returns Light from V3d;
1076         ---Level: Advanced
1077
1078         Viewer ( me ) returns Viewer from V3d;
1079         ---Level: Advanced
1080         ---Purpose: Returns the viewer in which the view has been created.
1081
1082         IfWindow ( me ) returns Boolean;
1083         ---Level: Public
1084         ---Purpose: Returns True if MyView is associated with a window .
1085
1086         Window ( me ) returns Window from Aspect
1087         ---Level: Public
1088         ---Purpose: Returns the Aspect Window associated with the view.
1089                 raises BadValue from V3d;
1090         --      If MyView is not associated with a window
1091
1092         Type( me ) returns TypeOfView from V3d;
1093         ---Level: Public
1094         ---Purpose: Returns the Type of the View
1095
1096         Pan (me            : mutable;
1097              theDXp        : Integer from Standard;
1098              theDYp        : Integer from Standard;
1099              theZoomFactor : Factor from Quantity = 1;
1100              theToStart    : Boolean = Standard_True);
1101         ---Level: Public
1102         ---Purpose: Translates the center of the view along "x" and "y" axes of
1103         -- view projection. Can be used to perform interactive panning operation.
1104         -- In that case the DXp, DXp parameters specify panning relative to the
1105         -- point where the operation is started.
1106         -- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
1107         -- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
1108         -- @param theZoomFactor [in] the zooming factor.
1109         -- @param theToStart [in] pass TRUE when starting panning to remember view
1110         -- state prior to panning for relative arguments. Passing 0 for relative
1111         -- panning parameter should return view panning to initial state.
1112         -- Performs update of view.
1113
1114         Zoom (me     : mutable;
1115               theXp1 : Integer from Standard;
1116               theYp1 : Integer from Standard;
1117               theXp2 : Integer from Standard;
1118               theYp2 : Integer from Standard)
1119         is static;
1120         ---Level: Public
1121         ---Purpose: Zoom the view according to a zoom factor computed
1122         -- from the distance between the 2 mouse position.
1123         -- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
1124         -- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
1125         -- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
1126         -- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
1127
1128         StartZoomAtPoint (me    : mutable;
1129                           theXp : Integer from Standard;
1130                           theYp : Integer from Standard);
1131         ---Level: Public
1132         ---Purpose: Defines starting point for ZoomAtPoint view operation.
1133         -- @param theXp [in] the x mouse coordinate, in pixels.
1134         -- @param theYp [in] the y mouse coordinate, in pixels.
1135
1136         ZoomAtPoint(me : mutable;
1137                     theMouseStartX : Integer from Standard;
1138                     theMouseStartY : Integer from Standard;
1139                     theMouseEndX   : Integer from Standard;
1140                     theMouseEndY   : Integer from Standard);
1141         ---Level: Public
1142         ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1143
1144         AxialScale  ( me: mutable; Dx, Dy: Integer from Standard;  Axis:  TypeOfAxe  from  V3d );
1145         ---Level: Public
1146         ---Purpose: Performs  anisotropic scaling  of  <me>  view  along  the  given  <Axis>.
1147             -- The  scale  factor  is  calculated on a basis of
1148             -- the mouse pointer displacement <Dx,Dy>.
1149         -- The  calculated  scale  factor  is  then  passed  to  SetAxialScale(Sx,  Sy,  Sz)  method.
1150
1151         StartRotation(me : mutable ; X,Y :Integer from Standard;
1152                zRotationThreshold: Ratio from Quantity = 0.0);
1153         ---Level: Public
1154     ---Purpose: Begin the rotation of the view around the screen axis
1155     -- according to the mouse position <X,Y>.
1156     --  Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1157     -- factor is > 0 soon the distance from the start point and the center
1158     -- of the view is > (medium viewSize * <zRotationThreshold> ).
1159     -- Generally a value of 0.4 is usable to rotate around XY screen axis
1160     -- inside the circular threshold area and to rotate around Z screen axis
1161     -- outside this area.
1162
1163         Rotation(me:mutable;  X,Y :Integer from Standard);
1164         ---Level: Public
1165     ---Purpose: Continues the rotation of the view
1166     -- with an angle computed from the last and new mouse position <X,Y>.
1167
1168         FitAll ( me : mutable ; aWindow: Window from Aspect;
1169                       Umin, Vmin, Umax, Vmax : Coordinate )
1170         is static private;
1171         ---Level: Public
1172     ---Purpose: Change the scale factor and position of the view
1173     -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1174     -- in the view.
1175
1176
1177         -----------------------------------------
1178         ---Category: Private or Protected methods
1179         -----------------------------------------
1180
1181         SetFocale( me : mutable ; Focale : Length )
1182         ---Purpose: Change View Plane Distance for Perspective Views
1183         raises TypeMismatch from Standard
1184         ---Purpose:  Warning! raises TypeMismatch from Standard if the view
1185         --          is not a perspective view.
1186         is static ;
1187
1188         Focale( me ) returns Length;
1189         ---Purpose: Returns the View Plane Distance for Perspective Views
1190
1191         View ( me) returns View from Visual3d is static ;
1192         ---Level: Advanced
1193         ---Purpose: Returns the associated Visual3d view.
1194
1195         ScreenAxis( myclass ; Vpn,Vup        : Dir from gp ;
1196                               Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1197                                         returns Boolean is private ;
1198         ---Purpose: Determines the screen axes in the reference
1199         --          framework of the view.
1200
1201
1202         TrsPoint( myclass ; V : Vertex from Graphic3d ;
1203                                 Matrix : Array2OfReal from TColStd )
1204                                 returns Vertex from Graphic3d is private ;
1205         ---Purpose: Transforms the Vertex V according to the matrice Matrix .
1206         
1207         ImmediateUpdate (me) is static protected;
1208           ---Purpose: 
1209
1210         SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1211         is static;
1212         ---Level: Advanced
1213         ---Purpose: Switches computed HLR mode in the view
1214         ---Category: Methods to modify the class definition
1215
1216         ComputedMode ( me )
1217         returns Boolean from Standard
1218         is static;
1219         ---Level: Advanced
1220         ---Purpose: Returns the computed HLR mode state
1221         ---Category: Inquire methods
1222
1223         MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1224         ---Purpose: Returns the objects number and the projection window
1225         --          of the objects contained in the view.
1226         is static private;
1227
1228         MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1229         returns Integer
1230         ---Purpose: Returns the objects number and the box encompassing
1231         --          the objects contained in the view
1232         is static private;
1233
1234         Gravity ( me; X,Y,Z : out Coordinate )
1235         ---Purpose: Returns the Objects number and the gravity center
1236         --          of ALL viewable points in the view
1237         is static private;
1238
1239         Init(me: mutable) is private;
1240
1241         ---Category: for compatibility.
1242
1243         WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1244         ---Purpose: idem than WindowFit
1245
1246         Compute ( me; AVertex   : Vertex from Graphic3d )
1247                 returns Vertex from Graphic3d
1248                 is static private;
1249         ---Level: Internal
1250         ---Purpose: Returns a new vertex when the grid is activated.
1251
1252         SetGrid ( me    : mutable;
1253                   aPlane: Ax3 from gp;
1254                   aGrid : Grid from Aspect )
1255                 is static;
1256         ---Level: Internal
1257         ---Purpose: Defines or Updates the definition of the
1258         --          grid in <me>
1259         ---Category: Methods to modify the class definition
1260
1261         SetGridGraphicValues ( me       : mutable;
1262                                aGrid    : Grid from Aspect )
1263                 is static;
1264         ---Level: Internal
1265         ---Purpose: Defines or Updates the graphic definition of the
1266         --          grid in <me>
1267         ---Category: Methods to modify the class definition
1268
1269         SetGridActivity ( me    : mutable;
1270                           aFlag : Boolean from Standard )
1271                 is static;
1272         ---Level: Internal
1273         ---Purpose: Defines or Updates the activity of the
1274         --          grid in <me>
1275         ---Category: Methods to modify the class definition
1276
1277         Dump ( me: mutable;
1278                theFile       : CString from Standard;
1279                theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1280     returns Boolean from Standard;
1281         ---Level: Public
1282         ---Purpose: dump the full contents of the view at the same
1283         --          scale in the file <theFile>. The file name
1284         --          extension must be one of ".png",".bmp",".jpg",".gif".
1285         --          Returns FALSE when the dump has failed
1286
1287       Print (me; hPrnDC: Handle from Aspect = 0;
1288              showDialog: Boolean = Standard_True;
1289              showBackground : Boolean = Standard_True;
1290              filename: CString = NULL;
1291              printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1292       returns Boolean from Standard is static;
1293
1294         ---Level: Public
1295         ---Purpose: print the contents of the view to printer with preview.
1296     -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1297     -- then you can pass it to the print routines.
1298         -- If you don't have an PrinterDeviceContext, then this parameter should
1299     -- be NULL.
1300     -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1301     -- open a Print Dialog box.
1302         -- If you want to do this, then set showDialog to TRUE
1303         -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1304     -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1305     -- <showBackground> : When set to FALSE then print the view without background color
1306     -- (background is white)
1307         -- else set to TRUE for printing with current background color.
1308     -- <filename>: If != NULL, then the view will be printed to a file.
1309     -- <printAlgorithm>: If you want to select the print algorithm, then you can
1310         -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1311     -- Returns Standard_True if the data is passed to the printer, otherwise
1312     -- Standard_False if the print operation failed. This might be related to
1313     -- insufficient memory or some internal errors. All this errors are
1314     -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1315     --  Warning: This function can reuse FBO assigned to the 
1316     --  view on level of OpenGl_GraphicDriver; Please take it into account if
1317     --  you use it for your purposes;
1318     --  Warning: Works only under Windows.
1319
1320         ToPixMap (me : mutable;
1321                   theImage  : in out PixMap from Image;
1322                   theWidth  : Integer from Standard;
1323                   theHeight : Integer from Standard;
1324                   theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1325                   theToKeepAspect : Boolean from Standard = Standard_True;
1326                   theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
1327         returns Boolean from Standard;
1328         ---Level   : Public
1329         ---Purpose : Dumps the full contents of the view
1330         --           to a pixmap of pixel size <theWidth> * <theHeight> and
1331         --           buffer type <theBufferType>. If <theToKeepAspect> is true
1332         --           the aspect ratio of view will be kept if <theWidth> and <theHeight>
1333         --           define another ratio.
1334         --           Pixmap will be automatically (re)allocated when needed.
1335         --           When dumping stereographic camera - the corresponding
1336         --           middle-point monographic projection will be used for dumping by default.
1337         --           <theStereoOptions> flags are to be used for dumping then left or
1338         --           right eye projections.
1339
1340         SetBackFacingModel ( me     : mutable;
1341             aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1342             is static;
1343          ---Level   : Public
1344          ---Purpose : Manages display of the back faces
1345      -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1346      -- are displayed only for surface objects and
1347      -- never displayed for solid objects.
1348      -- this was the previous mode.
1349      --      <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1350      --       are always displayed both for surfaces or solids.
1351      --      <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1352      --       are never displayed.
1353
1354         BackFacingModel ( me )
1355             returns TypeOfBackfacingModel from V3d
1356         is static;
1357          ---Level   : Public
1358          ---Purpose : Returns current state of the back faces display
1359
1360         EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1361         is static;
1362      ---Level: Public
1363      ---Purpose: turns on/off opengl depth testing
1364
1365         IsDepthTestEnabled( me ) returns Boolean from Standard
1366         is static;
1367      ---Level: Public
1368      ---Purpose: returns the current state of the depth testing
1369
1370         EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1371         is static;
1372      ---Level: Public
1373      ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1374
1375         IsGLLightEnabled( me ) returns Boolean from Standard
1376         is static;
1377      ---Level: Public
1378      ---Purpose: returns the current state of the gl lighting
1379      --          currently used in triedron displaying
1380
1381      AddClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1382      ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
1383      -- rendering space to convex volume. Number of supported clip planes can be consulted
1384      -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
1385      -- which exceed the limit are ignored during rendering. 
1386      -- @param thePlane [in] the clip plane to be added to view.
1387
1388      RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1389      ---Purpose: Removes clip plane from the view.
1390      -- @param thePlane [in] the clip plane to be removed from view.
1391
1392      SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
1393      ---Purpose: Sets sequence of clip planes to the view. The planes that have been set
1394      -- before are removed from the view. The composition of clip planes
1395      -- truncates the rendering space to convex volume. Number of supported
1396      -- clip planes can be consulted by PlaneLimit method of associated
1397      -- Visual3d_View. Please be aware that the planes which exceed the limit
1398      -- are ignored during rendering. 
1399      -- @param thePlanes [in] the clip planes to set.
1400
1401      GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
1402      ---C++: return const&
1403      ---Purpose: Get clip planes.
1404      -- @return sequence clip planes that have been set for the view
1405
1406     SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
1407     ---Level: Public
1408     ---Purpose: Change camera used by view.
1409
1410     Camera (me) returns Camera_Handle from Graphic3d is static;
1411     ---Level: Public
1412     ---C++: return const&
1413     ---Purpose: Returns camera object of the view.
1414     -- @return: handle to camera object, or NULL if 3D view does not use
1415     -- the camera approach.
1416
1417     FitMinMax (me;
1418                theCamera          : Camera_Handle from Graphic3d;
1419                theBox             : Box from Bnd;
1420                theMargin          : Real from Standard;
1421                theResolution      : Real from Standard = 0.0;
1422                theToEnlargeIfLine : Boolean from Standard = Standard_True)
1423                returns Boolean from Standard is protected;
1424     ---Level: Protected
1425     ---Purpose: Transform camera eye, center and scale to fit in the
1426     -- passed bounding box specified in WCS.
1427     -- @param theCamera [in] the camera.
1428     -- @param theBox [in] the bounding box.
1429     -- @param theMargin [in] the margin coefficient for view borders.
1430     -- @param theResolution [in] the minimum size of projection of
1431     --        bounding box in Xv or Yv direction when it considered to
1432     --        be a thin plane or point (without a volume).
1433     --        In this case only the center of camera is adjusted.
1434     -- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
1435     -- whole bounding box projected into thin line going along
1436     -- Z-axis of screen, the view plane is enlarged such that
1437     -- we see the whole line on rotation, otherwise only the
1438     -- center of camera is adjusted.
1439     -- @return TRUE if the fit all operation can be done.
1440
1441     Scale (me;
1442            theCamera : Camera_Handle from Graphic3d;
1443            theSizeXv : Real from Standard;
1444            theSizeYv : Real from Standard) is protected;
1445     ---Level: Protected
1446     ---Purpose: Scales camera to fit the view frame of defined width and height
1447     -- keeping the aspect. For orthogonal camera the method changes scale,
1448     -- for perspective adjusts Eye location about the Center point.
1449     -- @param theSizeXv [in] size of viewport frame on "x" axis.
1450     -- @param theSizeYv [in] size of viewport frame on "y" axis.
1451
1452     Translate (me;
1453          theCamera : Camera_Handle from Graphic3d;
1454          theDXv    : Real from Standard;
1455          theDYv    : Real from Standard) is protected;
1456     ---Level: Protected
1457     -- Purpose: Translates camera eye and center along the view plane.
1458     -- @param theCamera [in] the camera to translate.
1459     -- @param theDXv [in] the translation in "x" direction.
1460     -- @param theDYv [in] the translation in "y" direction.
1461
1462     RenderingParams (me) returns RenderingParams from Graphic3d is static;
1463     ---C++: return const &
1464     ---Level: Public
1465     ---Purpose: Returns current rendering parameters and effect settings.
1466     
1467     ChangeRenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
1468     ---C++: return &
1469     ---Level: Public
1470     ---Purpose: Returns reference to current rendering parameters and effect settings.
1471
1472         IsCullingEnabled (me) returns Boolean from Standard is static;
1473      ---Level: Public
1474      ---Purpose: @return flag value of objects culling mechanism
1475
1476         SetFrustumCulling (me : mutable; theMode : Boolean from Standard) is static;
1477      ---Level: Public
1478      ---Purpose: Turn on/off automatic culling of objects outside frustrum (ON by default)
1479
1480 fields
1481
1482         myOldMouseX : Real is protected;
1483         myOldMouseY : Real is protected;
1484         myCamStartOpUp : Dir from gp is protected;
1485         myCamStartOpEye : Pnt from gp is protected;
1486         myCamStartOpBnd : Real[6] is protected;
1487         myCamStartOpCenter : Pnt from gp is protected;
1488         myCamera : Camera_Handle from Graphic3d is protected;
1489
1490         MyViewer :              ViewerPointer from V3d ;
1491         MyActiveLights:         ListOfTransient from V3d;
1492
1493         MyView :                View from Visual3d is protected ;
1494         MyViewContext :         ContextView from Visual3d ;
1495         MyBackground:           Background from Aspect ;
1496         MyGradientBackground:   GradientBackground from Aspect ;
1497         MyDefaultViewAxis:      Vector from Graphic3d ;
1498         MyDefaultViewPoint:     Vertex from Graphic3d ;
1499
1500         MyWindow:               Window from Aspect;
1501
1502         myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1503
1504         sx,sy: Integer from Standard;
1505         rx,ry: Real from Standard;
1506         gx,gy,gz: Real from Standard;
1507         myComputedMode: Boolean from Standard;
1508         SwitchSetFront: Boolean from Standard;
1509         MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1510
1511         -- the 3d grid
1512         MyGrid                  :       Grid from Aspect;
1513         MyPlane                 :       Ax3 from gp;
1514
1515         --MyColorScale            :       ColorScale from V3d;
1516         MyLayerMgr              :       LayerMgr from V3d;
1517
1518         -- the transformation between XoY and the grid plane
1519         MyTrsf                  :       Array2OfReal from TColStd;
1520
1521         -- echo
1522         MyGridEchoStructure             :       Structure from Graphic3d;
1523         MyGridEchoGroup                 :       Group from Graphic3d;
1524
1525         myImmediateUpdate: Boolean from Standard is protected;
1526
1527         myXscreenAxis           : Vector from Graphic3d;
1528         myYscreenAxis           : Vector from Graphic3d;
1529         myZscreenAxis           : Vector from Graphic3d;
1530         myViewAxis              : Vector from Graphic3d;
1531         myGravityReferencePoint : Vertex from Graphic3d;
1532
1533 friends
1534
1535         SetViewOn from class Viewer from V3d ( me : mutable ),
1536         SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1537         SetViewOff from class Viewer from V3d ( me : mutable ),
1538         SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )
1539
1540 end View;