Ignore:
Timestamp:
Nov 15, 2007, 7:41:15 PM (17 years ago)
Author:
garnier
Message:

r657@mac-90108: laurentgarnier | 2007-11-15 19:44:52 +0100
ajout d un flag pour debug

Location:
trunk/geant4/visualization/OpenGL
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/include/G4OpenGL.hh

    r593 r608  
    2424// ********************************************************************
    2525//
    26 // $Id: G4OpenGL.hh,v 1.5 2007/02/08 14:01:55 allison Exp $
    27 // GEANT4 tag $Name: geant4-09-00-ref-01 $
     26// $Id: G4OpenGL.hh,v 1.6 2007/11/15 10:14:23 allison Exp $
     27// GEANT4 tag $Name: $
    2828//
    2929// G.Barrand.
     30
     31#ifdef G4VIS_BUILD_OPENGL_DRIVER
    3032
    3133#ifndef G4OpenGL_h
     
    4244
    4345#endif
     46
     47#endif
  • trunk/geant4/visualization/OpenGL/include/G4OpenGLBitMapStore.hh

    r607 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLBitMapStore.hh,v 1.1 2007/01/09 10:11:16 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-00-ref-01 $
     27// $Id: G4OpenGLBitMapStore.hh,v 1.2 2007/11/15 10:14:23 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    4040//   glBitmap(size, size, size/2., size/2., 0., 0., circle);
    4141
     42#ifdef G4VIS_BUILD_OPENGL_DRIVER
    4243
    4344#ifndef G4OPENGLBITMAPSTORE_HH
     
    7475
    7576#endif
     77
     78#endif
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLBitMapStore.cc

    r607 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLBitMapStore.cc,v 1.3 2007/04/04 16:50:26 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-00-ref-01 $
     27// $Id: G4OpenGLBitMapStore.cc,v 1.4 2007/11/15 10:14:23 allison Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
    3131// John Allison  6th January 2007
     32
     33#ifdef G4VIS_BUILD_OPENGL_DRIVER
    3234
    3335#include "G4OpenGLBitMapStore.hh"
     
    101103
    102104} // End namespace G4OpenGLBitMapStore.
     105
     106#endif
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateQt.cc

    r593 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLImmediateQt.cc,v 1.1 2007/09/28 14:44:13 lgarnier Exp $
     27// $Id: G4OpenGLImmediateQt.cc,v 1.2 2007/11/15 18:24:28 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5858G4VViewer* G4OpenGLImmediateQt::CreateViewer
    5959(G4VSceneHandler& scene, const G4String& name) {
     60#ifdef GEANT4_QT_DEBUG
    6061  printf("G4OpenGLImmediateQt::CreateViewer \n");
     62#endif
    6163  G4VViewer* pView =
    6264    new G4OpenGLImmediateQtViewer
     
    7678      " new G4OpenGLImmediateQtViewer." << G4endl;
    7779  }
     80#ifdef GEANT4_QT_DEBUG
    7881  printf("G4OpenGLImmediateQt::CreateViewer END \n");
     82#endif
    7983   return pView;
    8084}
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc

    r606 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLImmediateQtViewer.cc,v 1.2 2007/11/13 17:48:51 lgarnier Exp $
     27// $Id: G4OpenGLImmediateQtViewer.cc,v 1.3 2007/11/15 18:24:28 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5353
    5454G4OpenGLImmediateQtViewer::~G4OpenGLImmediateQtViewer() {
     55#ifdef GEANT4_QT_DEBUG
    5556   printf("GLWidget::~GLWidget \n");
     57#endif
    5658     makeCurrent();
     59#ifdef GEANT4_QT_DEBUG
    5760   printf("GLWidget::~GLWidget END\n");
     61#endif
    5862}
    5963
    6064void G4OpenGLImmediateQtViewer::Initialise() {
     65#ifdef GEANT4_QT_DEBUG
    6166   printf("GLWidget::Initialise \n");
     67#endif
     68#ifdef GEANT4_QT_DEBUG
    6269   printf("readyToPaint = false \n");
     70#endif
    6371   readyToPaint = false;
    6472   CreateGLQtContext ();
     73#ifdef GEANT4_QT_DEBUG
    6574   printf("G4OpenGLImmediateQtViewer::Initialise () 2\n");
     75#endif
    6676
    6777  CreateMainWindow (this);
     78#ifdef GEANT4_QT_DEBUG
    6879  printf("G4OpenGLImmediateQtViewer::Initialise () 3\n");
     80#endif
    6981
    7082  CreateFontLists ();  // FIXME Does nothing!
    7183 
     84#ifdef GEANT4_QT_DEBUG
    7285  printf("readyToPaint = true \n");
     86#endif
    7387  readyToPaint = true;
    7488 
    7589  // First Draw
    7690  SetView();
     91#ifdef GEANT4_QT_DEBUG
    7792  printf("    ClearView\n");
     93#endif
    7894  ClearView (); //ok, put the background correct
    7995  ShowView();
     
    85101   InitializeGLView ();
    86102
     103#ifdef GEANT4_QT_DEBUG
    87104   printf("G4OpenGLImmediateQtViewer::InitialiseGL () 1\n");
     105#endif
    88106
    89107   // If a double buffer context has been forced upon us, ignore the
     
    92110   // clear the buffers and window.
    93111   ClearView ();
     112#ifdef GEANT4_QT_DEBUG
    94113   //   printf("G4OpenGLImmediateQtViewer::InitialiseGL () 2\n");
     114#endif
    95115   FinishView ();
    96116   
     
    100120   glDepthMask (GL_TRUE);
    101121
     122#ifdef GEANT4_QT_DEBUG
    102123   printf("G4OpenGLImmediateQtViewer::InitialiseGL  -------------------------------------------------------------------------------------\n");
     124#endif
    103125}
    104126
     
    106128void G4OpenGLImmediateQtViewer::DrawView () {
    107129
     130#ifdef GEANT4_QT_DEBUG
    108131  printf("G4OpenGLImmediateQtViewer::DrawView %d %d   VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n",WinSize_x, WinSize_y);
     132#endif
    109133   // If a double buffer context has been forced upon us, ignore the
    110134   // back buffer for this OpenGLImmediate view.
     
    119143   if(style!=G4ViewParameters::hlr &&
    120144      haloing_enabled) {
     145#ifdef GEANT4_QT_DEBUG
    121146     printf("G4OpenGLImmediateQtViewer::DrawView DANS LE IF\n");
     147#endif
    122148
    123149     HaloingFirstPass ();
     
    133159   ProcessView ();
    134160   FinishView ();
     161#ifdef GEANT4_QT_DEBUG
    135162  printf("G4OpenGLImmediateQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
     163#endif
    136164  readyToPaint = false;
    137165}
     
    144172//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    145173{
     174#ifdef GEANT4_QT_DEBUG
    146175  printf("G4OpenGLImmediateQtViewer::FinishView VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n");
     176#endif
    147177
    148178   glFlush ();
     179#ifdef GEANT4_QT_DEBUG
    149180  printf("G4OpenGLImmediateQtViewer::FinishView ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     181#endif
    150182
    151183}
     
    168200  glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
    169201  glMatrixMode(GL_MODELVIEW);
     202#ifdef GEANT4_QT_DEBUG
    170203  printf("G4OpenGLImmediateQtViewer::resizeGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     204#endif
    171205}
    172206
     
    183217   }
    184218   nbPaint++;
     219#ifdef GEANT4_QT_DEBUG
    185220   printf("\n\nG4OpenGLImmediateQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV %d ready %d\n",nbPaint,readyToPaint);
     221#endif
    186222   WinSize_x = (G4int) width();
    187223   WinSize_y = (G4int) height();
     
    190226
    191227   SetView();
     228#ifdef GEANT4_QT_DEBUG
    192229//   //  printf("before ClearView\n");
     230#endif
     231#ifdef GEANT4_QT_DEBUG
    193232   printf("    ClearView\n");
     233#endif
    194234   
    195235   ClearView (); //ok, put the background correct
     
    198238
    199239
     240#ifdef GEANT4_QT_DEBUG
    200241   printf("G4OpenGLImmediateQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %d ready %d\n\n\n",nbPaint,readyToPaint);
     242#endif
    201243 }
    202244
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r606 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.cc,v 1.6 2007/11/14 11:49:00 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.cc,v 1.7 2007/11/15 18:24:28 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    8282//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    8383{
     84#ifdef GEANT4_QT_DEBUG
    8485  printf("G4OpenGLQtViewer::SetView ++++++++++++++++++++\n");
     86#endif
    8587  //   if(!fHDC) return;
    8688  //   if(!fHGLRC) return;
     
    8890  //  fWindow->makeCurrent();
    8991  G4OpenGLViewer::SetView ();
     92#ifdef GEANT4_QT_DEBUG
    9093  printf("G4OpenGLQtViewer::SetView --------------------\n");
     94#endif
    9195}
    9296
     
    102106//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    103107{
     108#ifdef GEANT4_QT_DEBUG
    104109  printf("G4OpenGLQtViewer::ShowView  +++++++++++++++++++++\n");
     110#endif
    105111  glFlush ();
    106112  if (!GLWindow) {
     
    112118    GLWindow->activateWindow();
    113119#endif
     120#ifdef GEANT4_QT_DEBUG
    114121    printf("G4OpenGLQtViewer::ShowView -----------------------\n");
     122#endif
    115123  }
    116124  //   // Empty the Windows message queue :
     
    130138//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    131139{
     140#ifdef GEANT4_QT_DEBUG
    132141  printf("G4OpenGLQtViewer::CreateGLQtContext \n");
     142#endif
    133143}
    134144
     
    143153
    144154  if(fWindow) return; //Done.
     155#ifdef GEANT4_QT_DEBUG
    145156  printf("G4OpenGLQtViewer::CreateMainWindow glWidget\n");
     157#endif
    146158
    147159  // launch Qt if not
     
    163175      ++it;
    164176      if ((found== false) && (widget->inherits("QMainWindow"))) {
     177#ifdef GEANT4_QT_DEBUG
    165178        printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist\n");
     179#endif
    166180        GLWindow = new QDialog(widget,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax );
    167181        found = true;
     
    172186    foreach (QWidget *widget, QApplication::allWidgets()) {
    173187      if ((found== false) && (widget->inherits("QMainWindow"))) {
     188#ifdef GEANT4_QT_DEBUG
    174189        printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist\n");
     190#endif
    175191        GLWindow = new QDialog(widget,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
    176192        found = true;
     
    180196
    181197    if (found==false) {
     198#ifdef GEANT4_QT_DEBUG
    182199      printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist, but not found\n");
     200#endif
    183201      GLWindow = new QDialog();
    184202    }
    185203  } else {
     204#ifdef GEANT4_QT_DEBUG
    186205    printf("G4OpenGLQtViewer::CreateMainWindow case Qapp exist\n");
     206#endif
    187207    GLWindow = new QDialog();
    188208  }
     
    222242
    223243  if(!fWindow) return;
     244#ifdef GEANT4_QT_DEBUG
    224245  printf("G4OpenGLQtViewer::CreateMainWindow glWidget END\n");
     246#endif
    225247
    226248  if (!fContextMenu)
     
    246268  ,fMouseAction(true)
    247269{
     270#ifdef GEANT4_QT_DEBUG
    248271  printf("G4OpenGLQtViewer::G4OpenGLQtViewer \n");
     272#endif
    249273}
    250274
     
    255279//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    256280{
     281#ifdef GEANT4_QT_DEBUG
    257282  printf("G4OpenGLQtViewer::~G4OpenGLQtViewer \n");
     283#endif
    258284  delete fContextMenu;
    259285}
     
    758784
    759785  updateQWidget();
     786#ifdef GEANT4_QT_DEBUG
    760787  printf("G4OpenGLQtViewer::toggleDrawingAction\n");
     788#endif
    761789}
    762790
     
    782810  fVP.SetRepStyle (style);
    783811
     812#ifdef GEANT4_QT_DEBUG
    784813  printf("G4OpenGLQtViewer::toggleRepresentation 3%d\n",check);
     814#endif
    785815  updateQWidget();
     816#ifdef GEANT4_QT_DEBUG
    786817  printf("G4OpenGLQtViewer::toggleRepresentation 4%d\n",check);
     818#endif
    787819}
    788820
     
    842874
    843875  updateQWidget();
     876#ifdef GEANT4_QT_DEBUG
    844877  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
     878#endif
    845879}
    846880
     
    859893  updateQWidget();
    860894
     895#ifdef GEANT4_QT_DEBUG
    861896  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
     897#endif
    862898}
    863899
     
    875911  updateQWidget();
    876912
     913#ifdef GEANT4_QT_DEBUG
    877914  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
     915#endif
    878916}
    879917
     
    885923  GLWindow->setWindowState(GLWindow->windowState() ^ Qt::WindowFullScreen);
    886924
     925#ifdef GEANT4_QT_DEBUG
    887926  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
     927#endif
    888928}
    889929
     
    899939  }
    900940
     941#ifdef GEANT4_QT_DEBUG
    901942  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
     943#endif
    902944}
    903945
    904946
    905947void G4OpenGLQtViewer::actionControlPanels() {
     948#ifdef GEANT4_QT_DEBUG
    906949  printf("G4OpenGLQtViewer::actionControlPanels \n");
     950#endif
    907951}
    908952
    909953void G4OpenGLQtViewer::actionExitG4() {
     954#ifdef GEANT4_QT_DEBUG
    910955  printf("G4OpenGLQtViewer::actionExitG4() \n");
     956#endif
    911957}
    912958
     
    950996#if QT_VERSION < 0x040000
    951997  nomFich += "."+selectedFilter->lower();
     998#ifdef GEANT4_QT_DEBUG
    952999  printf("G4OpenGLQtViewer::name %s\n",nomFich.ascii());
     1000#endif
    9531001#else
    9541002  nomFich += "."+selectedFilter->toLower();
     1003#ifdef GEANT4_QT_DEBUG
    9551004  printf("G4OpenGLQtViewer::name %s\n",nomFich.toStdString().c_str());
     1005#endif
    9561006#endif
    9571007  G4OpenGLQtExportDialog* exportDialog= new G4OpenGLQtExportDialog(GLWindow,nomFich,fWindow->height(),fWindow->width());
     
    9631013     
    9641014      //      rescaleImage(exportDialog->getWidth(),exportDialog->getHeight());// re-scale image
     1015#ifdef GEANT4_QT_DEBUG
    9651016      printf("rescaling\n");
     1017#endif
    9661018      QGLWidget* glResized = fWindow;
    9671019      fWindow->renderPixmap (exportDialog->getWidth()*2,exportDialog->getHeight()*2 ).save("/Users/laurentgarnier/Desktop/zzz.jpg","jpg");
     
    9691021      //      image = pixmap.toImage();
    9701022      //      glResized->resize(exportDialog->getWidth()*2,exportDialog->getHeight()*2);
     1023#ifdef GEANT4_QT_DEBUG
    9711024      printf("rescaling after\n");
     1025#endif
    9721026      //      image = glResized->grabFrameBuffer();
    9731027     
     
    9801034      // grabFrameBuffer() :: Returns an image of the frame buffer. If withAlpha is true the alpha channel is included.
    9811035      image.save(nomFich,0,exportDialog->getSliderValue());
     1036#ifdef GEANT4_QT_DEBUG
    9821037      printf("saving jpeg quality : %d\n",exportDialog->getSliderValue());
     1038#endif
    9831039    } else if (nomFich.endsWith(".eps")) {
    9841040      generateEPS(nomFich,exportDialog->getNbColor(),image);
     
    9921048               nomFich.endsWith(".xpm")) {
    9931049      image.save(nomFich,0,exportDialog->getSliderValue());
     1050#ifdef GEANT4_QT_DEBUG
    9941051      printf("saving ELSE\n");
     1052#endif
    9951053    } else {
    9961054      G4cerr << "This version of G4UI Could not generate the selected format" << G4endl;
     
    10011059  }
    10021060 
     1061#ifdef GEANT4_QT_DEBUG
    10031062  printf("G4OpenGLQtViewer::actionCreateEPS() \n");
     1063#endif
    10041064}
    10051065
     
    11021162    } else if (mButtons & Qt::RightButton) {
    11031163      // NEVER DONE BECAUSE OF MOUSE MENU
     1164#ifdef GEANT4_QT_DEBUG
    11041165      //       printf("G4OpenGLQtViewer::mouseMoveEvent Right \n");
     1166#endif
    11051167      //       setXRotation(xRot + dy/2);
    11061168      //       setZRotation(zRot + dx/2);
     
    11351197,int aHeight
    11361198){
     1199#ifdef GEANT4_QT_DEBUG
    11371200  printf("should rescale \n");
     1201#endif
    11381202}
    11391203
     
    11511215{
    11521216  // FIXME
     1217#ifdef GEANT4_QT_DEBUG
    11531218  printf("saving EPS\n");
     1219#endif
    11541220
    11551221  FILE* fp;
     
    12441310    */
    12451311  } else if (depth == 8) {
     1312#ifdef GEANT4_QT_DEBUG
    12461313    printf("has 8 bit\n");
     1314#endif
    12471315    for(int y=height-1; y >=0 ; y--) {
    12481316      const uchar * s = aImage.scanLine(y);
     
    12671335#else
    12681336    bool alpha = aImage.hasAlphaChannel();
     1337#ifdef GEANT4_QT_DEBUG
    12691338    printf("has else %d alpha %d\n",depth,alpha);
     1339#endif
    12701340    for(int y=height-1; y >=0 ; y--) {
    12711341      QRgb * s = (QRgb*)(aImage.scanLine(y));
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQt.cc

    r599 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredQt.cc,v 1.2 2007/11/09 15:03:22 lgarnier Exp $
     27// $Id: G4OpenGLStoredQt.cc,v 1.3 2007/11/15 18:24:28 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4848{
    4949  G4OpenGLViewerMessenger::GetInstance();
     50#ifdef GEANT4_QT_DEBUG
    5051  printf("G4OpenGLStoredQt::Create  \n");
     52#endif
    5153}
    5254
     
    5961G4VViewer* G4OpenGLStoredQt::CreateViewer
    6062(G4VSceneHandler& scene, const G4String& name) {
     63#ifdef GEANT4_QT_DEBUG
    6164  printf("G4OpenGLStoredQt::CreateViewer \n");
     65#endif
    6266  G4VViewer* pView =
    6367    new G4OpenGLStoredQtViewer
     
    7781      " new G4OpenGLStoredQtViewer." << G4endl;
    7882  }
     83#ifdef GEANT4_QT_DEBUG
    7984  printf("G4OpenGLStoredQt::CreateViewer END \n");
     85#endif
    8086   return pView;
    8187}
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r606 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredQtViewer.cc,v 1.5 2007/11/14 18:58:59 lgarnier Exp $
     27// $Id: G4OpenGLStoredQtViewer.cc,v 1.6 2007/11/15 18:24:28 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5757
    5858G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer() {
     59#ifdef GEANT4_QT_DEBUG
    5960   printf("GLWidget::~GLWidget \n");
     61#endif
    6062   makeCurrent();
    6163   // this is connect to the Dialog for deleting it properly
    6264   // when close event.
    6365   //   ((QDialog*)window())->reject();
     66#ifdef GEANT4_QT_DEBUG
    6467   printf("GLWidget::~GLWidget END\n");
     68#endif
    6569}
    6670
    6771void G4OpenGLStoredQtViewer::Initialise() {
     72#ifdef GEANT4_QT_DEBUG
    6873   printf("GLWidget::Initialise \n");
     74#endif
    6975   readyToPaint = false;
    7076   CreateGLQtContext ();
     77#ifdef GEANT4_QT_DEBUG
    7178   printf("G4OpenGLStoredQtViewer::Initialise () 2\n");
    72 
     79#endif
    7380  CreateMainWindow (this);
     81#ifdef GEANT4_QT_DEBUG
    7482  printf("G4OpenGLStoredQtViewer::Initialise () 3\n");
    75 
     83#endif
    7684  CreateFontLists ();  // FIXME Does nothing!
    7785 
     86#ifdef GEANT4_QT_DEBUG
    7887  printf("readyToPaint = true \n");
     88#endif
    7989  readyToPaint = true;
    8090 
    8191  // First Draw
    8292  SetView();
     93#ifdef GEANT4_QT_DEBUG
    8394  printf("    ClearView\n");
     95#endif
    8496  ClearView (); //ok, put the background correct
    8597  ShowView();
     
    91103   InitializeGLView ();
    92104
     105#ifdef GEANT4_QT_DEBUG
    93106   printf("G4OpenGLStoredQtViewer::InitialiseGL () 1\n");
     107#endif
    94108
    95109   // clear the buffers and window.
     
    103117   hasToRepaint =true;
    104118
     119#ifdef GEANT4_QT_DEBUG
    105120   printf("G4OpenGLStoredQtViewer::InitialiseGL  -------------------------------------------------------------------------------------\n");
     121#endif
    106122}
    107123
     
    109125void G4OpenGLStoredQtViewer::DrawView () {
    110126
     127#ifdef GEANT4_QT_DEBUG
    111128  printf("G4OpenGLStoredQtViewer::DrawView %d %d   VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n",WinSize_x, WinSize_y);
    112129  printf("G4OpenGLStoredQtViewer::DrawView Dialog adress : %d\n",GLWindow);
     130#endif
    113131   G4ViewParameters::DrawingStyle style = GetViewParameters().GetDrawingStyle();
    114132
     
    131149   if(style!=G4ViewParameters::hlr &&
    132150      haloing_enabled) {
     151#ifdef GEANT4_QT_DEBUG
    133152     printf("G4OpenGLStoredQtViewer::DrawView DANS LE IF\n");
     153#endif
    134154
    135155     HaloingFirstPass ();
     
    143163
    144164   } else {
     165#ifdef GEANT4_QT_DEBUG
    145166     printf("***************************  CASE 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     167#endif
    146168     
    147169     // If kernel visit was needed, drawing and FinishView will already
    148170     // have been done, so...
    149171     if (!kernelVisitWasNeeded) {
     172#ifdef GEANT4_QT_DEBUG
    150173       printf("***************************  CASE 2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     174#endif
    151175       DrawDisplayLists ();
    152176       FinishView ();
    153177     } else {
     178#ifdef GEANT4_QT_DEBUG
    154179       printf("***************************  CASE 3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     180#endif
    155181       // However, union cutaways are implemented in DrawDisplayLists, so make
    156182       // an extra pass...
     
    160186         DrawDisplayLists ();
    161187         FinishView ();
     188#ifdef GEANT4_QT_DEBUG
    162189         printf("***************************  CASE 4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     190#endif
    163191       } else { // ADD TO AVOID KernelVisit=1 and nothing to display
    164192         DrawDisplayLists ();
     
    168196   }
    169197
     198#ifdef GEANT4_QT_DEBUG
    170199   printf("G4OpenGLStoredQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
     200#endif
    171201   hasToRepaint =true;
    172202}
     
    179209//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    180210{
     211#ifdef GEANT4_QT_DEBUG
    181212  printf("G4OpenGLStoredQtViewer::FinishView VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n");
     213#endif
    182214
    183215  glFlush ();
    184216  swapBuffers ();
     217#ifdef GEANT4_QT_DEBUG
    185218  printf("G4OpenGLStoredQtViewer::FinishView ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
     219#endif
    186220
    187221}
     
    205239   WinSize_y = (G4int) aHeight;
    206240
     241#ifdef GEANT4_QT_DEBUG
    207242  printf("G4OpenGLStoredQtViewer::resizeGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %d %d=%d %d=%d\n",hasToRepaint,width(),aWidth,height(),aHeight);
     243#endif
    208244}
    209245
     
    213249 {
    214250   if (!readyToPaint) {
     251#ifdef GEANT4_QT_DEBUG
    215252     printf("G4OpenGLStoredQtViewer::paintGL ============  Not ready %d\n",readyToPaint);
     253#endif
    216254     readyToPaint= true;
    217255     return;
     
    222260   if ( !hasToRepaint) {
    223261     if (((WinSize_x == (G4int)width())) &&(WinSize_y == (G4int) height())) {
     262#ifdef GEANT4_QT_DEBUG
    224263       printf("G4OpenGLStoredQtViewer::paintGL ============  Dont repaint\n");
     264#endif
    225265       return;
    226266     }
    227267   }
    228268   nbPaint++;
     269#ifdef GEANT4_QT_DEBUG
    229270   printf("G4OpenGLStoredQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV %d ready %d\n",nbPaint,readyToPaint);
     271#endif
    230272   WinSize_x = (G4int) width();
    231273   WinSize_y = (G4int) height();
     
    238280
    239281//   //  printf("before ClearView\n");
     282#ifdef GEANT4_QT_DEBUG
    240283   printf("    ClearView\n");
     284#endif
    241285   
    242286   ClearView (); //ok, put the background correct
     
    245289   hasToRepaint =false;
    246290
     291#ifdef GEANT4_QT_DEBUG
    247292   printf("G4OpenGLStoredQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %d ready %d\n",nbPaint,readyToPaint);
     293#endif
    248294 }
    249295
    250296void G4OpenGLStoredQtViewer::mousePressEvent(QMouseEvent *event)
    251297{
     298#ifdef GEANT4_QT_DEBUG
    252299  printf("G4OpenGLStoredQtViewer::mousePressEvent\n");
     300#endif
    253301  G4MousePressEvent(event->pos());
    254302}
     
    256304void G4OpenGLStoredQtViewer::mouseMoveEvent(QMouseEvent *event)
    257305{
     306#ifdef GEANT4_QT_DEBUG
    258307  printf("G4OpenGLStoredQtViewer::mouseMoveEvent\n");
     308#endif
    259309#if QT_VERSION < 0x040000
    260310  G4MouseMoveEvent(event->x(),event->y(),event->button());
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLViewerMessenger.cc

    r599 r608  
    2525//
    2626//
    27 // $Id: G4OpenGLViewerMessenger.cc,v 1.10 2007/11/10 14:51:28 allison Exp $
     27// $Id: G4OpenGLViewerMessenger.cc,v 1.11 2007/11/15 10:14:23 allison Exp $
    2828// GEANT4 tag $Name:  $
     29
     30#ifdef G4VIS_BUILD_OPENGL_DRIVER
    2931
    3032#include "G4OpenGLViewerMessenger.hh"
     
    381383
    382384}
     385
     386#endif
Note: See TracChangeset for help on using the changeset viewer.