0024887: Visualization - revise and extend Raytracing controls
[occt.git] / src / V3d / V3d_View.cdl
old mode 100755 (executable)
new mode 100644 (file)
index aa9ceca..5a24af6
@@ -1,22 +1,18 @@
 -- Created on: 1992-01-15
 -- Created by: GG
 -- Copyright (c) 1992-1999 Matra Datavision
--- Copyright (c) 1999-2012 OPEN CASCADE SAS
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
 --
--- The content of this file is subject to the Open CASCADE Technology Public
--- License Version 6.5 (the "License"). You may not use the content of this file
--- except in compliance with the License. Please obtain a copy of the License
--- at http://www.opencascade.org and read it completely before using this file.
+-- This file is part of Open CASCADE Technology software library.
 --
--- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
--- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
 --
--- The Original Code and all software distributed under the License is
--- distributed on an "AS IS" basis, without warranty of any kind, and the
--- Initial Developer hereby disclaims all such warranties, including without
--- limitation, any warranties of merchantability, fitness for a particular
--- purpose or non-infringement. Please see the License for the specific terms
--- and conditions governing the rights and limitations under the License.
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
 
 -- Modified:    FMN - 24/12/97 -> Suppression GEOMLITE
 --              CQO - 24/12/97 -> BUC50037
@@ -77,6 +73,8 @@ class View from V3d inherits TShared from MMgt
 uses
 
         -- S3892
+        Pnt                     from gp,
+        Dir                     from gp,
         Ax3                     from gp,
         LayerMgr                from V3d,
         ColorScale              from V3d,
@@ -99,16 +97,15 @@ uses
         TypeOfZclipping                   from V3d,
         TypeOfProjectionModel             from V3d,
         TypeOfBackfacingModel             from V3d,
+        StereoDumpOptions                 from V3d,
         Viewer                            from V3d,
         Light                             from V3d,
-        Plane                             from V3d,
         View                              from Visual3d,
-        ViewMapping                       from Visual3d,
-        ViewOrientation                   from Visual3d,
         ContextView                       from Visual3d,
         Vector                            from Graphic3d,
         Vertex                            from Graphic3d,
         Plotter                           from Graphic3d,
+        Camera_Handle                     from Graphic3d,
         Window                            from Aspect,
         PixMap                            from Image,
         BufferType                        from Graphic3d,
@@ -126,7 +123,6 @@ uses
         Coordinate                        from V3d,
         Array2OfReal                      from TColStd,
         ViewerPointer                     from V3d,
-        TransientManager                  from Visual3d,
         TypeOfTriedronEcho                from Aspect,
         TypeOfTriedronPosition            from Aspect,
         RenderingContext                  from Aspect,
@@ -136,8 +132,12 @@ uses
         FontAspect                        from Font,
         AsciiString                       from TCollection,
         ExtendedString                    from TCollection,
-        PrintAlgo                         from Aspect
-
+        PrintAlgo                         from Aspect,
+        ClipPlane_Handle                  from Graphic3d,
+        SequenceOfHClipPlane              from Graphic3d,
+        RenderingMode                     from Graphic3d,
+        RenderingParams                   from Graphic3d,
+        XYZ                               from gp
 raises
 
         BadValue from V3d, TypeMismatch from Standard,
@@ -146,10 +146,10 @@ raises
 is
 
         Create ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
-        ---Purpose: Initialises the view.
+        ---Purpose: Initializes the view.
 
-        Create ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
-        ---Purpose: Initialises the view by copying.
+        Create (theVM : mutable Viewer; theView : View from V3d);
+        ---Purpose: Initializes the view by copying.
 
         --------------------------------------------------------
         ---Category: Methods to modify the Status of the view
@@ -206,6 +206,14 @@ is
         --          Must be called if the view is shown.
         --          (Ex: DeIconification ) .
 
+        RedrawImmediate ( me );
+        ---Level: Public
+        ---Purpose: Updates layer of immediate presentations.
+
+        Invalidate ( me );
+        ---Level: Public
+        ---Purpose: Invalidates view content but does not redraw it.
+
         Redraw ( me ;x,y,width,height: Integer from Standard);
         ---Level: Public
         ---Purpose: Redisplays the view area after esxposure.
@@ -392,7 +400,7 @@ is
         ---Level: Public
         ---Purpose: Deactivate all the Lights defined in this view.
 
