Salome HOME
Fix for problem with table of contents resizing.
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewWindow.cxx
index ed1ee55b9aa5751eb9e28716d45d32dc0d2fa93f..cef3b10d89cd5b8702f4d53b3e7d34c056fcdb5a 100755 (executable)
@@ -1,11 +1,29 @@
-// OCCViewer_ViewWindow.cxx: implementation of the OCCViewer_ViewWindow class.
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//////////////////////////////////////////////////////////////////////
+// OCCViewer_ViewWindow.cxx: implementation of the OCCViewer_ViewWindow class.
+
 
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewPort3d.h"
 #include "OCCViewer_CreateRestoreViewDlg.h"
+#include "OCCViewer_ClippingDlg.h"
 
 #include "SUIT_Desktop.h"
 #include "SUIT_Session.h"
 #include <qpainter.h>
 #include <qapplication.h>
 #include <qdatetime.h>
+#include <qimage.h>
+
+#include <V3d_Plane.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Pln.hxx>
 
 const char* imageZoomCursor[] = { 
 "32 32 3 1",
@@ -136,34 +159,26 @@ const char* imageCrossCursor[] = {
   "................................",
   "................................",
   "................................"};
-  
-
-QPixmap zoomPixmap(imageZoomCursor);
-QPixmap rotatePixmap(imageRotateCursor);
-QPixmap globalPanPixmap(imageCrossCursor);
-
-QCursor        defCursor(Qt::ArrowCursor);
-QCursor        handCursor(Qt::PointingHandCursor);
-QCursor        panCursor(Qt::SizeAllCursor);
-QCursor        zoomCursor(zoomPixmap);
-QCursor        rotCursor(rotatePixmap);
-QCursor        glPanCursor(globalPanPixmap);
 
 
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
+/*!
+  Constructor
+  \param theDesktop - main window of application
+  \param theModel - OCC 3D viewer
+*/
 OCCViewer_ViewWindow::OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel)
 : SUIT_ViewWindow(theDesktop)
 {
   myModel = theModel;
-  myEnableDrawMode = true;
   myRestoreFlag = 0;
+  myEnableDrawMode = false;
+  updateEnabledDrawMode();
+  myClippingDlg = 0;
 }
 
-//****************************************************************
+/*!
+  Initialization of view window
+*/
 void OCCViewer_ViewWindow::initLayout()
 {
   myViewPort = new OCCViewer_ViewPort3d( this, myModel->getViewer3d(), V3d_ORTHOGRAPHIC );
@@ -183,7 +198,10 @@ void OCCViewer_ViewWindow::initLayout()
   createToolBar();
 }
 
