]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Problem with starting pooling when rectangular selection is performed
authorsln <sln@opencascade.com>
Fri, 7 Dec 2007 11:07:17 +0000 (11:07 +0000)
committersln <sln@opencascade.com>
Fri, 7 Dec 2007 11:07:17 +0000 (11:07 +0000)
src/GLViewer/GLViewer_ViewPort2d.cxx
src/GLViewer/GLViewer_ViewPort2d.h
src/GLViewer/GLViewer_Viewer2d.cxx

index 0fc004d7d726d16bea405d9dd3ca92ff2ee3b7d9..be0007a5545db5497ceda8ff36c4f3c209be998b 100644 (file)
@@ -1188,6 +1188,14 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y )
 
 }
 
+/*!
+  Returns tue if selection by rect is preformed
+*/
+bool GLViewer_ViewPort2d::isSelectByRect() const
+{
+  return mypFirstPoint && mypLastPoint;
+}
+
 /*!
   Finishes rectangle selection
 */
index 4d4581f5286f106f1b09c9a7ef728ea6a53c993b..95326f360e1e461da1015331f1c91014860efcab 100644 (file)
@@ -140,6 +140,9 @@ public:
   void                   drawSelectByRect( int x, int y );
   //! Pass rect into selector and update
   void                   finishSelectByRect();
+
+    //! Pass rect into selector and update
+  bool                   isSelectByRect() const;
   
   //! \warnign It is for ouv
   bool                   startPulling( GLViewer_Pnt );
index 962d2e03fcbc8a5079fc9830acb808639dff2bb4..fbbb7b7d3a77f4def5c9487c12941b4986fa522f 100644 (file)
@@ -938,11 +938,12 @@ 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() );
+        vp->startSelectByRect( e->x(), e->y() );
 }
 
 /*!
@@ -965,13 +966,16 @@ bool GLViewer_Viewer2d::updateOperations( QMouseEvent* e )
     }
 
     /*if( vp->isDragProcess() == GLViewer_ViewPort2d::inDrag )
-        return true;
+        return true;*/
 
-    if( e->state() == Qt::LeftButton && vp->startPulling( point ) )
+    if( e->state() == Qt::LeftButton )
     {
-        vp->finishSelectByRect();
+      if ( !vp->isSelectByRect() && vp->startPulling( point ) )
+      {
+        vp->finishSelectByRect(); //startSelectByRect
         return true;
-    }*/
+      }
+    }
 
     if( !myGLContext->getCurrentObject() )
     {