Changeset 725 for trunk/geant4
- Timestamp:
- Feb 14, 2008, 12:02:14 PM (17 years ago)
- Location:
- trunk/geant4/visualization/OpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r724 r725 146 146 QAction *fDrawingLineSurfaceRemoval; 147 147 148 /** vector to store images in order to put them on disk after */149 std::vector <QImage> fVideoVector;150 151 148 private slots : 152 149 void actionMouseRotate(); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r724 r725 1285 1285 bool res = false; 1286 1286 1287 if (fVideoVector.size() <30) { 1288 fVideoVector.push_back(image); 1289 G4cerr << "Store image " <<fVideoVector.size()<<"\n" << G4endl; 1290 return; 1291 } else { 1292 for (int a=0;a<30;a++) { 1293 G4cerr << "Saving image " <<a <<"\n"<< G4endl; 1294 printf("Saving image %d\n",a ); 1295 nomFich = QString("/temp/Test")+QString::number(fRecordFrameNumber); 1296 nomFich += "."+QString("ppm"); 1297 #if QT_VERSION < 0x040000 1298 res = fVideoVector[a].save(nomFich,"ppm"); 1299 #else 1300 res = fVideoVector[a].save(nomFich,0); 1301 #endif 1302 if (res == false) { 1303 #if QT_VERSION < 0x040000 1304 G4cerr << "Error while saving file... "<<nomFich.ascii()<<"\n" << G4endl; 1305 #else 1306 G4cerr << "Error while saving file... "<<nomFich.toStdString().c_str()<<"\n" << G4endl; 1307 #endif 1308 fRecordFrames = false; 1309 } 1310 fRecordFrameNumber++; 1311 } 1312 fVideoVector.clear(); 1313 fVideoVector.resize(0); 1314 } 1287 nomFich += "."+QString("ppm"); 1288 #if QT_VERSION < 0x040000 1289 res = image.save(nomFich,"ppm"); 1290 #else 1291 res = image.save(nomFich,0); 1292 #endif 1293 if (res == false) { 1294 #if QT_VERSION < 0x040000 1295 G4cerr << "Error while saving file... "<<nomFich.ascii()<<"\n" << G4endl; 1296 #else 1297 G4cerr << "Error while saving file... "<<nomFich.toStdString().c_str()<<"\n" << G4endl; 1298 #endif 1299 fRecordFrames = false; 1300 } 1301 1302 #if QT_VERSION < 0x040000 1303 printf("SaveForVideo ^^^^^^^^^^^^^^^^^^^^^^^^ %s\n",nomFich.ascii()); 1304 #else 1305 printf("SaveForVideo ^^^^^^^^^^^^^^^^^^^^^^^^ %s\n",nomFich.toStdString().c_str()); 1306 #endif 1315 1307 } 1316 1308 -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
r724 r725 201 201 if (fRecordFrames) { 202 202 saveForVideo(QString("/temp/Test")+QString::number(fRecordFrameNumber)); 203 //fRecordFrameNumber++;203 fRecordFrameNumber++; 204 204 #ifdef GEANT4_QT_DEBUG 205 205 printf("G4OpenGLStoredQtViewer::record frame %d\n",fRecordFrameNumber);
Note: See TracChangeset
for help on using the changeset viewer.