Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/gui
authorPaul RASCLE <paul.rascle@edf.fr>
Mon, 19 Mar 2018 09:05:15 +0000 (10:05 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Mon, 19 Mar 2018 09:05:15 +0000 (10:05 +0100)
src/GraphicsView/GraphicsView_ViewPort.cxx
src/GraphicsView/GraphicsView_ViewPort.h
src/GraphicsView/GraphicsView_Viewer.cxx
src/OCCViewer/OCCViewer_Utilities.cxx
src/OCCViewer/OCCViewer_Utilities.h
src/OCCViewer/OCCViewer_ViewManager.cxx
src/OCCViewer/OCCViewer_ViewManager.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h

index dac64f7ceedc12f3b3b784277a701824bb833471..40086a4f8c9754e8b4a0bed8a673c5db99d75643 100644 (file)
@@ -850,6 +850,11 @@ void GraphicsView_ViewPort::zoom( double theX1, double theY1, double theX2, doub
   aTransform.scale( aZoom, aZoom );
   double aM11 = aTransform.m11();
   double aM22 = aTransform.m22();
+
+
+  QGraphicsView::ViewportAnchor old_anchor = transformationAnchor();
+  setTransformationAnchor( QGraphicsView::AnchorUnderMouse );
+
   // increasing of diagonal coefficients (>300) leads to a crash sometimes
   // at the values of 100 some primitives are drawn incorrectly
   if( qMax( aM11, aM22 ) < 100 )
@@ -858,6 +863,8 @@ void GraphicsView_ViewPort::zoom( double theX1, double theY1, double theX2, doub
   myIsTransforming = false;
 
   applyTransform();
+
+  setTransformationAnchor( old_anchor );
 }
 
 //================================================================
index 4b5acfc2eaf637505d4c54aefd2b98bd53dedb31..303f6f8f44ac3020055dd3372cc01a48effb851f 100644 (file)
@@ -55,7 +55,9 @@ public:
     DraggingByMiddleButton = 0x0010,
     ImmediateContextMenu   = 0x0020,
     ImmediateSelection     = 0x0040,
-    Sketching              = 0x0080
+    Sketching              = 0x0080,
+
+    GlobalWheelScaling     = 0x0100
   };
   Q_DECLARE_FLAGS( InteractionFlags, InteractionFlag )
 
index ddb9b18ee76eb74250d1793f2bfc1c5766c09611..a8e1511b2c360aec3bb3d834f2eda335abd788f5 100644 (file)
@@ -37,6 +37,8 @@
 #include <QKeyEvent>
 #include <QMenu>
 
+#include <math.h>
+
 // testing ImageViewer
 /*
 #include "GraphicsView_PrsImage.h"
@@ -521,6 +523,16 @@ void GraphicsView_Viewer::handleWheel( QGraphicsSceneWheelEvent* e )
 {
   if( GraphicsView_ViewPort* aViewPort = getActiveViewPort() )
   {
+    if( aViewPort->hasInteractionFlag( GraphicsView_ViewPort::GlobalWheelScaling ) )
+    {
+      const double d = 1.05;
+      double q = pow( d, e->delta()/120 );
+      QGraphicsView::ViewportAnchor old_anchor = aViewPort->transformationAnchor();
+      aViewPort->setTransformationAnchor( QGraphicsView::AnchorUnderMouse );
+      aViewPort->scale( q, q );
+      aViewPort->setTransformationAnchor( old_anchor );
+    }
+
     if( aViewPort->hasInteractionFlag( GraphicsView_ViewPort::WheelScaling ) )
     {
       bool anIsScaleUp = e->delta() > 0;
index 9a560d77a6eb92028dcbd3692114b69e62dd14a7..8ee02c3b1eb535028dd0b59b88fb829a23dacdbe 100755 (executable)
@@ -97,7 +97,10 @@ OCCViewer_ViewWindow::Mode2dType OCCViewer_Utilities::setViewer2DMode
   for ( int i = 0, aNb = aNo2dActions.size(); i < aNb; i++ ) {
     anAction = aToolMgr->action( aNo2dActions[i] );
     if ( anAction )
+    {
       anAction->setEnabled( !is2dMode );
+      anAction->setVisible( !is2dMode );
+    }
   }
   QAction* aTop = aToolMgr->action( OCCViewer_ViewWindow::TopId );
   QtxMultiAction* aMulti = dynamic_cast<QtxMultiAction*>( aTop->parent() );
@@ -208,3 +211,36 @@ bool OCCViewer_Utilities::computeVisibleBBCenter( const Handle(V3d_View) theView
 
   return true;
 }
+
+bool OCCViewer_Utilities::computeSceneBBCenter( const Handle(V3d_View) theView,
+                                                double& theX, double& theY, double& theZ )
+{
+  theX = 0, theY = 0, theZ = 0;
+  Bnd_Box aBox = theView->View()->MinMaxValues();
+  if (!aBox.IsVoid())
+  {
+    double Xmin, Ymin, Zmin, Xmax, Ymax, Zmax;
+    aBox.Get (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
+    gp_Pnt aPnts[8] =
+    {
+      gp_Pnt (Xmin, Ymin, Zmin), gp_Pnt (Xmin, Ymin, Zmax),
+      gp_Pnt (Xmin, Ymax, Zmin), gp_Pnt (Xmin, Ymax, Zmax),
+      gp_Pnt (Xmax, Ymin, Zmin), gp_Pnt (Xmax, Ymin, Zmax),
+      gp_Pnt (Xmax, Ymax, Zmin), gp_Pnt (Xmax, Ymax, Zmax)
+    };
+
+    for (Standard_Integer i = 0; i < 8; i++)
+    {
+      const gp_Pnt& aCornPnt = aPnts[i];
+      theX += aCornPnt.X();
+      theY += aCornPnt.Y();
+      theZ += aCornPnt.Z();
+    }
+
+    theX /= 8;
+    theY /= 8;
+    theZ /= 8;
+    return true;
+  }
+  return false;
+}
index 68f845a8f303f27ed3455422e03669e25c49718a..7db427e50ebd56b899b3d9dc7f3d7b71e540ac6c 100755 (executable)
@@ -80,6 +80,8 @@ public:
    * \return \c true if the bounding box center is computed
    */
   static bool computeVisibleBBCenter( const Handle(V3d_View) theView, double& theX, double& theY, double& theZ );
+
+  static bool computeSceneBBCenter( const Handle(V3d_View) theView, double& theX, double& theY, double& theZ );
 };
 
 #endif // OCCVIEWER_UTILITIES_H
