]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Modification of the selection algorithm
authorouv <ouv@opencascade.com>
Thu, 27 Sep 2007 12:59:21 +0000 (12:59 +0000)
committerouv <ouv@opencascade.com>
Thu, 27 Sep 2007 12:59:21 +0000 (12:59 +0000)
src/GLViewer/GLViewer_Context.cxx
src/GLViewer/GLViewer_Viewer2d.cxx

index 0383b0325519889905878c5c3b1b2052b4326402..8c90402b2ec0fe4720712a8936c17b22c6aa773c 100644 (file)
@@ -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 );
+  }
 }
 
 /*!
index bb7ce2daae0e4975b0e5d2b0b5addf684f00b6e8..efba3118a20fb481a420c34525e998b67592cab1 100644 (file)
@@ -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() )
     {