Changeset 542


Ignore:
Timestamp:
Jul 10, 2007, 6:15:17 PM (18 years ago)
Author:
garnier
Message:

r688@mac-90108: laurentgarnier | 2007-07-06 18:41:19 +0200
mise a jour de la visu OpenGl. Ne marche pas encore, en version lente

Location:
trunk/geant4/visualization
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc

    r541 r542  
    7777void G4OpenGLImmediateQtViewer::DrawView () {
    7878
    79   printf("G4OpenGLImmediateQtViewer::DrawView %d %d\n",WinSize_x, WinSize_y);
     79  printf("G4OpenGLImmediateQtViewer::DrawView %d %d   VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n",WinSize_x, WinSize_y);
    8080  // If a double buffer context has been forced upon us, ignore the
    8181  // back buffer for this OpenGLImmediate view.
     
    8888  //glXMakeCurrent (dpy, win, cx);
    8989  glViewport (0, 0, WinSize_x, WinSize_y);
    90   printf("******************* 1\n");
    9190
    9291  if(style!=G4ViewParameters::hlr &&
    9392     haloing_enabled) {
    94   printf("******************* 3\n");
    9593
    9694    HaloingFirstPass ();
    97   printf("******************* 4\n");
    9895    NeedKernelVisit ();
    99   printf("******************* 5\n");
    10096    ProcessView ();
    101   printf("******************* 6\n");
    10297    glFlush ();
    103   printf("******************* 7\n");
    10498
    10599    HaloingSecondPass ();
    106   printf("******************* 8\n");
    107100
    108101  }
    109102
    110103  NeedKernelVisit ();  // Always need to visit G4 kernel.
    111   printf("******************* 9\n");
    112104  ProcessView ();
    113   printf("******************* 10\n");
    114105  FinishView ();
    115   printf("G4OpenGLImmediateQtViewer::DrawView %d %d   terminé\n",WinSize_x, WinSize_y);
     106  printf("G4OpenGLImmediateQtViewer::DrawView %d %d ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n",WinSize_x, WinSize_y);
    116107
    117108}
     
    124115//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    125116{
    126   printf("G4OpenGLImmediateQtViewer::FinishView \n");
     117  printf("G4OpenGLImmediateQtViewer::FinishView VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV\n");
    127118  //    if(!fHDC) return;
    128119
    129120  glFlush ();
     121  printf("G4OpenGLImmediateQtViewer::FinishView ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
    130122
    131123  // Empty the Windows message queue :
     
    142134,int height)
    143135{
    144   printf("G4OpenGLImmediateQtViewer::resizeGL \n");
     136  printf("G4OpenGLImmediateQtViewer::resizeGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV \n");
    145137  int side = qMin(width, height);
    146138  glViewport((width - side) / 2, (height - side) / 2, side, side);
     
    149141  glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0);
    150142  glMatrixMode(GL_MODELVIEW);
    151   printf("G4OpenGLImmediateQtViewer::resizeGL terminé \n");
     143  printf("G4OpenGLImmediateQtViewer::resizeGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n");
    152144}
    153145
    154146void G4OpenGLImmediateQtViewer::paintGL()
    155147 {
    156   printf("G4OpenGLImmediateQtViewer::paintGL \n");
     148  printf("G4OpenGLImmediateQtViewer::paintGL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV \n");
    157149  if (!readyToPaint)
    158150    return;
     
    163155  glViewport (0, 0, width(), height());
    164156
    165   ClearView ();
    166   DrawView ();
    167 
     157  SetView();
     158  ClearView (); //ok, put the background correct
     159  float b=3;
     160  for (int a=0;a<100000000;a++) {b = b/3.1456;}
     161  DrawView();
     162  for (int a=0;a<100000000;a++) {b = b/3.1456;}
     163  ShowView();
     164  for (int a=0;a<100000000;a++) {b = b/3.1456;}
     165  //  makeCurrent();
     166  printf("G4OpenGLImmediateQtViewer::paintGL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
    168167  // FIXME
    169168  //  FinishView();
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r541 r542  
    6060//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    6161{
    62   printf("G4OpenGLQtViewer::SetView \n");
     62  printf("G4OpenGLQtViewer::SetView ++++++++++++++++++++\n");
    6363//   if(!fHDC) return;
    6464//   if(!fHGLRC) return;
     
    6666  fWindow->makeCurrent();
    6767  G4OpenGLViewer::SetView (); 
     68  printf("G4OpenGLQtViewer::SetView --------------------\n");
    6869}
    6970
     
    7980//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    8081{
    81   printf("G4OpenGLQtViewer::ShowView \n");
     82  printf("G4OpenGLQtViewer::ShowView  +++++++++++++++++++++\n");
    8283  //   if(!fHDC) return;
    8384  glFlush ();
     85  printf("G4OpenGLQtViewer::ShowView -----------------------\n");
    8486
    8587//   // Empty the Windows message queue :
     
    122124  G4Qt* interactorManager = G4Qt::getInstance ();
    123125  //  G4UImanager* UI = G4UImanager::GetUIpointer();
    124   printf("G4OpenGLQtViewer::CreateMainWindow 3\n");
    125126
    126127  fWindow = new QGLWidget() ;
    127   printf("G4OpenGLQtViewer::CreateMainWindow 4\n");
    128128  fWindow->makeCurrent();
    129   printf("G4OpenGLQtViewer::CreateMainWindow 5\n");
    130129
    131130  // create window
    132   printf("G4OpenGLQtViewer::CreateMainWindow 6\n");
    133131  if (qApp) {
    134132    GLWindow = new QDialog();//qApp->mainWidget());
     
    137135  }
    138136
    139   printf("G4OpenGLQtViewer::CreateMainWindow 7\n");
    140   printf("G4OpenGLQtViewer::CreateMainWindow 8\n");
    141137  QHBoxLayout *mainLayout = new QHBoxLayout;
    142   printf("G4OpenGLQtViewer::CreateMainWindow 9\n");
    143138  mainLayout->addWidget(fWindow);
    144   printf("G4OpenGLQtViewer::CreateMainWindow 10\n");
    145139  GLWindow->setLayout(mainLayout);
    146   printf("G4OpenGLQtViewer::CreateMainWindow 11\n");
    147140  GLWindow->setWindowTitle("QGl Viewer");
    148   printf("G4OpenGLQtViewer::CreateMainWindow 12\n");
    149141  GLWindow->resize(100, 300);
    150142  GLWindow->show();
     
    219211  G4Qt* interactorManager = G4Qt::getInstance ();
    220212  //  G4UImanager* UI = G4UImanager::GetUIpointer();
    221   printf("G4OpenGLQtViewer::CreateMainWindow 3\n");
    222213
    223214  fWindow = glWidget ;
  • trunk/geant4/visualization/management/src/G4VSceneHandler.cc

    r541 r542  
    548548  printf("G4VSceneHandler::ProcessScene 1\n");
    549549  if (state == G4State_Idle) {
     550  printf("G4VSceneHandler::ProcessScene 2 : idle\n");
    550551
    551552    visManager->SetEventRefreshing(true);
     
    553554    if (fRequestedEvent) {
    554555      DrawEvent(fRequestedEvent);
     556      printf("G4VSceneHandler::ProcessScene 3 : fRequestedEvent\n");
    555557
    556558    } else {
     559      printf("G4VSceneHandler::ProcessScene 3 : not fRequestedEvent\n");
    557560
    558561      G4RunManager* runManager = G4RunManager::GetRunManager();
     
    565568        if (fpScene->GetRefreshAtEndOfEvent()) {
    566569
    567           if (verbosity >= G4VisManager::confirmations) {
    568             G4cout << "Refreshing event..." << G4endl;
    569           }
    570           const G4Event* event = 0;
    571           if (events && events->size()) event = events->back();
    572           if (event) DrawEvent(event);
    573 
    574         } else {  // Accumulating events.
    575   printf("G4VSceneHandler::ProcessScene 7\n");
    576 
    577           if (verbosity >= G4VisManager::confirmations) {
    578             G4cout << "Refreshing events in run..." << G4endl;
    579           }
    580           for (size_t i = 0; i < nKeptEvents; ++i) {
    581             const G4Event* event = (*events)[i];
    582             if (event) DrawEvent(event);
    583           }
    584 
    585           if (!fpScene->GetRefreshAtEndOfRun()) {
    586             if (verbosity >= G4VisManager::warnings) {
    587               G4cout <<
    588                 "WARNING: Cannot refresh events accumulated over more"
    589                 "\n  than one runs.  Refreshed just the last run..."
    590                      << G4endl;
    591             }
    592           }
     570          printf("G4VSceneHandler::ProcessScene 4 : fpScene->GetRefreshAtEndOfEvent()\n");
     571//        if (verbosity >= G4VisManager::confirmations) {
     572//          G4cout << "Refreshing event..." << G4endl;
     573//        }
     574//        const G4Event* event = 0;
     575//        if (events && events->size()) event = events->back();
     576//        if (event) DrawEvent(event);
     577
     578//      } else {  // Accumulating events.
     579//   printf("G4VSceneHandler::ProcessScene 7\n");
     580
     581//        if (verbosity >= G4VisManager::confirmations) {
     582//          G4cout << "Refreshing events in run..." << G4endl;
     583//        }
     584//        for (size_t i = 0; i < nKeptEvents; ++i) {
     585//          const G4Event* event = (*events)[i];
     586//          if (event) DrawEvent(event);
     587//        }
     588
     589//        if (!fpScene->GetRefreshAtEndOfRun()) {
     590//          if (verbosity >= G4VisManager::warnings) {
     591//            G4cout <<
     592//              "WARNING: Cannot refresh events accumulated over more"
     593//              "\n  than one runs.  Refreshed just the last run..."
     594//                   << G4endl;
     595//          }
     596//        }
    593597        }
    594598      }
Note: See TracChangeset for help on using the changeset viewer.