-//****************************************************************
+/*!
+  \return type of operation by states of mouse and keyboard buttons
+  \param theEvent - mouse event
+*/
 OCCViewer_ViewWindow::OperationType OCCViewer_ViewWindow::getButtonState(QMouseEvent* theEvent)
 {
   OperationType aOp = NOTHING;
@@ -200,7 +218,9 @@ OCCViewer_ViewWindow::OperationType OCCViewer_ViewWindow::getButtonState(QMouseE
   return aOp;
 }
 
-//****************************************************************
+/*!
+  Custom event handler
+*/
 bool OCCViewer_ViewWindow::eventFilter(QObject* watched, QEvent* e)
 {
   if ( watched == myViewPort ) {
@@ -246,8 +266,18 @@ bool OCCViewer_ViewWindow::eventFilter(QObject* watched, QEvent* e)
   return SUIT_ViewWindow::eventFilter(watched, e);
 }
 
+/*!
+  Updates state of enable draw mode state
+*/
+void OCCViewer_ViewWindow::updateEnabledDrawMode()
+{
+  if ( myModel )
+    myEnableDrawMode = myModel->isSelectionEnabled() && myModel->isMultiSelectionEnabled();
+}
 
-//****************************************************************
+/*!
+  Handler of mouse press event
+*/
 void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
 {
   myStartX = theEvent->x();
@@ -306,22 +336,25 @@ void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
 }
 
 
-//****************************************************************
+/*!
+  Starts zoom operation, sets corresponding cursor
+*/
 void OCCViewer_ViewWindow::activateZoom()
 {
   if ( !transformRequested() && !myCursorIsHand )
     myCursor = cursor();               /* save old cursor */
   
   if ( myOperation != ZOOMVIEW ) {
+    QPixmap zoomPixmap (imageZoomCursor);
+    QCursor zoomCursor (zoomPixmap);
     setTransformRequested ( ZOOMVIEW );                
     setCursor( zoomCursor );
   }
 }
 
 
-//****************************************************************
 /*!
-    Activates 'panning' transformation
+  Starts panning operation, sets corresponding cursor
 */
 void OCCViewer_ViewWindow::activatePanning()
 {
@@ -329,14 +362,14 @@ void OCCViewer_ViewWindow::activatePanning()
     myCursor = cursor();               // save old cursor 
   
   if ( myOperation != PANVIEW ) {
+    QCursor panCursor (Qt::SizeAllCursor);
     setTransformRequested ( PANVIEW );
     setCursor( panCursor );
   }
 }
 
-//****************************************************************
 /*!
-    Activates 'rotation' transformation
+  Starts rotation operation, sets corresponding cursor
 */
 void OCCViewer_ViewWindow::activateRotation()
 {
@@ -344,16 +377,22 @@ void OCCViewer_ViewWindow::activateRotation()
     myCursor = cursor();               // save old cursor 
   
   if ( myOperation != ROTATE ) {
+    QPixmap rotatePixmap (imageRotateCursor);
+    QCursor rotCursor (rotatePixmap);
     setTransformRequested ( ROTATE );
     setCursor( rotCursor );    
   }
 }
 
-//****************************************************************
+/*!
+  Starts global panning operation, sets corresponding cursor
+*/
 void OCCViewer_ViewWindow::activateGlobalPanning()
 {
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) {
+    QPixmap globalPanPixmap (imageCrossCursor);
+    QCursor glPanCursor (globalPanPixmap);
     myCurScale = aView3d->Scale();
     aView3d->FitAll(0.01, false);
     myCursor = cursor();               // save old cursor 
@@ -363,9 +402,8 @@ void OCCViewer_ViewWindow::activateGlobalPanning()
   }
 }
 
-//****************************************************************
 /*!
-    Activates 'fit' transformation
+  Starts fit operation, sets corresponding cursor
 */
 void OCCViewer_ViewWindow::activateWindowFit()
 {
@@ -373,15 +411,15 @@ void OCCViewer_ViewWindow::activateWindowFit()
     myCursor = cursor();               /* save old cursor */
 
   if ( myOperation != WINDOWFIT ) {
+    QCursor handCursor (Qt::PointingHandCursor);
     setTransformRequested ( WINDOWFIT );               
     setCursor ( handCursor );
     myCursorIsHand = true;
   }
 }
 
-//****************************************************************
 /*!
-    Sets the active operation 'op'
+  Stores which viewer operation is requesting
 */
 void OCCViewer_ViewWindow::setTransformRequested ( OperationType op )
 {    
@@ -390,7 +428,9 @@ void OCCViewer_ViewWindow::setTransformRequested ( OperationType op )
 }
 
 
-//****************************************************************/
+/*!
+  Handler of mouse move event
+*/
 void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
 {
   myCurrX = theEvent->x();
@@ -429,6 +469,7 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
       if ( myDrawRect ) {
         drawRect();
        if ( !myCursorIsHand )  {   // we are going to sketch a rectangle
+          QCursor handCursor (Qt::PointingHandCursor);
          myCursorIsHand = true;                
          myCursor = cursor();
          setCursor( handCursor );
@@ -441,7 +482,9 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
   }
 }
 
-//****************************************************************/
+/*!
+  Handler of mouse release event
+*/
 void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 {
   switch ( myOperation ) {
@@ -454,9 +497,9 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
                                   theEvent->pos(), theEvent->globalPos(),
                                   theEvent->state() );
         emit contextMenuRequested( &aEvent );
-        break;
       }
     }
+    break;
   case ROTATE:
     myViewPort->endRotation();
     resetState();
@@ -497,10 +540,9 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
   }
 }
 
-//****************************************************************
 /*!
-    Sets the viewport to its initial state
-    ( no transformations in process etc. )
+  Sets the viewport to its initial state
+  ( no transformations in process etc. )
 */
 void OCCViewer_ViewWindow::resetState()
 {
@@ -522,7 +564,9 @@ void OCCViewer_ViewWindow::resetState()
 }
 
 