-    IsActiveLight( me ; aLight: Light  from V3d )
+        IsActiveLight( me ; aLight: Light  from V3d )
         returns Boolean from Standard;
         ---Level: Public
         ---Purpose: Returns TRUE when the light is active in this view.
@@ -401,44 +409,37 @@ is
         ---Level: Public
         ---Purpose: Activate/Deactivate the transparency in this view.
 
-        SetPlaneOn( me : mutable ; MyPlane : Plane from V3d )
-        ---Level: Public
-        ---Purpose: Activates the clipping plane in this view.
-                raises BadValue from V3d ;
-        ---Purpose:      If No More Plane can be activated in MyView .
-
-        SetPlaneOn( me : mutable )
-        ---Level: Public
-        ---Purpose: Activate all the clipping planes defined in
-        --          this view.
-                raises BadValue from V3d;
-        ---Purpose:      If No More Plane can be activated in MyView .
-
-        SetPlaneOff( me : mutable ; MyPlane : Plane  from V3d );
-        ---Level: Public
-        ---Purpose: Desactivates the clipping plane defined
-        --          in this view.
-
-        SetPlaneOff( me : mutable );
-        ---Level: Public
-        ---Purpose: Deactivate all clipping planes defined
-        --          in this view.
-
-    IsActivePlane( me ; aPlane: Plane  from V3d )
-        returns Boolean from Standard;
-        ---Level: Public
-        ---Purpose: Returns TRUE when the plane is active in this view.
-        
         SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
         returns Boolean from Standard;
          ---Purpose: sets the immediate update mode and returns the previous one.
 
+        SetAutoZFitMode (me : mutable;
+                         theIsOn : Boolean;
+                         theScaleFactor : Real from Standard = 1.0);
+          ---Level: public
+          ---Purpose: Sets the automatic z-fit mode and its parameters.
+          --          The auto z-fit has extra parameters which can controlled from application level
+          --          to ensure that the size of viewing volume will be sufficiently large to cover
+          --          the depth of unmanaged objects, for example, transformation persistent ones.
+          --          @param theScaleFactor [in] the scale factor for Z-range.
+          --          The range between Z-min, Z-max projection volume planes
+          --          evaluated by z fitting method will be scaled using this coefficient.
+          --          Program error exception is thrown if negative or zero value
+          --          is passed.
+
+        AutoZFitMode (me) returns Boolean;
+          ---Level: public
+          ---Purpose: returns TRUE if automatic z-fit mode is turned on.
+
+        AutoZFitScaleFactor (me) returns Real from Standard;
+        ---Level: public
+        ---Purpose: returns scale factor parameter of automatic z-fit mode.
 
         ---------------------------------------------------
         --           Triedron methods
         ---------------------------------------------------
 