index c1f2b4d5032af4a3b404de1a3be66828fcc2cc37..4e3b9d6b86ae8006ba745165e3f6a35dc4d77c34 100755 (executable)
@@ -28,7 +28,8 @@
   Constructor
 */
 OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron )
-: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) )
+: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) ),
+  myIsChainedOperations( false )
 {  
   setTitle( tr( "OCC_VIEW_TITLE" ) );
 }
@@ -50,3 +51,13 @@ void OCCViewer_ViewManager::contextMenuPopup( QMenu* popup )
   // if it is necessary invoke method CreatePopup of ViewPort
   // be sure that existing QPopupMenu menu is used for that.
 }
+
+bool OCCViewer_ViewManager::isChainedOperations() const
+{
+  return myIsChainedOperations;
+}
+
+void OCCViewer_ViewManager::setChainedOperations( bool isChainedOperations )
+{
+  myIsChainedOperations = isChainedOperations;
+}
index c29474ebfcd24436f76bfd717c900747978a59a1..e4ac7c119d71d7b6fea4222f6ef6e40f45bd6578 100755 (executable)
@@ -40,6 +40,12 @@ public:
   OCCViewer_Viewer* getOCCViewer() { return (OCCViewer_Viewer*) myViewModel; }
 
   virtual void      contextMenuPopup( QMenu* );
+
+  bool isChainedOperations() const;
+  void setChainedOperations( bool );
+
+private:
+  bool myIsChainedOperations;
 };
 
 #endif
index cdf1edfe98781c1d2aaa752d5d7a6589a12f2d45..46153c3212c9139cceaa45c496d09597076c38d4 100755 (executable)
@@ -572,6 +572,7 @@ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
     QApplication::syncX();
 #endif
   QTimer::singleShot( 0, this, SLOT( repaintViewAfterMove() ) );