-//****************************************************************/
+/*!
+  Draws rectangle by starting and current points
+*/
 void OCCViewer_ViewWindow::drawRect()
 {
   QPainter aPainter(myViewPort);
@@ -535,7 +579,9 @@ void OCCViewer_ViewWindow::drawRect()
   myRect = aRect;
 }
 
-//****************************************************************/
+/*!
+  Creates actions of OCC view window
+*/
 void OCCViewer_ViewWindow::createActions()
 {
   if (!myActionsMap.isEmpty()) return;
@@ -644,6 +690,13 @@ void OCCViewer_ViewWindow::createActions()
   connect(aAction, SIGNAL(activated()), this, SLOT(onCloneView()));
        myActionsMap[ CloneId ] = aAction;
 
+  myClippingAction = new QtxAction(tr("MNU_CLIPPING"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" ) ),
+                           tr( "MNU_CLIPPING" ), 0, this);
+  myClippingAction->setStatusTip(tr("DSC_CLIPPING"));
+  myClippingAction->setToggleAction( true );
+  connect(myClippingAction, SIGNAL(toggled( bool )), this, SLOT(onClipping( bool )));
+       myActionsMap[ ClippingId ] = myClippingAction;
+
   aAction = new QtxAction(tr("MNU_SHOOT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_SHOOT_VIEW" ) ),
                            tr( "MNU_SHOOT_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_SHOOT_VIEW"));
@@ -665,7 +718,9 @@ void OCCViewer_ViewWindow::createActions()
   }
 }
 
-//****************************************************************
+/*!
+  Creates toolbar of OCC view window
+*/
 void OCCViewer_ViewWindow::createToolBar()
 {
   myActionsMap[DumpId]->addTo(myToolBar);  
@@ -699,15 +754,22 @@ void OCCViewer_ViewWindow::createToolBar()
 
   myToolBar->addSeparator();
   myActionsMap[CloneId]->addTo(myToolBar);
+  
+  myToolBar->addSeparator();
+  myActionsMap[ClippingId]->addTo(myToolBar);
 }
 