-    ZBufferTriedronSetup ( me      : mutable;
+        ZBufferTriedronSetup ( me      : mutable;
                            XColor  : NameOfColor from Quantity = Quantity_NOC_RED;
                            YColor  : NameOfColor from Quantity = Quantity_NOC_GREEN;
                            ZColor  : NameOfColor from Quantity = Quantity_NOC_BLUE1;
@@ -726,13 +727,15 @@ is
         --          the current axis a distance relative to the initial
         --          position expressed by Start = Standard_True
 
-         Place (me: mutable; x,y: Integer from Standard;
-                      aZoomFactor: Factor from Quantity = 1)
+        Place (me            : mutable;
+               theXp         : Integer from Standard;
+               theYp         : Integer from Standard;
+               theZoomFactor : Factor from Quantity = 1)
         ---Level: Public
-         ---Purpose: places the point of the view corresponding
-         --          at the pixel position x,y at the center of the window
-         --          and updates the view.
-         is static;
+        ---Purpose: places the point of the view corresponding
+        --          at the pixel position x,y at the center of the window
+        --          and updates the view.
+        is static;
 
         Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
                               Start    : Boolean = Standard_True )
@@ -815,10 +818,6 @@ is
                 raises BadValue from V3d ;
         --      If the eye, view point, or high point are aligned or confused.
 
-    SetViewOrientation ( me : mutable; VO   : ViewOrientation from Visual3d );
-    ---Level: Public
-    ---Purpose: Modifies the orientation of the view.
-
         SetViewOrientationDefault( me : mutable );
         ---Level: Public
         ---Purpose: Saves the current state of the orientation of the view
@@ -833,36 +832,41 @@ is
         ---Category: Methods to modify the Mapping of the view
         --------------------------------------------------------
 
-        Panning ( me : mutable ; Dx , Dy      : Length ;
-                                 aZoomFactor  : Factor from Quantity = 1;
-                                 Start        : Boolean = Standard_True )
-        ---Level: Public
-        ---Purpose:       translates the center of the view and zooms the view.
-        --       Updates the view.
-        raises BadValue from V3d ;
-
-        SetCenter ( me : mutable ; Xc , Yc : Coordinate )
-        ---Level: Public
-        ---Purpose: Defines the centre of the view.
-        --          Updates the view.
-                raises BadValue from V3d ;
-        --      If one of the dimensions of the projection is NULL.
-
-        SetCenter ( me : mutable ; X,Y: Integer from Standard)
-        ---Level: Public
-        ---Purpose: Defines the centre of the view from a pixel position.
-        --          Updates the view.
-                raises BadValue from V3d ;
-        --      If one of the dimensions of the projection is NULL.
+        Panning (me            : mutable;
+                 theDXv        : Real from Standard;
+                 theDYv        : Real from Standard;
+                 theZoomFactor : Factor from Quantity = 1;
+                 theToStart    : Boolean = Standard_True);
+        ---Level: Public
+        ---Purpose: Translates the center of the view along "x" and "y" axes of
+        -- view projection. Can be used to perform interactive panning operation.
+        -- In that case the DXv, DXy parameters specify panning relative to the
+        -- point where the operation is started.
+        -- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
+        -- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
+        -- @param theZoomFactor [in] the zooming factor.
+        -- @param theToStart [in] pass TRUE when starting panning to remember view
+        -- state prior to panning for relative arguments. If panning is started,
+        -- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
+        -- Performs update of view.
+
+        SetCenter (me : mutable; theXp, theYp : Integer from Standard)
+        ---Level: Public
+        ---Purpose: Relocates center of screen to the point, determined by
+        -- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
+        -- screen. To calculate pixel coordinates for any point from world
+        -- coordinate space, it can be projected using "Project".
+        -- @param theXp [in] the x coordinate.
+        -- @param theYp [in] the y coordinate.
+        raises BadValue from V3d;
+        -- If one of the dimensions of the projection is NULL.
 
-        SetSize ( me : mutable ; Size : Length )
+        SetSize ( me : mutable; theSize : Length )
         ---Level: Public
-        ---Purpose: Defines the size of the view while preserving the
-        --          center and height/width ratio of the window supporting
-        --          the view.
-        --          NOTE than the Depth of the View is NOT modified .
-                raises BadValue from V3d ;
-        --      If the size of the view is <= 0
+        ---Purpose: Defines the view projection size in its maximum dimension,
+        --          keeping the inital height/width ratio unchanged.
+                raises BadValue from V3d;
+        --      If <theSize> is <= 0.0
 
         SetZSize ( me : mutable ; Size : Length )
         ---Level: Public
@@ -904,26 +908,34 @@ is
                 raises BadValue from V3d ;
         --      If the one of factors <= 0
 
-        FitAll ( me : mutable ; Coef : Coefficient = 0.01;
-                      FitZ: Boolean from Standard = Standard_False; update : Boolean from Standard = Standard_True )
+        FitAll (me : mutable;
+                theMargin : Coefficient = 0.01;
+                theToUpdate : Boolean from Standard = Standard_True);
         ---Level: Public
-        ---Purpose: Automatic zoom/panning. Objects in the view are visualised
-        --          so as to occupy the maximum space while respecting the
-        --          margin coefficient and the initial height /width ratio.
-        --          NOTE than the original Z size of the view is NOT modified .
-                raises BadValue from V3d ;
-        --      If the margin coefficient is <0 ou >= 1 or
-        --      Updates the view
+        ---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
+        --          The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
+        --          Throws program error exception if margin coefficient is < 0 or >= 1.
+        --          Updates the view.
+        --          @param theMargin [in] the margin coefficient for view borders.
+        --          @param theToUpdate [in] flag to perform view update.
 
-        ZFitAll ( me : mutable ;  Coef : Coefficient = 1.0 )
+        ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
         ---Level: Public
-        ---Purpose: Automatic Depth Panning. Objects visible in the view are
-        --          visualised so as to occupy the maximum Z amount of space
-        --          while respecting the margin coefficient .
-        --          NOTE than the original XY size of the view is NOT modified .
-                raises BadValue from V3d ;
-        --      If the margin coefficient is <0 ou or
-        --      If No Objects are displayed in the view
+        ---Purpose: Change Z-min and Z-max planes of projection volume to match the
+        --          displayed objects. The methods ensures that view volume will
+        --          be close by depth range to the displayed objects. Fitting assumes that
+        --          for orthogonal projection the view volume contains the displayed objects
+        --          completely. For zoomed perspective view, the view volume is adjusted such
+        --          that it contains the objects or their parts, located in front of the camera.
+        --          @param theScaleFactor [in] the scale factor for Z-range.
+        --                                     The range between Z-min, Z-max projection volume planes
+        --                                     evaluated by z fitting method will be scaled using this coefficient.
+        --                                     Program error exception is thrown if negative or zero value is passed.
+
+        AutoZFit (me : mutable);
+        ---Level: Public
+        ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
+        --          projection volume planes with call to ZFitAll.
 
         DepthFitAll( me : mutable ;   Aspect : Coefficient = 0.01;
                                       Margin : Coefficient = 0.01 );
@@ -933,40 +945,29 @@ is
         --          calculated Z size and Aspect parameter.
         --          NOTE than the original XY size of the view is NOT modified .
 
-        FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
+        FitAll (me : mutable;
+                theMinXv : Real from Standard;
+                theMinYv : Real from Standard;
+                theMaxXv : Real from Standard;
+                theMaxYv : Real from Standard)
         ---Level: Public
-        ---Purpose: Centres the defined projection window so that it occupies
+        ---Purpose: Centers the defined projection window so that it occupies
         --          the maximum space while respecting the initial
         --          height/width ratio.
         --          NOTE than the original Z size of the view is NOT modified .
                 raises BadValue from V3d;
         --              If the defined projection window has zero size.
 
-
-        WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
+        WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
         ---Level: Public
-        ---Purpose: Centres the defined PIXEL window so that it occupies
-        --          the maximum space while respecting the initial
-        --          height/width ratio.
-        --          NOTE than the original Z size of the view is NOT modified .
-                raises BadValue from V3d
-        --              If the defined projection window has zero size.
+        ---Purpose: Centers the defined PIXEL window so that it occupies
+        -- the maximum space while respecting the initial height/width ratio.
+        -- NOTE than the original Z size of the view is NOT modified.
+        -- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
+        -- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
+        -- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
+        -- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
         is static;
-
-    SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
-        ---Level: Public
-        ---Purpose: Sets Z and XY size of the view according to given values
-        --          with respecting the initial view depth (eye position).
-        --          Width/heigth aspect ratio should be preserved by the caller
-        --          of this method similarly to SetSize() to avoid unexpected
-        --          visual results like non-uniform scaling of objects in the view. 
-                raises BadValue from V3d;
-        --              If the ZNear<0, ZFar<0 or ZNear>=Zfar.
-
-    SetViewMapping ( me : mutable; VM   : ViewMapping from Visual3d );
-    ---Level: Public
-    ---Purpose: Modifies the mapping of the view.
-
         SetViewMappingDefault( me : mutable );
         ---Level: Public
         ---Purpose: Saves the current view mapping. This will be the
@@ -974,12 +975,12 @@ is
 
         ResetViewMapping ( me : mutable );
         ---Level: Public
-        ---Purpose: Resets the centring of the view.
+        ---Purpose: Resets the centering of the view.
         --          Updates the view
 
         Reset ( me : mutable; update : Boolean from Standard = Standard_True );
         ---Level: Public
-        ---Purpose: Resets the centring and the orientation of the view
+        ---Purpose: Resets the centering and the orientation of the view
         --          Updates the view
         ---------------------------------------------------
         ---Category: Inquire methods
@@ -1038,18 +1039,19 @@ is
         --           in the reference frame of the view corresponding
         --           to the intersection with the projection plane
         --           of the eye/view point vector and display the grid marker.
-    --  Warning: When the grid is not active the result is identical
-    --     to the above Convert() method.
-    -- How to use :
+    --  Warning: When the grid is not active the result is identical to the above Convert() method.
+    -- How to use:
     -- 1) Enable the grid echo display
     --    myViewer->SetGridEcho(Standard_True);
