From: dmv Date: Thu, 29 Jan 2009 07:28:09 +0000 (+0000) Subject: IPAL20833 SIGSEGV at Clone View X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eeb2aa177c8fe2cfc6c1383e6e69639803699a3b;p=modules%2Fgui.git IPAL20833 SIGSEGV at Clone View --- diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 78b825cb4..46499449a 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -207,8 +207,13 @@ void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theE if (!theWindow->inherits("OCCViewer_ViewWindow")) return; OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow; - if ( isSelectionEnabled() ) - myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView->getViewPort()->getView()); + + if ( isSelectionEnabled() ) { + if (aView->getViewPort()->getBusy()) return; + Handle(V3d_View) aView3d = aView->getViewPort()->getView(); + if ( !aView3d.IsNull() ) + myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d); + } } diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 10e01347e..7fc204ddd 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -57,7 +57,8 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V : OCCViewer_ViewPort( parent ), myScale( 1.0 ), myDegenerated( true ), -myAnimate( false ) +myAnimate( false ), +myBusy( true ) { selectVisualId(); @@ -459,6 +460,7 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e ) activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() ); } OCCViewer_ViewPort::paintEvent( e ); + myBusy = false; } /*! diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.h b/src/OCCViewer/OCCViewer_ViewPort3d.h index 13fb9bc86..c8bec10f1 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.h +++ b/src/OCCViewer/OCCViewer_ViewPort3d.h @@ -74,6 +74,7 @@ public: void startRotation( int, int, int, const gp_Pnt& ); void rotate( int, int, int, const gp_Pnt& ); void endRotation(); + bool getBusy() {return myBusy;} protected: // EVENTS @@ -93,6 +94,7 @@ private: Handle(V3d_View) myActiveView; bool myDegenerated; bool myAnimate; + bool myBusy; double myScale; };