]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Added a method to disable sketching in the view (the existing methods seem to have...
authorrnc <rnc@opencascade.com>
Fri, 16 Mar 2012 15:43:54 +0000 (15:43 +0000)
committerrnc <rnc@opencascade.com>
Fri, 16 Mar 2012 15:43:54 +0000 (15:43 +0000)
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h

index d514bc1f61477c40e2d6de7e62c769056667a08e..2030c12d09ad12adbeb7d729c1790fb3ea3680cd 100755 (executable)
@@ -227,6 +227,8 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop*     theDesktop,
   myScalingDlg = 0;
   mySetRotationPointDlg = 0;
   myRectBand = 0;
+  
+  IsSketcherStyle = false;
 
   mypSketcher = 0;
   myCurSketch = -1;
@@ -815,8 +817,10 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent )
     break;
 
   default:
-    if ( myRotationPointSelection )
+    if ( myRotationPointSelection || isSketcherStyle() )
+    {
       emit mouseMoving( this, theEvent );
+    }
     else
     {
       int aState = theEvent->modifiers();
@@ -2416,6 +2420,16 @@ bool OCCViewer_ViewWindow::isMaximized() const
   return !(toolMgr()->action( MaximizedId )->text() == tr( "MNU_MAXIMIZE_VIEW" ));
 }
 
+void OCCViewer_ViewWindow::setSketcherStyle( bool enable )
+{ 
+  IsSketcherStyle = enable; 
+}
+
+bool OCCViewer_ViewWindow::isSketcherStyle() const 
+{ 
+  return IsSketcherStyle; 
+}
+
 
 void OCCViewer_ViewWindow::set2dMode(Mode2dType theType)
 {
index 79e86bcbb0ad9f3e89682eb0eda2dca3f220d5f2..a6e4b62d0acf5500bb5caf637e1df326d03fbc48 100755 (executable)
@@ -180,6 +180,9 @@ public:
 
   void            setMaximized( bool, bool = true );
   bool            isMaximized() const;
+  
+  void            setSketcherStyle( bool enable );
+  bool            isSketcherStyle() const;
 
   virtual QColor  backgroundColor() const;                      // obsolete
   virtual void    setBackgroundColor( const QColor& );          // obsolete
@@ -305,8 +308,9 @@ protected:
   bool                  myCursorIsHand;                 
   bool                  myDrawRect;           // set when a rect is used for selection or magnify 
   bool                  myEnableDrawMode;
-  bool                  myPaintersRedrawing;  // set to draw with external painters 
+  bool                  myPaintersRedrawing;  // set to draw with external painters  
+  bool                  IsSketcherStyle;
+  
   QCursor               myCursor;
 
   double myCurScale;