-    -- 2) When application receive a move event :
+    -- 2) When application receive a move event:
     --   2.1) Check if any object is detected
     --     if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
     --   2.2) Check if the grid is active
         --     if( myViewer->Grid()->IsActive() ) {
     --   2.3) Display the grid echo and gets the grid point
         --       myView->ConvertToGrid(x,y,X,Y,Z);
+        --       myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z));
+        --       myView->RedrawImmediate();
     --   2.4) Else this is the standard case
         --     } else myView->Convert(x,y,X,Y,Z);
         raises UnMapped from V3d;
@@ -1112,10 +1114,6 @@ is
         ---Level: Public
         ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
 
-        Center ( me; Xc,Yc : out Coordinate );
-        ---Level: Public
-        ---Purpose: Returns the centre of the view.
-
         Size ( me; Width, Height : out Length );
         ---Level: Public
         ---Purpose: Returns the height and width of the view.
@@ -1223,27 +1221,6 @@ is
         ActiveLight(me) returns mutable Light from V3d;
         ---Level: Advanced
 
-        IfMorePlanes( me ) returns Boolean;
-        ---Level: Advanced
-        ---Purpose: Returns True if One clipping plane more can be
-        --          activated in this View.
-
-        InitActivePlanes(me: mutable);
-        ---Level: Advanced
-        ---Purpose: initializes an iteration on the active Planes.
-
-        MoreActivePlanes (me) returns Boolean from Standard;
-        ---Level: Advanced
-        ---Purpose: returns true if there are more active Plane(s) to return.
-
-        NextActivePlanes (me: mutable);
-        ---Level: Advanced
-        ---Purpose : Go to the next active Plane
-        --           (if there is not, ActivePlane will raise an exception)
-
-        ActivePlane(me) returns mutable Plane from V3d;
-        ---Level: Advanced
-
         Viewer ( me ) returns mutable Viewer from V3d;
         ---Level: Advanced
         ---Purpose: Returns the viewer in which the view has been created.
