From: ouv Date: Thu, 27 Sep 2007 12:59:21 +0000 (+0000) Subject: Modification of the selection algorithm X-Git-Tag: CTH_V1_3~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7cc7d0168052052c5445e8b78e303feddb8432b8;p=modules%2Fgui.git Modification of the selection algorithm --- diff --git a/src/GLViewer/GLViewer_Context.cxx b/src/GLViewer/GLViewer_Context.cxx index 0383b0325..8c90402b2 100644 --- a/src/GLViewer/GLViewer_Context.cxx +++ b/src/GLViewer/GLViewer_Context.cxx @@ -614,7 +614,12 @@ void GLViewer_Context::setSelected( GLViewer_Object* object, bool updateViewer ) } if( updateViewer ) - myGLViewer2d->activateDrawer( object, TRUE, TRUE ); + { + if( myUpdateAll ) + myGLViewer2d->updateAll(); + else + myGLViewer2d->activateDrawer( object, TRUE, TRUE ); + } } /*! diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index bb7ce2daa..efba3118a 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -938,8 +938,9 @@ void GLViewer_Viewer2d::startOperations( QMouseEvent* e ) transPoint( x, y ); GLViewer_Pnt point( x, y ); - if( e->button() == Qt::LeftButton && vp->startPulling( point ) ) - return; + // moved to updateOperations() - see below + //if( e->button() == Qt::LeftButton && vp->startPulling( point ) ) + // return; if( e->button() == Qt::LeftButton && !(vp->currentBlock() & BS_Selection) && !myGLContext->getCurrentObject() ) vp->startSelectByRect( e->x(), e->y() ); @@ -952,16 +953,19 @@ bool GLViewer_Viewer2d::updateOperations( QMouseEvent* e ) { GLViewer_ViewPort2d* vp = ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)getActiveView())->getViewPort(); + float x = e->pos().x(); + float y = e->pos().y(); + transPoint( x, y ); + GLViewer_Pnt point( x, y ); + if( vp->isPulling() ) { - float x = e->pos().x(); - float y = e->pos().y(); - transPoint( x, y ); - - vp->drawPulling( GLViewer_Pnt( x, y ) ); + vp->drawPulling( point ); updateAll(); return true; } + if( e->state() == Qt::LeftButton && vp->startPulling( point ) ) + return true; if( !myGLContext->getCurrentObject() ) {