Salome HOME
A revision of documentation changes in the new version. Very minor corrections.
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewWindow.h
index 625e4c58cf826d0d327b3fd532a8181d644e2a3e..421e43f049b4956cabd1b472ae3f4af953a8c670 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
@@ -6,7 +6,7 @@
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include "SUIT_ViewWindow.h"
 #include <gp_Pnt.hxx>
 #include <V3d_Plane.hxx>
+#include <TopAbs_ShapeEnum.hxx>
 
 class QtxRectRubberBand;
 class SUIT_Desktop;
 class OCCViewer_ViewPort3d;
 class OCCViewer_ViewSketcher;
-class OCCViewer_ClippingDlg;
 class OCCViewer_AxialScaleDlg;
 class OCCViewer_SetRotationPointDlg;
 class OCCViewer_Viewer;
@@ -43,66 +43,93 @@ class QtxAction;
 struct viewAspect
 {
 public:
-        double    scale;
-        double  centerX;
-        double  centerY;
-        double    projX;
-        double    projY;
-        double    projZ;
-        double    twist;
-        double      atX;
-        double      atY;
-        double      atZ;
-        double     eyeX;
-        double     eyeY;
-        double     eyeZ;
-        double   scaleX;
-        double   scaleY;
-        double   scaleZ;
-        QString    name;
-        bool     isVisible;
-        double   size;
-        // graduated trihedron
-        bool    gtIsVisible;
-        bool    gtDrawNameX;
-        bool    gtDrawNameY;
-        bool    gtDrawNameZ;
-        QString gtNameX;
-        QString gtNameY;
-        QString gtNameZ;
-        int     gtNameColorRX;
-        int     gtNameColorGX;
-        int     gtNameColorBX;
-        int     gtNameColorRY;
-        int     gtNameColorGY;
-        int     gtNameColorBY;
-        int     gtNameColorRZ;
-        int     gtNameColorGZ;
-        int     gtNameColorBZ;
-        bool    gtDrawValuesX;
-        bool    gtDrawValuesY;
-        bool    gtDrawValuesZ;
-        int     gtNbValuesX;
-        int     gtNbValuesY;
-        int     gtNbValuesZ;
-        int     gtOffsetX;
-        int     gtOffsetY;
-        int     gtOffsetZ;
-        int     gtColorRX;
-        int     gtColorGX;
-        int     gtColorBX;
-        int     gtColorRY;
-        int     gtColorGY;
-        int     gtColorBY;
-        int     gtColorRZ;
-        int     gtColorGZ;
-        int     gtColorBZ;
-        bool    gtDrawTickmarksX;
-        bool    gtDrawTickmarksY;
-        bool    gtDrawTickmarksZ;
-        int     gtTickmarkLengthX;
-        int     gtTickmarkLengthY;
-        int     gtTickmarkLengthZ;
+  double    scale;
+  double  centerX; // deprecated since OCCT 6.7.1
+  double  centerY; // deprecated since OCCT 6.7.1
+  double    projX;
+  double    projY;
+  double    projZ;
+  double    twist;
+  double      atX;
+  double      atY;
+  double      atZ;
+  double     eyeX;
+  double     eyeY;
+  double     eyeZ;
+  double   scaleX;
+  double   scaleY;
+  double   scaleZ;
+  QString    name;
+  bool     isVisible;
+  double   size;
+  // graduated trihedron
+  bool    gtIsVisible;
+  bool    gtDrawNameX;
+  bool    gtDrawNameY;
+  bool    gtDrawNameZ;
+  QString gtNameX;
+  QString gtNameY;
+  QString gtNameZ;
+  int     gtNameColorRX;
+  int     gtNameColorGX;
+  int     gtNameColorBX;
+  int     gtNameColorRY;
+  int     gtNameColorGY;
+  int     gtNameColorBY;
+  int     gtNameColorRZ;
+  int     gtNameColorGZ;
+  int     gtNameColorBZ;
+  bool    gtDrawValuesX;
+  bool    gtDrawValuesY;
+  bool    gtDrawValuesZ;
+  int     gtNbValuesX;
+  int     gtNbValuesY;
+  int     gtNbValuesZ;
+  int     gtOffsetX;
+  int     gtOffsetY;
+  int     gtOffsetZ;
+  int     gtColorRX;
+  int     gtColorGX;
+  int     gtColorBX;
+  int     gtColorRY;
+  int     gtColorGY;
+  int     gtColorBY;
+  int     gtColorRZ;
+  int     gtColorGZ;
+  int     gtColorBZ;
+  bool    gtDrawTickmarksX;
+  bool    gtDrawTickmarksY;
+  bool    gtDrawTickmarksZ;
+  int     gtTickmarkLengthX;
+  int     gtTickmarkLengthY;
+  int     gtTickmarkLengthZ;
+
+public:
+  viewAspect()
+  : scale( 0.0 ),
+    centerX( 0.0 ), centerY( 0.0 ),
+    projX( 0.0 ), projY( 0.0 ), projZ( 0.0 ),
+    twist( 0.0 ),
+    atX( 0.0 ), atY( 0.0 ), atZ( 0.0 ),
+    eyeX( 0.0 ), eyeY( 0.0 ), eyeZ( 0.0 ),
+    scaleX( 0.0 ), scaleY( 0.0 ), scaleZ( 0.0 ),
+    name(),
+    isVisible( false ),
+    size( 0.0 ),
+    gtIsVisible( false ),
+    gtDrawNameX( false ), gtDrawNameY( false ), gtDrawNameZ( false ),
+    gtNameX(), gtNameY(), gtNameZ(), 
+    gtNameColorRX( 0 ), gtNameColorGX( 0 ), gtNameColorBX( 0 ),
+    gtNameColorRY( 0 ), gtNameColorGY( 0 ), gtNameColorBY( 0 ),
+    gtNameColorRZ( 0 ), gtNameColorGZ( 0 ), gtNameColorBZ( 0 ),
+    gtDrawValuesX( false ), gtDrawValuesY( false ), gtDrawValuesZ( false ),
+    gtNbValuesX( 0 ), gtNbValuesY( 0 ), gtNbValuesZ( 0 ),
+    gtOffsetX( 0 ), gtOffsetY( 0 ), gtOffsetZ( 0 ),
+    gtColorRX( 0 ), gtColorGX( 0 ), gtColorBX( 0 ),
+    gtColorRY( 0 ), gtColorGY( 0 ), gtColorBY( 0 ),
+    gtColorRZ( 0 ), gtColorGZ( 0 ), gtColorBZ( 0 ),
+    gtDrawTickmarksX( false ), gtDrawTickmarksY( false ), gtDrawTickmarksZ( false ),
+    gtTickmarkLengthX( 0 ), gtTickmarkLengthY( 0 ), gtTickmarkLengthZ( 0 ) {}
 };
 
 typedef QList<viewAspect> viewAspectList;
