Salome HOME
Merge modifications for HYDRO project (origin/hydro/imps_2017_salome_83 branch)
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewWindow.h
index dff660d7233df0ba2aa3ab9bc365aa9186917b33..57165f3bff5cfb7df4a4968352e164fca3dbc966 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -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,
@@ -151,7 +151,7 @@ public:
         SwitchInteractionStyleId, SwitchZoomingStyleId, 
         SwitchPreselectionId, SwitchSelectionId,
         MaximizedId, SynchronizeId, ReturnTo3dViewId,
-        OrthographicId, PerspectiveId, StereoId,
+        OrthographicId, PerspectiveId, StereoId, RayTracingId, EnvTextureId, LightSourceId,
         UserId };
 
   enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, 
@@ -159,7 +159,7 @@ public:
                       FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW,
                      CLOCKWISEVIEW, ANTICLOCKWISEVIEW, PROJECTION };
 
-  enum RotationPointType{ GRAVITY, SELECTED };
+  enum RotationPointType{ BBCENTER, SELECTED };
 
   enum SketchingType { NoSketching, Rect, Polygon };
 
@@ -186,6 +186,8 @@ public:
   
   virtual void initLayout();
 
+  virtual bool enableDrawMode( bool );
+
   virtual void updateEnabledDrawMode();
 
   virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
@@ -240,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;
 
@@ -268,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();
@@ -303,6 +313,10 @@ public slots:
   virtual void onSwitchZoomingStyle( bool on );
   virtual void onSwitchPreselection( bool on );
   virtual void onSwitchSelection( bool on );
+  virtual void onRayTracing();
+  virtual void onEnvTexture();
+  virtual void onLightSource();
+  virtual void onPanning();
 
   virtual void activateSetRotationGravity();
   virtual void activateSetRotationSelected( double theX, double theY, double theZ );
@@ -349,7 +363,6 @@ protected:
   void vpMouseReleaseEvent(QMouseEvent* theEvent);
   void vpMouseMoveEvent(QMouseEvent* theEvent);
 
-  void resetState();
   void drawRect();
   void endDrawRect();
 
@@ -362,6 +375,8 @@ protected:
 
   bool computeGravityCenter( double& theX, double& theY, double& theZ );
 
+  void projAndPanToGravity(V3d_TypeOfOrientation CamOri);
+
   virtual void                          onSketchingStarted();
   virtual void                          onSketchingFinished();
 
@@ -396,10 +411,11 @@ protected:
   bool                  myCursorIsHand;                 
   bool                  myDrawRect;           // set when a rect is used for selection or magnify 
   bool                  myEnableDrawMode;
+  bool                  myDrawRectEnabled;
   bool                  myPaintersRedrawing;  // set to draw with external painters  
   bool                  IsSketcherStyle;
   bool                  myIsKeyFree;
-  
+  bool                  myAutomaticZoom;
   QCursor               myCursor;
 
   double myCurScale;
@@ -424,6 +440,7 @@ private:
   Handle(V3d_Plane) myReserveClipPlane;
 
   viewAspectList myViewAspects;
+  bool myPanningByBtn;
 };
 
 #ifdef WIN32