+  emit vpResizeEvent( e );
 }
 
 /*!
index 013c7db712d30b6e12e852457a756ffd5b34847f..c0e396e38857f122ac3d659bf7e127354fd1d0f5 100755 (executable)
@@ -95,6 +95,7 @@ signals:
   void                  vpChangeBackground( const Qtx::BackgroundData& );
   void                  vpClosed(OCCViewer_ViewPort3d*);
   void                  vpMapped(OCCViewer_ViewPort3d*);
+  void                  vpResizeEvent( QResizeEvent* );
 
 public slots:
   virtual bool          synchronize( OCCViewer_ViewPort* );
index 367c85151807567dc087def4d21d21378515669f..c090f4ac49f686f004abcdfc5c8d3e89f504e2e0 100644 (file)
@@ -82,6 +82,7 @@
 #include <Graphic3d_ExportFormat.hxx>
 #include <Graphic3d_StereoMode.hxx>
 #include <Graphic3d_RenderingParams.hxx>
+#include <Graphic3d_BndBox3d.hxx>
 
 #include <V3d_Plane.hxx>
 #include <V3d_Light.hxx>
@@ -236,8 +237,8 @@ const char* imageCrossCursor[] = {
   "................................",
   "................................"};
 
-
-/*!
+  /*!
   \brief Constructor
   \param theDesktop main window of application
   \param theModel OCC 3D viewer
@@ -268,6 +269,8 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop*     theDesktop,
   mySelectionEnabled = true;
 
   myCursorIsHand = false;
+  myPanningByBtn = false;
+  myAutomaticZoom = true;
 
   clearViewAspects();
 }
@@ -614,6 +617,22 @@ void OCCViewer_ViewWindow::activateZoom()
 }
 
 
+void OCCViewer_ViewWindow::onPanning()
+{
+  OCCViewer_ViewManager* aMgr = dynamic_cast<OCCViewer_ViewManager*>( getViewManager() );
+  bool isChained = aMgr->isChainedOperations();
+  bool isReset = ( myPanningByBtn && isChained );
+  if( isReset )
+  {
+    resetState();
+  }
+  else
+  {
+    myPanningByBtn = true;
+    activatePanning();
+  }
+}
+
 /*!
   \brief Start panning operation.
 
@@ -688,13 +707,16 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
     if ( aStructure->IsEmpty() || !aStructure->IsVisible() || aStructure->CStructure()->IsForHighlight )
       continue;
 
-    Bnd_Box aBox = aStructure->MinMaxValues();
-    aXmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
-    aYmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
-    aZmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Z();
-    aXmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().X();
-    aYmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Y();
-    aZmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Z();
+    Bnd_Box aBox1 = aStructure->MinMaxValues();
+    const Graphic3d_BndBox3d& aBox = aStructure->CStructure()->BoundingBox();
+    if (!aBox.IsValid())
+      continue;
+    aXmin = /*aBox.IsVoid() ? RealFirst() :*/ aBox.CornerMin().x();
+    aYmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().y();
+    aZmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().z();
+    aXmax = /*aBox.IsVoid() ? RealLast()  : */aBox.CornerMax().x();
+    aYmax = /*aBox.IsVoid() ? RealLast()  : */aBox.CornerMax().y();
+    aZmax = /*aBox.IsVoid() ? RealLast()  : */aBox.CornerMax().z();
 
     // Infinite structures are skipped
     Standard_Real aLIM = ShortRealLast() - 1.0;
@@ -735,8 +757,10 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
     theX /= aPointsNb;
     theY /= aPointsNb;
     theZ /= aPointsNb;
+    return true;
   }