@@ -1262,31 +1239,51 @@ is
         ---Level: Public
         ---Purpose: Returns the Type of the View
 
-        Pan ( me : mutable; Dx, Dy: Integer from Standard;
-                             aZoomFactor: Factor from Quantity = 1);
-        ---Level: Public
-        ---Purpose: translates the center of the view and zooms the view.
-        --       and updates the view.
-
-        Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
-        is static;
-        ---Level: Public
-        ---Purpose: Zoom the view according to a zoom factor computed
-        -- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
-
-        Zoom ( me: mutable; X,Y: Integer from Standard)
+        Pan (me            : mutable;
+             theDXp        : Integer from Standard;
+             theDYp        : Integer from Standard;
+             theZoomFactor : Factor from Quantity = 1;
+             theToStart    : Boolean = Standard_True);
+        ---Level: Public
+        ---Purpose: Translates the center of the view along "x" and "y" axes of
+        -- view projection. Can be used to perform interactive panning operation.
+        -- In that case the DXp, DXp parameters specify panning relative to the
+        -- point where the operation is started.
+        -- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
+        -- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
+        -- @param theZoomFactor [in] the zooming factor.
+        -- @param theToStart [in] pass TRUE when starting panning to remember view
+        -- state prior to panning for relative arguments. Passing 0 for relative
+        -- panning parameter should return view panning to initial state.
+        -- Performs update of view.
+
+        Zoom (me     : mutable;
+              theXp1 : Integer from Standard;
+              theYp1 : Integer from Standard;
+              theXp2 : Integer from Standard;
+              theYp2 : Integer from Standard)
         is static;
         ---Level: Public
         ---Purpose: Zoom the view according to a zoom factor computed
-        -- from the distance between the last and new mouse position <X,Y>
+        -- from the distance between the 2 mouse position.
+        -- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
+        -- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
+        -- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
+        -- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
 
-        StartZoomAtPoint(me : mutable;
-                         xpix, ypix : Integer from Standard);
+        StartZoomAtPoint (me    : mutable;
+                          theXp : Integer from Standard;
+                          theYp : Integer from Standard);
         ---Level: Public
-        ---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
+        ---Purpose: Defines starting point for ZoomAtPoint view operation.
+        -- @param theXp [in] the x mouse coordinate, in pixels.
+        -- @param theYp [in] the y mouse coordinate, in pixels.
 
         ZoomAtPoint(me : mutable;
-                    mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
+                    theMouseStartX : Integer from Standard;
+                    theMouseStartY : Integer from Standard;
+                    theMouseEndX   : Integer from Standard;
+                    theMouseEndY   : Integer from Standard);
         ---Level: Public
         ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
 
@@ -1300,13 +1297,13 @@ is
         StartRotation(me : mutable ; X,Y :Integer from Standard;
                zRotationThreshold: Ratio from Quantity = 0.0);
         ---Level: Public
