Index: trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
===================================================================
--- trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc	(revision 677)
+++ trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc	(revision 678)
@@ -54,5 +54,4 @@
  QGLWidget(QGLFormat(QGL::SampleBuffers))             // FIXME : gerer le pb du parent !
  {
-   zoomAction = false;
    nbPaint =0;
    hasToRepaint =false;
@@ -257,80 +256,4 @@
 void G4OpenGLStoredQtViewer::paintGL()
  {
-   if (zoomAction) {
-     glEnable (GL_DEPTH_TEST);
-     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-     setupViewport(width(),height());     
-     SetView();
-     ClearView (); //ok, put the background correct
-
-     QPainter painter;
-     painter.begin(this);
-     //      painter.setCompositionMode(QPainter::CompositionMode_DestinationOver);
-     //      painter.setCompositionMode(QPainter::CompositionMode_SourceOver); // diagonale en pointillé
-     //     painter.setCompositionMode(QPainter::CompositionMode_DestinationOver); // blanc
-     //     painter.setCompositionMode(QPainter::CompositionMode_Clear);// diagonale noire
-     //     painter.setCompositionMode(QPainter::CompositionMode_Source); // diagonale en pointillé
-     //     painter.setCompositionMode(QPainter::CompositionMode_Destination); // blanc
-     //     painter.setCompositionMode(QPainter::CompositionMode_SourceIn); // blanc ?
-     //     painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); // blanc
-     //     painter.setCompositionMode(QPainter::CompositionMode_SourceOut); // digonale noire
-     //     painter.setCompositionMode(QPainter::CompositionMode_DestinationOut); // diagonale noire
-     //     painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); // diagonale noire
-     //     painter.setCompositionMode(QPainter::CompositionMode_DestinationAtop); // blanc
-     //     painter.setCompositionMode(QPainter::CompositionMode_Xor); // diagonale noire
-     //     painter.setRenderHint(QPainter::Antialiasing);
-     //         painter.setBackgroundMode(Qt::OpaqueMode);
-     //          painter.drawImage(0, 0, glBufferImage);
-     
-     //     painter.setRenderHint(QPainter::Antialiasing);
-     //      QColor bg = QColor(glBufferImage.pixel(0,0));
-     //      printf("%d+%d+%d+%d %d+%d+%d+%d",bg.red(),bg.green(),bg.blue(),bg.alpha(),qAlpha(glBufferImage.pixel(0,0)),qRed(glBufferImage.pixel(0,0)),qGreen(glBufferImage.pixel(0,0)),qBlue(glBufferImage.pixel(0,0)));
-     //      painter.setBackground(QBrush(bg));
-     //      //     painter.drawRect(10,10,50,80);
-     // //      QImage test = grabFrameBuffer().copy();
-     // //      painter.drawImage(0, 0,test);
-     for (int ay=0;ay<glBufferImage.height();ay++) {
-       for (int ax=0;ax<glBufferImage.width();ax++) {
-         //         if(QColor(glBufferImage.pixel(ax,ay)) != bg) {
-         //.           painter.setPen(QColor(glBufferImage.pixel(ax,ay)));
-         //.           painter.drawPoint(ax,ay);
-           //          } else {
-           //            printf("o");
-           //          }
-         //          printf("%d+%d+%d+%d ",QColor(glBufferImage.pixel(ax,ay)).red(),QColor(glBufferImage.pixel(ax,ay)).green(),QColor(glBufferImage.pixel(ax,ay)).blue(),QColor(glBufferImage.pixel(ax,ay)).alpha());
-         //          if (glBufferImage.pixel(ax,ay) == 255) {
-         //            test.setPixel(ax,ay,1);
-         //          } else {
-         //            test.setPixel(ax,ay,0);
-         //          }
-       }
-       //       printf("\n");
-     }
-     // //      for (int ay=0;ay<test.height();ay++) {
-     // //        for (int ax=0;ax<test.width();ax++) {
-     // //          if (test.pixel(ax,ay) == 1) {
-     // //            printf(".");
-     // //          } else if (!test.pixel(ax,ay)) {
-     // //            printf("X");
-     // //          } else {
-     // //            printf("%d",test.pixel(ax,ay));
-     // //          }
-     // //        }
-     // //        printf("\n");
-     // //      }
-     
-     //     painter.drawImage(0, 0, glBufferImage);
-     //     painter.drawImage(0, 0, test,0,0,-1,-1,Qt::ColorOnly);
-     
-#ifdef GEANT4_QT_DEBUG
-       printf("G4OpenGLStoredQtViewer::paintGL ============  zoom event\n");
-#endif
-       painter.setBrush(Qt::NoBrush);
-       painter.setPen(Qt::red);
-       painter.setPen(Qt::DashLine);
-       painter.drawRect(beginZoom.x(),beginZoom.y(),endZoom.x()-beginZoom.x(),endZoom.y()-beginZoom.y());
-     painter.end();
-   } else {
      
      if (!readyToPaint) {
@@ -376,5 +299,4 @@
      hasToRepaint =false;
      
-   }
 #ifdef GEANT4_QT_DEBUG
      printf("G4OpenGLStoredQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %d ready %d\n",nbPaint,readyToPaint);
@@ -391,4 +313,8 @@
 }
 
+/**
+ * This function was build in order to make a zoom on double clic event.
+ * It was think to build a rubberband on the zoom area, but never work fine
+ */
 void G4OpenGLStoredQtViewer::mouseDoubleClickEvent(QMouseEvent *event)
 {
@@ -396,30 +322,6 @@
   printf("G4OpenGLStoredQtViewer::mouseDoubleClickEvent\n");
 #endif
-  setMouseTracking(true);
-  zoomAction=true;
-  //  makeCurrent();
-//   glBufferImage = QImage( width(), height(), QImage::Format_ARGB32_Premultiplied );
-//   glReadPixels( 0, 0, width(), height(), GL_RGBA, GL_UNSIGNED_BYTE, glBufferImage.bits() );
-  glBufferImage = grabFrameBuffer().convertToFormat(QImage::Format_ARGB32);//_Premultiplied);
-  QImage acha( glBufferImage.size(), QImage::Format_RGB32 );
-  acha.fill( Qt::black );
-  glBufferImage.setAlphaChannel( acha );
-  
-#ifdef GEANT4_QT_DEBUG
-//   for (int ay=0;ay<glBufferImage.height();ay++) {
-//     for (int ax=0;ax<glBufferImage.width();ax++) {
-//       if (glBufferImage.pixel(ax,ay) == 255) {
-//         printf(".");
-//       } else if (!glBufferImage.pixel(ax,ay)) {
-//         printf("X");
-//       } else {
-//         printf("%d",glBufferImage.pixel(ax,ay));
-//       }
-//     }
-//     printf("\n");
-//   }
-#endif
-  beginZoom.setX(event->x());
-  beginZoom.setY(event->y());
+//   setMouseTracking(true);
+//   glBufferImage = grabFrameBuffer().convertToFormat(QImage::Format_ARGB32);//_Premultiplied);  
 }
 
@@ -429,14 +331,10 @@
   printf("G4OpenGLStoredQtViewer::mouseReleaseEvent\n");
 #endif
-  setMouseTracking(false);
-  zoomAction =false;
+//   setMouseTracking(false);
 }
 
 void G4OpenGLStoredQtViewer::mouseMoveEvent(QMouseEvent *event)
 {
-  // special case of mouse zoom action, it should draw a rect on
-  // the openGL buffer, so it could only be done in this class
-  // and sould be reimplemented in G4OpenGLImmediateQtViewer
-  if (!zoomAction) {
+
 #if QT_VERSION < 0x040000
     G4MouseMoveEvent(event->x(),event->y(),event->state());
@@ -444,13 +342,4 @@
     G4MouseMoveEvent(event->x(),event->y(),event->buttons());
 #endif
-  } else {
-#ifdef GEANT4_QT_DEBUG
-    printf("G4OpenGLStoredQtViewer::mouseMoveEvent zoom\n");
-#endif
-    endZoom.setX(event->x());
-    endZoom.setY(event->y());
-    updateGL();
-  }
-  //  DrawView();
 }
 
