- Timestamp:
- Dec 22, 2010, 11:33:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r1340 r1346 195 195 if (!fContextMenu) 196 196 createPopupMenu(); 197 198 //dummy call to init Text display list 199 drawText("",0,0,0,10); 197 200 198 201 } … … 274 277 275 278 279 void 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 276 300 /** 277 301 Create a popup menu for the widget. This menu is activated by right-mouse click … … 1474 1498 { 1475 1499 glFlush (); 1476 1477 1500 // L. Garnier 10/2009 : Not necessary and cause problems on mac OS X 10.6 1478 1501 // fWindow->swapBuffers (); … … 1517 1540 // try to addapt speed move/rotate looking to drawing speed 1518 1541 float correctionFactor = 5; 1542 float globalTime = 0; 1543 float globalRun = 0; 1519 1544 while (fAutoMove) { 1520 1545 if ( lastMoveTime.elapsed () >= (int)(1000/fNbMaxFramesPerSec)) { … … 1552 1577 moveScene(-((float)delta.x())/correctionFactor,-((float)delta.y())/correctionFactor,0,true); 1553 1578 } 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 1554 1584 lastMoveTime.start(); 1555 1585 }
Note: See TracChangeset
for help on using the changeset viewer.