Ignore:
Timestamp:
Dec 22, 2010, 11:33:38 AM (14 years ago)
Author:
garnier
Message:

before tag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1340 r1346  
    195195  if (!fContextMenu)
    196196    createPopupMenu();
     197
     198  //dummy call to init Text display list
     199  drawText("",0,0,0,10);
    197200
    198201}
     
    274277
    275278
     279void G4OpenGLQtViewer::drawText(const char * textString,int x,int y,int z, int size) {
     280  if (!fWindow)
     281    return;
     282  QFont font = QFont();
     283  font.setPointSize(size);
     284
     285  // gl2ps or GL window ?
     286  int fontsize=font.pixelSize();
     287  if(font.pointSize() > fontsize) {
     288    fontsize = font.pointSize();
     289  }
     290#ifdef G4DEBUG_VIS_OGL
     291    printf("G4OpenGLQtViewer::drawText :: renderText.............. \n");
     292#endif
     293  if (! drawGl2psText(textString,fontsize)) {
     294    fWindow->renderText(x,y,z, textString,font);
     295  }
     296}
     297
     298
     299
    276300/**
    277301   Create a popup menu for the widget. This menu is activated by right-mouse click
     
    14741498{
    14751499  glFlush ();
    1476 
    14771500  // L. Garnier 10/2009 : Not necessary and cause problems on mac OS X 10.6
    14781501  //  fWindow->swapBuffers ();
     
    15171540    // try to addapt speed move/rotate looking to drawing speed
    15181541    float correctionFactor = 5;
     1542    float globalTime = 0;
     1543    float globalRun = 0;
    15191544    while (fAutoMove) {
    15201545      if ( lastMoveTime.elapsed () >= (int)(1000/fNbMaxFramesPerSec)) {
     
    15521577          moveScene(-((float)delta.x())/correctionFactor,-((float)delta.y())/correctionFactor,0,true);
    15531578        }
     1579        //#ifdef G4DEBUG_VIS_OGL
     1580        globalTime += (float)lastMoveTime.elapsed ();
     1581        globalRun +=1;
     1582        printf("G4OpenGLQtViewer::CreateMainWindow :: time/per run :%f run:%f %f\n",globalTime/globalRun,globalRun,globalTime);
     1583        //#endif
    15541584        lastMoveTime.start();
    15551585      }
Note: See TracChangeset for help on using the changeset viewer.