-  return true;
+  else
+    return false;
 }
 
 /*!
@@ -1037,8 +1061,14 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 
   case PANVIEW:
   case ZOOMVIEW:
-    resetState();
-    break;
+    {
+      OCCViewer_ViewManager* aMgr = dynamic_cast<OCCViewer_ViewManager*>( getViewManager() );
+      bool isChained = aMgr->isChainedOperations();
+      bool isReset = !( myOperation==PANVIEW && myPanningByBtn && isChained ) || theEvent->button() == Qt::RightButton;
+      if( isReset )
+        resetState();
+      break;
+    }
 
   case PANGLOBAL:
     if ( theEvent->button() == Qt::LeftButton ) {
@@ -1103,6 +1133,8 @@ void OCCViewer_ViewWindow::resetState()
 
   setTransformInProcess( false );
   setTransformRequested( NOTHING );
+
+  myPanningByBtn = false;
 }
 
 
@@ -1204,7 +1236,7 @@ void OCCViewer_ViewWindow::createActions()
   aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_PAN" ) ),
                            tr( "MNU_PAN_VIEW" ), 0, this);
   aAction->setStatusTip(tr("DSC_PAN_VIEW"));
-  connect(aAction, SIGNAL(triggered()), this, SLOT(activatePanning()));
+  connect(aAction, SIGNAL(triggered()), this, SLOT(onPanning()));
   toolMgr()->registerAction( aAction, PanId );
 
   // Global Panning
@@ -1563,8 +1595,14 @@ void OCCViewer_ViewWindow::onFrontView()
 {
   emit vpTransformationStarted ( FRONTVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xpos);
-  onViewFitAll();
+  if (myAutomaticZoom)
+  {
+    if ( !aView3d.IsNull() ) 
+      aView3d->SetProj (V3d_Xpos);
+    onViewFitAll();
+  }
+  else
+    projAndPanToGravity(V3d_Xpos);
   emit vpTransformationFinished ( FRONTVIEW );
 }
 
@@ -1575,8 +1613,14 @@ void OCCViewer_ViewWindow::onBackView()
 {
   emit vpTransformationStarted ( BACKVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xneg);
-  onViewFitAll();
+  if (myAutomaticZoom)
+  {
+    if ( !aView3d.IsNull() ) 
+      aView3d->SetProj (V3d_Xneg);
+    onViewFitAll();
+  }
+  else
+    projAndPanToGravity(V3d_Xneg);
   emit vpTransformationFinished ( BACKVIEW );
 }
 
@@ -1587,8 +1631,14 @@ void OCCViewer_ViewWindow::onTopView()
 {
   emit vpTransformationStarted ( TOPVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zpos);
-  onViewFitAll();
+  if (myAutomaticZoom)
+  {
+    if ( !aView3d.IsNull() ) 
+      aView3d->SetProj (V3d_Zpos);
+    onViewFitAll();
+  }
+  else
+    projAndPanToGravity(V3d_Zpos);
   emit vpTransformationFinished ( TOPVIEW );
 }
 
@@ -1599,8 +1649,14 @@ void OCCViewer_ViewWindow::onBottomView()
 {
   emit vpTransformationStarted ( BOTTOMVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zneg);
-  onViewFitAll();
+  if (myAutomaticZoom)
+  {
+    if ( !aView3d.IsNull() ) 
+      aView3d->SetProj (V3d_Zneg);
+    onViewFitAll();
+  }
+  else
+    projAndPanToGravity(V3d_Zneg);
   emit vpTransformationFinished ( BOTTOMVIEW );
 }
 
@@ -1611,8 +1667,14 @@ void OCCViewer_ViewWindow::onLeftView()
 {
   emit vpTransformationStarted ( LEFTVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Yneg);
-  onViewFitAll();
+  if (myAutomaticZoom)
+  {
+    if ( !aView3d.IsNull() ) 
+      aView3d->SetProj (V3d_Yneg);
+    onViewFitAll();
+  }
+  else
+    projAndPanToGravity(V3d_Yneg);
   emit vpTransformationFinished ( LEFTVIEW );
 }
 
@@ -1623,8 +1685,14 @@ void OCCViewer_ViewWindow::onRightView()
 {
   emit vpTransformationStarted ( RIGHTVIEW );
   Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Ypos);
-  onViewFitAll();
+  if (myAutomaticZoom)
+  {
+    if ( !aView3d.IsNull() ) 
+      aView3d->SetProj (V3d_Ypos);
+    onViewFitAll();
+  }
+  else
+    projAndPanToGravity(V3d_Ypos);
   emit vpTransformationFinished ( RIGHTVIEW );
 }
 
@@ -3314,7 +3382,6 @@ bool OCCViewer_ViewWindow::isQuadBufferSupport() const
   return enable;
 }
 
-
 bool OCCViewer_ViewWindow::isOpenGlStereoSupport() const
 {
   GLboolean support[1];
@@ -3593,3 +3660,84 @@ void OCCViewer_ViewWindow::onLightSource()
       aDlg->show();
   }
 }
+
+bool OCCViewer_ViewWindow::isActionVisible( ActionId theId ) const
+{
+  QAction* a = toolMgr()->action( theId );
+  return a && a->isVisible();
+}
+
+void OCCViewer_ViewWindow::setActionVisible( ActionId theId, bool isVisible )
+{
+  QAction* a = toolMgr()->action( theId );
+  if( a )
+    a->setVisible( isVisible );
+}
+
+void OCCViewer_ViewWindow::projAndPanToGravity(V3d_TypeOfOrientation CamOri)
+{
+  const bool USE_XY = true;
+
+  Handle(V3d_View) aView3d = myViewPort->getView();
+  if (aView3d.IsNull())
+    return;
+
+  bool IsGr = false;
+  double X = 0, Y = 0, Z = 0;
+  if( USE_XY )
+  {
+    const double EPS = 1E-6;
+    int xp = myViewPort->width()/2, yp = myViewPort->height()/2, xp1, yp1;
+    aView3d->Convert( xp, yp, X, Y, Z );
+
+    gp_Dir d = aView3d->Camera()->Direction();
+    if( fabs( d.Z() ) > EPS )
+    {
+      double t = -Z/d.Z();
+      X += t*d.X();
+      Y += t*d.Y();
+      Z += t*d.Z();
+    }
+  }
+
+  // It is really necessary to compute gravity center even if it is not used in part of code below.
+  // Without this calculation the SetProj() method and other methods are not correct.
+  double X2, Y2, Z2;
+  IsGr = computeGravityCenter(X2, Y2, Z2);
+  if ( !IsGr )
+    IsGr = OCCViewer_Utilities::computeSceneBBCenter(aView3d, X2, Y2, Z2);
+
+  aView3d->SetProj(CamOri);
+  if (IsGr)
+  {
+    //aView3d->Update();
+    Handle(Graphic3d_Camera) Cam = aView3d->Camera();
+    gp_XYZ gp(X, Y, Z);
+    gp_Vec dir (Cam->Direction());
+    gp_Pnt eye = Cam->Eye();
+    gp_Vec V1(eye, gp);
+    Standard_Real D = dir.Dot(V1);
+    gp_Pnt ppdir = eye.Translated(D*dir);
+    gp_Vec V2(ppdir, gp);
+    gp_XYZ trEye = eye.XYZ() + V2.XYZ();
+
+    double xat, yat, zat;
+    aView3d->At(xat, yat, zat);
+    gp_Pnt At(xat, yat, zat);
+    gp_XYZ trAt = At.XYZ() + V2.XYZ();
+    aView3d->SetEye(trEye.X(), trEye.Y(), trEye.Z());
+    aView3d->SetAt(trAt.X(), trAt.Y(), trAt.Z());
+  }
+}
+
+
+bool OCCViewer_ViewWindow::isAutomaticZoom() const
+{
+  return myAutomaticZoom;
+}
+
+void OCCViewer_ViewWindow::setAutomaticZoom(const bool isOn)
+{
+  myAutomaticZoom = isOn;
+}
+
index e83fe217e196b2c0694af66308e5aafb0f0937d6..57165f3bff5cfb7df4a4968352e164fca3dbc966 100755 (executable)
@@ -143,7 +143,7 @@ class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow
   Q_OBJECT
 
 public:
-  enum { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId,
+  enum ActionId { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId,
          ChangeRotationPointId, RotationId,
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
         ResetId, CloneId, ClippingId, MemId, RestoreId,
@@ -242,6 +242,9 @@ public:
   virtual bool                    isQuadBufferSupport() const;
   virtual void                    setQuadBufferSupport( const bool );
 
+  virtual bool                    isAutomaticZoom() const;
+  virtual void                    setAutomaticZoom( const bool );
+
   void setTransformEnabled( const OperationType, const bool );
   bool transformEnabled( const OperationType ) const;
 
@@ -270,6 +273,11 @@ public:
 
   virtual SUIT_CameraProperties   cameraProperties();
 
+  bool isActionVisible( ActionId theId ) const;
+  void setActionVisible( ActionId theId, bool isVisible );
+
+  void resetState();
+
 public slots:
   virtual void onFrontView();
   virtual void onViewFitAll();
@@ -308,6 +316,7 @@ public slots:
   virtual void onRayTracing();
   virtual void onEnvTexture();
   virtual void onLightSource();
+  virtual void onPanning();
 
   virtual void activateSetRotationGravity();
   virtual void activateSetRotationSelected( double theX, double theY, double theZ );
@@ -354,7 +363,6 @@ protected:
   void vpMouseReleaseEvent(QMouseEvent* theEvent);
   void vpMouseMoveEvent(QMouseEvent* theEvent);
 
-  void resetState();
   void drawRect();
   void endDrawRect();
 
@@ -367,6 +375,8 @@ protected:
 
   bool computeGravityCenter( double& theX, double& theY, double& theZ );
 
+  void projAndPanToGravity(V3d_TypeOfOrientation CamOri);
+
   virtual void                          onSketchingStarted();
   virtual void                          onSketchingFinished();
 
@@ -405,7 +415,7 @@ protected:
   bool                  myPaintersRedrawing;  // set to draw with external painters  
   bool                  IsSketcherStyle;
   bool                  myIsKeyFree;
-  
+  bool                  myAutomaticZoom;
   QCursor               myCursor;
 
   double myCurScale;
@@ -430,6 +440,7 @@ private:
   Handle(V3d_Plane) myReserveClipPlane;
 
   viewAspectList myViewAspects;
+  bool myPanningByBtn;
 };
 
 #ifdef WIN32