-    ---Purpose: Begin the rotation of the view arround the screen axis
+    ---Purpose: Begin the rotation of the view around the screen axis
     -- according to the mouse position <X,Y>.
     --  Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
     -- factor is > 0 soon the distance from the start point and the center
     -- of the view is > (medium viewSize * <zRotationThreshold> ).
     -- Generally a value of 0.4 is usable to rotate around XY screen axis
-    -- inside the circular treshold area and to rotate around Z screen axis
+    -- inside the circular threshold area and to rotate around Z screen axis
     -- outside this area.
 
         Rotation(me:mutable;  X,Y :Integer from Standard);
@@ -1341,82 +1338,21 @@ is
         ---Level: Advanced
         ---Purpose: Returns the associated Visual3d view.
 
-        ViewMapping ( me ) returns ViewMapping from Visual3d is static;
-    ---Level: Advanced
-    ---Purpose: Returns the current mapping of the view.
-
-    ViewOrientation ( me ) returns ViewOrientation from Visual3d is static;
-    ---Level: Advanced
-    ---Purpose: Returns the current orientation of the view.
-
-        ScreenAxis( myclass ; Vpn,Vup        : Vector from Graphic3d ;
+        ScreenAxis( myclass ; Vpn,Vup        : Dir from gp ;
                               Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
                                         returns Boolean is private ;
         ---Purpose: Determines the screen axes in the reference
         --          framework of the view.
 
-        InitMatrix ( myclass ; Matrix : out Array2OfReal from TColStd ) is private ;
-
-        Multiply( myclass ;
-                 Left, Right : Array2OfReal from TColStd ;
-                 Matrix      : out Array2OfReal from TColStd )
-                 returns Boolean from Standard is private ;
-
-        RotAxis( myclass ; Vrp      : Vertex from Graphic3d ;
-                           Axe      : Vector from Graphic3d ; Angle : PlaneAngle ;
-                           Matrix   : out Array2OfReal from TColStd ) is private ;
-        ---Purpose: Determines the rotation matrice around an axis
-        --          for a given angle.
 
-        TrsPoint( myclass ; P      : Vertex from Graphic3d ;
-                            Matrix : Array2OfReal from TColStd )
-                                returns Vertex from Graphic3d is private ;
-        ---Purpose: Transforms the point P according to the matrice Matrix .
-
-        TrsPoint( myclass ; V : Vector from Graphic3d ;
+        TrsPoint( myclass ; V : Vertex from Graphic3d ;
                                 Matrix : Array2OfReal from TColStd )
-                                returns Vector from Graphic3d is private ;
-        ---Purpose: Transforms the vector V according to the matrice Matrix .
+                                returns Vertex from Graphic3d is private ;
+        ---Purpose: Transforms the Vertex V according to the matrice Matrix .
         
         ImmediateUpdate (me) is static protected;
          ---Purpose: 
 
-        -----------------------------------------
-        ---Category: TransientManager methods
-        -----------------------------------------
-
-         TransientManagerBeginDraw(me; DoubleBuffer: Boolean = Standard_False;
-                                       RetainMode  : Boolean = Standard_False)
-        ---Level: Public
-        ---Purpose: Begins any graphics in the view <aView>
-        --          Redraw any structured graphics in the back buffer before
-        --          if <DoubleBuffer> is TRUE.
-        --          Restore the front buffer from the back before
-        --          if <DoubleBuffer> is FALSE.
-        --          if <RetainMode> is TRUE.
-        --          the graphic managed itself exposure,resizing ...
-        --          if <RetainMode> is FALSE.
-        --          the application must managed itself exposure,resizing ...
-        --
-                returns Boolean from Standard;
-
-         TransientManagerClearDraw(me);
-        ---Level: Public
-        ---Purpose: Clear all transient graphics in the view <aView>
-
-
-         TransientManagerBeginAddDraw(me)
-        ---Level: Public
-        ---Purpose: Begins any add graphics in the view <aView>
-        --          Redraw any structured graphics in the back buffer before
-        --          the application must managed itself exposure,resizing ...
-        --  Warning: Returns TRUE if transient drawing is enabled in
-        --         the associated view.
-        --          Returns FALSE ,if nothing works because something
-        --         is wrong for the transient principle :
-        --
-                returns Boolean from Standard;
-
         SetComputedMode ( me : mutable; aMode : Boolean from Standard )
         is static;
         ---Level: Advanced
@@ -1504,7 +1440,7 @@ is
         --          extension must be one of ".png",".bmp",".jpg",".gif".
         --          Returns FALSE when the dump has failed
 
-      Print (me; hPrnDC: Handle from Aspect = NULL;
+      Print (me; hPrnDC: Handle from Aspect = 0;
              showDialog: Boolean = Standard_True;
              showBackground : Boolean = Standard_True;
              filename: CString = NULL;
@@ -1537,19 +1473,25 @@ is
     --  you use it for your purposes;
     --  Warning: Works only under Windows.
 
-        ToPixMap ( me : mutable;
-                   theImage  : in out PixMap from Image;
-                   theWidth  : Integer from Standard;
-                   theHeight : Integer from Standard;
-                   theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
-                   theForceCentered : Boolean from Standard = Standard_True )
+        ToPixMap (me : mutable;
+                  theImage  : in out PixMap from Image;
+                  theWidth  : Integer from Standard;
+                  theHeight : Integer from Standard;
+                  theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
+                  theToKeepAspect : Boolean from Standard = Standard_True;
+                  theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
         returns Boolean from Standard;
         ---Level   : Public
-        ---Purpose : dump the full contents of the view
-        --        to a pixmap of pixel size <theWidth>*<theHeight> and
-        --        buffer type <theBufferType>. If <theForceCentered> is true
-        --        view scene will be centered.
-        --       Pixmap will be automatically (re)allocated when needed.
+        ---Purpose : Dumps the full contents of the view
+        --           to a pixmap of pixel size <theWidth> * <theHeight> and
+        --           buffer type <theBufferType>. If <theToKeepAspect> is true
+        --           the aspect ratio of view will be kept if <theWidth> and <theHeight>
+        --           define another ratio.
+        --           Pixmap will be automatically (re)allocated when needed.
+        --           When dumping stereographic camera - the corresponding
+        --           middle-point monographic projection will be used for dumping by default.
+        --           <theStereoOptions> flags are to be used for dumping then left or
+        --           right eye projections.
 
     SetProjModel( me : mutable;
         amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
      ---Purpose: returns the current state of the gl lighting
      --          currently used in triedron displaying
 
+     AddClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
+     ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
+     -- rendering space to convex volume. Number of supported clip planes can be consulted
+     -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
+     -- which exceed the limit are ignored during rendering. 
+     -- @param thePlane [in] the clip plane to be added to view.
+
+     RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
+     ---Purpose: Removes clip plane from the view.
+     -- @param thePlane [in] the clip plane to be removed from view.
+
+     SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
+     ---Purpose: Sets sequence of clip planes to the view. The planes that have been set
+     -- before are removed from the view. The composition of clip planes
+     -- truncates the rendering space to convex volume. Number of supported
+     -- clip planes can be consulted by PlaneLimit method of associated
+     -- Visual3d_View. Please be aware that the planes which exceed the limit
+     -- are ignored during rendering. 
+     -- @param thePlanes [in] the clip planes to set.
+
+     GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
+     ---C++: return const&
+     ---Purpose: Get clip planes.
+     -- @return sequence clip planes that have been set for the view
+
+    SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
+    ---Level: Public
+    ---Purpose: Change camera used by view.
+
+    Camera (me) returns Camera_Handle from Graphic3d is static;
+    ---Level: Public
+    ---C++: return const&
+    ---Purpose: Returns camera object of the view.
+    -- @return: handle to camera object, or NULL if 3D view does not use
+    -- the camera approach.
+
+    FitMinMax (me;
+               theCamera          : Camera_Handle from Graphic3d;
+               theMinCorner       : XYZ from gp;
+               theMaxCorner       : XYZ from gp;
+               theMargin          : Real from Standard;
+               theResolution      : Real from Standard = 0.0;
+               theToEnlargeIfLine : Boolean from Standard = Standard_True)
+               returns Boolean from Standard is protected;
+    ---Level: Protected
+    ---Purpose: Transform camera eye, center and scale to fit in the
+    -- passed bounding box specified in WCS.
+    -- @param theCamera [in] the camera.
+    -- @param theMinCorner [in] the minimal corner of bounding box.
+    -- @param theMaxCorner [in] the maximal corner of bounding box.
+    -- @param theMargin [in] the margin coefficient for view borders.
+    -- @param theResolution [in] the minimum size of projection of
+    --        bounding box in Xv or Yv direction when it considered to
+    --        be a thin plane or point (without a volume).
+    --        In this case only the center of camera is adjusted.
+    -- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
+    -- whole bounding box projected into thin line going along
+    -- Z-axis of screen, the view plane is enlarged such that
+    -- we see the whole line on rotation, otherwise only the
+    -- center of camera is adjusted.
+    -- @return TRUE if the fit all operation can be done.
+
+    Scale (me;
+           theCamera : Camera_Handle from Graphic3d;
+           theSizeXv : Real from Standard;
+           theSizeYv : Real from Standard) is protected;
+    ---Level: Protected
+    ---Purpose: Scales camera to fit the view frame of defined width and height
+    -- keeping the aspect. For orthogonal camera the method changes scale,
+    -- for perspective adjusts Eye location about the Center point.
+    -- @param theSizeXv [in] size of viewport frame on "x" axis.
+    -- @param theSizeYv [in] size of viewport frame on "y" axis.
+
+    Translate (me;
+         theCamera : Camera_Handle from Graphic3d;
+         theDXv    : Real from Standard;
+         theDYv    : Real from Standard) is protected;
+    ---Level: Protected
+    -- Purpose: Translates camera eye and center along the view plane.
+    -- @param theCamera [in] the camera to translate.
+    -- @param theDXv [in] the translation in "x" direction.
+    -- @param theDYv [in] the translation in "y" direction.
+
+    RenderingParams (me) returns RenderingParams from Graphic3d is static;
+    ---C++: return const &
+    ---Level: Public
+    ---Purpose: Returns current rendering parameters and effect settings.
+    
+    ChangeRenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
+    ---C++: return &
+    ---Level: Public
+    ---Purpose: Returns reference to current rendering parameters and effect settings.
 
 fields
 
-        MyType :                TypeOfView from V3d is protected ;
+        myOldMouseX : Real is protected;
+        myOldMouseY : Real is protected;
+        myCamStartOpUp : Dir from gp is protected;
+        myCamStartOpEye : Pnt from gp is protected;
+        myCamStartOpBnd : Real[6] is protected;
+        myCamStartOpCenter : Pnt from gp is protected;
+        myCamera : Camera_Handle from Graphic3d is protected;
+
         MyViewer :              ViewerPointer from V3d ;
         MyActiveLights:         ListOfTransient from V3d;
-        MyActivePlanes:         ListOfTransient from V3d;
 
         MyView :                View from Visual3d is protected ;
-        MyViewMapping :         ViewMapping from Visual3d is protected ;
-        MyViewOrientation :     ViewOrientation from Visual3d ;
         MyViewContext :         ContextView from Visual3d ;
         MyBackground:           Background from Aspect ;
         MyGradientBackground:   GradientBackground from Aspect ;
@@ -1626,7 +1664,6 @@ fields
         MyPlotter:              Plotter from Graphic3d;
 
         myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
-        myActivePlanesIterator: ListIteratorOfListOfTransient from TColStd;
 
         sx,sy: Integer from Standard;
         rx,ry: Real from Standard;
@@ -1642,6 +1679,8 @@ fields
         --MyColorScale            :       ColorScale from V3d;
         MyLayerMgr              :       LayerMgr from V3d;
 
+        MyProjModel         :   TypeOfProjectionModel from V3d is protected;
+            
         -- the transformation between XoY and the grid plane
         MyTrsf                  :       Array2OfReal from TColStd;
 
@@ -1649,10 +1688,18 @@ fields
         MyGridEchoStructure             :       Structure from Graphic3d;
         MyGridEchoGroup                 :       Group from Graphic3d;
 
-    MyProjModel         :   TypeOfProjectionModel from V3d is protected;
+        MyTransparencyFlag      : Boolean from Standard;
+        myImmediateUpdate: Boolean from Standard is protected;
+
+        myXscreenAxis           : Vector from Graphic3d;
+        myYscreenAxis           : Vector from Graphic3d;
+        myZscreenAxis           : Vector from Graphic3d;
+        myViewAxis              : Vector from Graphic3d;
+        myGravityReferencePoint : Vertex from Graphic3d;
+        myCamProjectionShift    : Pnt from gp;
+        myAutoZFitIsOn          : Boolean from Standard;
+        myAutoZFitScaleFactor   : Real from Standard;
 
-    MyTransparencyFlag      : Boolean from Standard;
-    myImmediateUpdate: Boolean from Standard is protected;
 friends
 
         SetViewOn from class Viewer from V3d ( me : mutable ),