From: rnc Date: Fri, 16 Mar 2012 15:43:54 +0000 (+0000) Subject: Added a method to disable sketching in the view (the existing methods seem to have... X-Git-Tag: V6_5_0a1~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=08c67b438050565f746761022488f3a0dbd1c59c;p=modules%2Fgui.git Added a method to disable sketching in the view (the existing methods seem to have no effect) --- diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index d514bc1f6..2030c12d0 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -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) { diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index 79e86bcbb..a6e4b62d0 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -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;