-//****************************************************************
+/*!
+  Processes operation fit all
+*/
 void OCCViewer_ViewWindow::onViewFitAll()
 {
   myViewPort->fitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "front view"
+*/
 void OCCViewer_ViewWindow::onFrontView()
 {
   emit vpTransformationStarted ( FRONTVIEW );
@@ -716,7 +778,9 @@ void OCCViewer_ViewWindow::onFrontView()
   onViewFitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "back view"
+*/
 void OCCViewer_ViewWindow::onBackView()
 {
   emit vpTransformationStarted ( BACKVIEW );
@@ -725,7 +789,9 @@ void OCCViewer_ViewWindow::onBackView()
   onViewFitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "top view"
+*/
 void OCCViewer_ViewWindow::onTopView()
 {
   emit vpTransformationStarted ( TOPVIEW );
@@ -734,7 +800,9 @@ void OCCViewer_ViewWindow::onTopView()
   onViewFitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "bottom view"
+*/
 void OCCViewer_ViewWindow::onBottomView()
 {
   emit vpTransformationStarted ( BOTTOMVIEW );
@@ -743,7 +811,9 @@ void OCCViewer_ViewWindow::onBottomView()
   onViewFitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "left view"
+*/
 void OCCViewer_ViewWindow::onLeftView()
 {
   emit vpTransformationStarted ( LEFTVIEW );
@@ -752,7 +822,9 @@ void OCCViewer_ViewWindow::onLeftView()
   onViewFitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "right view"
+*/
 void OCCViewer_ViewWindow::onRightView()
 {
   emit vpTransformationStarted ( RIGHTVIEW );
@@ -761,7 +833,9 @@ void OCCViewer_ViewWindow::onRightView()
   onViewFitAll();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "reset view": sets default orientation of viewport camera
+*/
 void OCCViewer_ViewWindow::onResetView()
 {
   emit vpTransformationStarted( RESETVIEW );
@@ -772,57 +846,65 @@ void OCCViewer_ViewWindow::onResetView()
   myViewPort->getView()->Update();
 }
 
-//****************************************************************
+/*!
+  Processes transformation "fit all"
+*/
 void OCCViewer_ViewWindow::onFitAll()
 {
   emit vpTransformationStarted( FITALLVIEW );
   myViewPort->fitAll();
 }
 
-//****************************************************************
+/*!
+  Creates one more window with same content
+*/
 void OCCViewer_ViewWindow::onCloneView()
 {
   SUIT_ViewWindow* vw = myManager->createViewWindow();
   vw->show();
 }
 
-//****************************************************************
-void OCCViewer_ViewWindow::onMemorizeView()
+/*!
+  SLOT: called if clipping operation is activated, enables/disables of clipping plane
+*/
+void OCCViewer_ViewWindow::onClipping( bool on )
 {
-  double centerX, centerY, projX, projY, projZ, twist;
-  double atX, atY, atZ, eyeX, eyeY, eyeZ;
-
-  Handle(V3d_View) aView3d = myViewPort->getView();
-
-  aView3d->Center( centerX, centerY );
-  aView3d->Proj( projX, projY, projZ );
-  aView3d->At( atX, atY, atZ );
-  aView3d->Eye( eyeX, eyeY, eyeZ );
-  twist = aView3d->Twist();
-
-  viewAspect params;
-  QString aName = QTime::currentTime().toString() + QString::fromLatin1( " h:m:s" );
-
-  params.scale    = aView3d->Scale();
-  params.centerX  = centerX;
-  params.centerY  = centerY;
-  params.projX    = projX;
-  params.projY    = projY;
-  params.projZ    = projZ;
-  params.twist    = twist;
-  params.atX      = atX;
-  params.atY      = atY;
-  params.atZ      = atZ;
-  params.eyeX     = eyeX;
-  params.eyeY     = eyeY;
-  params.eyeZ     = eyeZ;
-  params.name    = aName;
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  if ( on )
+    myActionsMap[ ClippingId ]->setIconSet(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING_PRESSED" )));
+  else
+    myActionsMap[ ClippingId ]->setIconSet(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" )));
+  
+  if ( on )
+    {
+      if ( !myClippingDlg )
+       {
+         myClippingDlg = new OCCViewer_ClippingDlg( this, myDesktop );
+         myClippingDlg->SetAction( myClippingAction );
+       }
 
-  myModel->appendViewAspect( params );
+      if ( !myClippingDlg->isShown() )
+       myClippingDlg->show();
+    }
+  else
+    {
+      if ( myClippingDlg->isShown() )
+       myClippingDlg->hide();
+      setCuttingPlane(false);
+    }
+}
 
+/*!
+  Stores view parameters
+*/
+void OCCViewer_ViewWindow::onMemorizeView()
+{
+  myModel->appendViewAspect( getViewParams() );
 }
 
-//****************************************************************
+/*!
+  Restores view parameters
+*/
 void OCCViewer_ViewWindow::onRestoreView()
 {
        OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), myModel );
@@ -833,8 +915,9 @@ void OCCViewer_ViewWindow::onRestoreView()
                performRestoring( aDlg->currentItem() );
 }
 
-//****************************************************************
-
+/*!
+  Restores view parameters from structure viewAspect
+*/
 void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
 {
        Handle(V3d_View) aView3d = myViewPort->getView();
@@ -842,29 +925,166 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
        Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False );
        aView3d->SetScale( anItem.scale );
        aView3d->SetCenter( anItem.centerX, anItem.centerY );
-       aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
        aView3d->SetTwist( anItem.twist );
        aView3d->SetAt( anItem.atX, anItem.atY, anItem.atZ );
        aView3d->SetImmediateUpdate( prev );
        aView3d->SetEye( anItem.eyeX, anItem.eyeY, anItem.eyeZ );
+       aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
                
        myRestoreFlag = 0;
 }
 
+/*!
+  Sets restore flag
+*/
 void OCCViewer_ViewWindow::setRestoreFlag()
 {
        myRestoreFlag = 1;
 }
 
-//****************************************************************
+/*!
+  SLOT: called when action "show/hide" trihedron is activated
+*/
 void OCCViewer_ViewWindow::onTrihedronShow()
 {
   myModel->toggleTrihedron();
 }
 
-//****************************************************************
+/*!
+  \return QImage, containing all scene rendering in window
+*/
 QImage OCCViewer_ViewWindow::dumpView()
 {
   QPixmap px = QPixmap::grabWindow( myViewPort->winId() );
   return px.convertToImage();
 }
+
+/*!
+  Sets parameters of cutting plane
+  \param on - is cutting plane enabled
+  \param x - x-position of plane point 
+  \param y - y-position of plane point 
+  \param z - z-position of plane point 
+  \param dx - x-coordinate of plane normal
+  \param dy - y-coordinate of plane normal
+  \param dz - z-coordinate of plane normal
+*/
+void  OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const double y,  const double z,
+                                                     const double dx, const double dy, const double dz )
+{
+  Handle(V3d_View) view = myViewPort->getView();
+  if ( view.IsNull() )
+    return;
+
+  if ( on ) {
+    Handle(V3d_Viewer) viewer = myViewPort->getViewer();
+    
+    // try to use already existing plane or create a new one
+    Handle(V3d_Plane) clipPlane;
+    view->InitActivePlanes();
+    if ( view->MoreActivePlanes() )
+      clipPlane = view->ActivePlane();
+    else
+      clipPlane = new V3d_Plane( viewer );
+    
+    // set new a,b,c,d values for the plane
+    gp_Pln pln( gp_Pnt( x, y, z ), gp_Dir( dx, dy, dz ) );
+    double a, b, c, d;
+    pln.Coefficients( a, b, c, d );
+    clipPlane->SetPlane( a, b, c, d );
+    
+    view->SetPlaneOn( clipPlane );
+  } 
+  else
+    view->SetPlaneOff();
+  
+  view->Update();
+  view->Redraw();
+}
+
+/*!
+  \return true if there is at least one cutting plane
+*/
+bool OCCViewer_ViewWindow::isCuttingPlane()
+{
+  Handle(V3d_View) view = myViewPort->getView();
+  view->InitActivePlanes();
+  return (view->MoreActivePlanes());
+}
+
+/*!
+  The method returns the visual parameters of this view as a viewAspect object
+*/
+viewAspect OCCViewer_ViewWindow::getViewParams() const
+{
+  double centerX, centerY, projX, projY, projZ, twist;
+  double atX, atY, atZ, eyeX, eyeY, eyeZ;
+
+  Handle(V3d_View) aView3d = myViewPort->getView();
+
+  aView3d->Center( centerX, centerY );
+  aView3d->Proj( projX, projY, projZ );
+  aView3d->At( atX, atY, atZ );
+  aView3d->Eye( eyeX, eyeY, eyeZ );
+  twist = aView3d->Twist();
+
+  QString aName = QTime::currentTime().toString() + QString::fromLatin1( " h:m:s" );
+
+  viewAspect params;
+  params.scale    = aView3d->Scale();
+  params.centerX  = centerX;
+  params.centerY  = centerY;
+  params.projX    = projX;
+  params.projY    = projY;
+  params.projZ    = projZ;
+  params.twist    = twist;
+  params.atX      = atX;
+  params.atY      = atY;
+  params.atZ      = atZ;
+  params.eyeX     = eyeX;
+  params.eyeY     = eyeY;
+  params.eyeZ     = eyeZ;
+  params.name    = aName;
+
+  return params;
+}
+
+
+/*!
+  The method returns the visual parameters of this view as a formated string
+*/
+QString OCCViewer_ViewWindow::getVisualParameters()
+{
+  viewAspect params = getViewParams();
+  QString retStr;
+  retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", params.scale,
+                 params.centerX, params.centerY, params.projX, params.projY, params.projZ, params.twist,
+                 params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ );
+  return retStr;
+}
+
+/*!
+  The method restors visual parameters of this view from a formated string
+*/
+void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters )
+{
+  QStringList paramsLst = QStringList::split( '*', parameters, true );
+  if ( paramsLst.size() == 13 ) {
+    viewAspect params;
+    params.scale    = paramsLst[0].toDouble();
+    params.centerX  = paramsLst[1].toDouble();
+    params.centerY  = paramsLst[2].toDouble();
+    params.projX    = paramsLst[3].toDouble();
+    params.projY    = paramsLst[4].toDouble();
+    params.projZ    = paramsLst[5].toDouble();
+    params.twist    = paramsLst[6].toDouble();
+    params.atX      = paramsLst[7].toDouble();
+    params.atY      = paramsLst[8].toDouble();
+    params.atZ      = paramsLst[9].toDouble();
+    params.eyeX     = paramsLst[10].toDouble();
+    params.eyeY     = paramsLst[11].toDouble();
+    params.eyeZ     = paramsLst[12].toDouble();
+
+    performRestoring( params );
+  }
+}