Changeset 1240 for trunk/source


Ignore:
Timestamp:
Mar 8, 2010, 5:36:15 PM (14 years ago)
Author:
garnier
Message:

debugging

Location:
trunk/source/visualization/OpenGL
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/History

    r1238 r1240  
    1 $Id: History,v 1.162 2010/01/06 15:05:29 lgarnier Exp $
     1$Id: History,v 1.163 2010/01/28 09:19:04 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    19193rd March 2010 Laurent Garnier
    2020- G4OpenGLViewer : Add protection against null pointer scene
     21
     2227th January 2010  Gabriele Cosmo
     23- Fixed compilation warnings on G4OpenGLQtViewer and corrected compilation
     24  error when using Qt-3.
    2125
    22266th January 2010  Laurent Garnier (needs interfaces-V09-02-07 + laurent-QtUI_with_tabs_v1)
  • trunk/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh

    r1228 r1240  
    6363
    6464protected:
     65  void showEvent(QShowEvent * event );
    6566  void wheelEvent(QWheelEvent *event);
    6667  void mousePressEvent(QMouseEvent *event);
  • trunk/source/visualization/OpenGL/include/G4OpenGLStoredQtViewer.hh

    r1235 r1240  
    6464
    6565protected:
     66  void showEvent(QShowEvent * event );
    6667  void wheelEvent(QWheelEvent *event);
    6768  void mousePressEvent(QMouseEvent *event);
  • trunk/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc

    r1235 r1240  
    150150    NeedKernelVisit ();
    151151    ProcessView ();
    152     glFlush ();
     152    FinishView();
    153153#ifdef G4DEBUG_VIS_OGL
    154154  printf("G4OpenGLImmediateQtViewer::ComputeView First ProcessView ok\n");
     
    166166   
    167167#ifdef G4DEBUG_VIS_OGL
    168   printf("G4OpenGLImmediateQtViewer::ComputeView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",getWinWidth(), getWinHeight());
     168  printf("G4OpenGLImmediateQtViewer::ComputeView %d %d hasTo:%d^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",getWinWidth(), getWinHeight(),fHasToRepaint);
    169169#endif
    170170  fHasToRepaint = true;
     
    262262}
    263263
     264void G4OpenGLImmediateQtViewer::showEvent (QShowEvent * event)
     265{
     266  fHasToRepaint = true;
     267}
     268
     269
    264270/**
    265271 * This function was build in order to make a zoom on double clic event.
     
    296302  }
    297303#ifdef G4DEBUG_VIS_OGL
    298   printf("\n\nG4OpenGLImmediateQtViewer::paintEvent ^^^^^^^^^\n");
     304  printf("\n\nG4OpenGLImmediateQtViewer::paintEvent ^^^^^^^^^ %d\n",fHasToRepaint);
    299305#endif
    300306}
     
    307313#endif
    308314  updateGL();
     315  repaint();
    309316#ifdef G4DEBUG_VIS_OGL
    310317  printf("\n\nG4OpenGLImmediateQtViewer::updateQWidget ^^^^^^^^^\n");
     
    322329  printf("\n\nG4OpenGLImmediateQtViewer::ShowView VVVV\n");
    323330#endif
     331  fHasToRepaint = true;
    324332#if QT_VERSION < 0x040000
    325333  setActiveWindow();
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1233 r1240  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.cc,v 1.46 2010/01/06 15:05:29 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.cc,v 1.47 2010/01/27 15:49:22 gcosmo Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    14361436void G4OpenGLQtViewer::FinishView()
    14371437{
     1438#ifdef G4DEBUG_VIS_OGL
     1439  printf("G4OpenGLQtViewer::FinishView() flush \n");
     1440#endif
    14381441  glFlush ();
    14391442
     
    15781581  }
    15791582  fVP.IncrementPan(-dx*coefTrans,dy*coefTrans,dz*coefDepth);
    1580   emit moveX(-dx*coefTrans);
    1581   emit moveY(dy*coefTrans);
    1582   emit moveZ(dz*coefTrans);
     1583  emit moveX(-static_cast<int>(dx*coefTrans));
     1584  emit moveY(static_cast<int>(dy*coefTrans));
     1585  emit moveZ(static_cast<int>(dz*coefTrans));
    15831586 
    15841587  updateQWidget();
     
    16031606  if( dx != 0) {
    16041607    rotateScene(dx,0,fDeltaRotation);
    1605     emit rotateTheta(dx);
     1608    emit rotateTheta(static_cast<int>(dx));
    16061609  }
    16071610  if( dy != 0) {
    16081611    rotateScene(0,dy,fDeltaRotation);
    1609     emit rotatePhi(dy);
     1612    emit rotatePhi(static_cast<int>(dy));
    16101613  }
    16111614  updateQWidget();
     
    16261629
    16271630  rotateScene(dx,dy,fDeltaRotation);
    1628   emit rotateTheta(dx);
    1629   emit rotatePhi(dy);
     1631  emit rotateTheta(static_cast<int>(dx));
     1632  emit rotatePhi(static_cast<int>(dy));
    16301633  updateQWidget();
    16311634 
     
    16891692     }
    16901693  */
    1691   printer.setOutputFileName(aFilename);
     1694  printer.setOutputFileName(QString(aFilename.c_str()));
    16921695  //  printer.setFullPage ( true);
    16931696  QPainter paint(&printer);
     
    26572660  // launch Qt if not
    26582661  G4Qt* interactorManager = G4Qt::getInstance ();
    2659   G4UImanager* UI = G4UImanager::GetUIpointer();
     2662  // G4UImanager* UI =
     2663  G4UImanager::GetUIpointer();
    26602664#ifdef G4DEBUG_VIS_OGL
    26612665  //  printf("G4OpenGLQtViewer::getParentWidget :: UImanager %d  G4Qt:%d et via GetUIQt:%d---------------------\n",UI,UI->GetSession(),interactorManager,interactorManager->GetUIVisWidget());
  • trunk/source/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r1238 r1240  
    291291}
    292292
     293void G4OpenGLStoredQtViewer::showEvent (QShowEvent * event)
     294{
     295  fHasToRepaint = true;
     296}
     297
    293298/**
    294299 * This function was build in order to make a zoom on double clic event.
Note: See TracChangeset for help on using the changeset viewer.