@@ -121,7 +148,10 @@ public:
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
         ResetId, CloneId, ClippingId, MemId, RestoreId,
          TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId,
-        SwitchInteractionStyleId, SwitchZoomingStyleId, MaximizedId, SynchronizeId, UserId };
+        SwitchInteractionStyleId, SwitchZoomingStyleId, 
+        SwitchPreselectionId, SwitchSelectionId,
+        MaximizedId, SynchronizeId, ReturnTo3dViewId,
+        UserId };
 
   enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, 
                       PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
@@ -170,6 +200,11 @@ public:
  
   virtual int                     zoomingStyle() const;
   virtual void                    setZoomingStyle( const int );
+
+  virtual bool                    isPreselectionEnabled() const;
+  virtual void                    enablePreselection( bool );   
+  virtual bool                    isSelectionEnabled() const;
+  virtual void                    enableSelection( bool );
  
   void setTransformEnabled( const OperationType, const bool );
   bool transformEnabled( const OperationType ) const;
@@ -180,6 +215,7 @@ public:
 
   void            setMaximized( bool, bool = true );
   bool            isMaximized() const;
+  void            setReturnedTo3dView( bool = true );
   
   void            setSketcherStyle( bool enable );
   bool            isSketcherStyle() const;
@@ -187,6 +223,8 @@ public:
   virtual QColor  backgroundColor() const;                      // obsolete
   virtual void    setBackgroundColor( const QColor& );          // obsolete
 
+  virtual void    showStaticTrihedron( bool );
+
   virtual Qtx::BackgroundData  background() const;
   virtual void                 setBackground( const Qtx::BackgroundData& );
 
@@ -201,6 +239,7 @@ public slots:
   virtual void onFrontView();
   virtual void onViewFitAll();
   virtual void onBackView();
+  virtual void onClipping(bool on);
   virtual void onTopView();
   virtual void onBottomView();
   virtual void onLeftView();
@@ -216,26 +255,28 @@ public slots:
   virtual void activateGlobalPanning();
   virtual void onSetRotationPoint( bool on );
   virtual void onCloneView();
-  virtual void onClipping( bool on );
   virtual void onAxialScale();
   virtual void onGraduatedAxes();
   virtual void onAmbientToogle();
   virtual void onMemorizeView();
   virtual void onRestoreView();
-  virtual void onTrihedronShow();
+  virtual void onTrihedronShow(bool);
   virtual void setRestoreFlag();
   virtual void onSwitchInteractionStyle( bool on );
   virtual void onSwitchZoomingStyle( bool on );
+  virtual void onSwitchPreselection( bool on );
+  virtual void onSwitchSelection( bool on );
 
   virtual void activateSetRotationGravity();
   virtual void activateSetRotationSelected( double theX, double theY, double theZ );
-  virtual void activateStartPointSelection();
+  virtual void activateStartPointSelection( TopAbs_ShapeEnum );
   virtual void updateGravityCoords();
    
   virtual void showEvent( QShowEvent * );
   virtual void hideEvent( QHideEvent * );
 
   virtual void onMaximizedView();
+  virtual void returnTo3dView();
 
 signals:
   void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
@@ -245,6 +286,7 @@ signals:
   void Show( QShowEvent * );
   void Hide( QHideEvent * );
   void maximized( OCCViewer_ViewWindow*, bool );
+  void returnedTo3d( );
 
 protected slots:
   void synchronize( SUIT_ViewWindow* );
@@ -315,15 +357,13 @@ protected:
   bool                  myEnableDrawMode;
   bool                  myPaintersRedrawing;  // set to draw with external painters  
   bool                  IsSketcherStyle;
+  bool                  myIsKeyFree;
   
   QCursor               myCursor;
 
   double myCurScale;
 
 private:
-  OCCViewer_ClippingDlg* myClippingDlg;
-  QtxAction* myClippingAction;
-
   OCCViewer_AxialScaleDlg* myScalingDlg;
 
   OCCViewer_SetRotationPointDlg* mySetRotationPointDlg;
@@ -331,6 +371,8 @@ private:
 
   QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band
 
+  bool mySelectionEnabled;
+  bool myPreselectionEnabled;
   int myInteractionStyle;
 
   typedef QMap<OperationType, bool> MapOfTransformStatus;
@@ -338,7 +380,7 @@ private:
 
   Mode2dType my2dMode;
 
-  Handle(V3d_Plane) myReserveClippingPlane;
+  Handle(V3d_Plane) myReserveClipPlane;
 
   viewAspectList myViewAspects;
 };