Changeset 748 for trunk/geant4/visualization
- Timestamp:
- Mar 7, 2008, 12:52:36 PM (16 years ago)
- Location:
- trunk/geant4/visualization/OpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r747 r748 79 79 QString getSaveFileName(); 80 80 bool isRecording(); 81 bool isStopped(); 81 82 bool isReadyToEncode(); 82 83 bool encodeVideo(); … … 114 115 private: 115 116 enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4}; 116 enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP, ENCODE};117 enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,ENCODE}; 117 118 118 119 void createPopupMenu(); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc
r747 r748 96 96 97 97 fEncoderStatus = new QLabel(encoderGroupBox); 98 fEncoderStatus->setWordWrap(true); 98 99 fEncoderStatus->setText(""); 99 100 … … 132 133 133 134 fTempFolderStatus = new QLabel(tempFolderGroupBox); 135 fTempFolderStatus->setWordWrap(true); 134 136 fTempFolderStatus->setText(""); 135 137 … … 170 172 171 173 fSaveFileStatus = new QLabel(saveFileGroupBox); 174 fSaveFileStatus->setWordWrap(true); 172 175 fSaveFileStatus->setText(""); 173 176 … … 202 205 203 206 fRecordingStatus = new QLabel(statusGroupBox); 204 setRecordingStatus("");207 fRecordingStatus->setWordWrap(true); 205 208 QPalette palette( fRecordingStatus->palette() ); 206 209 palette.setColor( QPalette::Text, Qt::green); … … 208 211 209 212 fRecordingInfos = new QLabel(statusGroupBox); 213 fRecordingInfos->setWordWrap(true); 210 214 setRecordingInfos(""); 211 215 … … 261 265 262 266 // fill 267 setRecordingStatus(""); 263 268 fEncoderPath->setText(fParentViewer->getEncoderPath()); 264 269 fTempFolderPath->setText(fParentViewer->getTempFolderPath()); 265 270 266 271 if (fParentViewer->getEncoderPath() == "") { 267 setRecordingInfos("mpeg_encode is needed to encode in video format. \nIt is available here: \nhttp://bmrc.berkeley.edu/frame/research/mpeg/");272 setRecordingInfos("mpeg_encode is needed to encode in video format. It is available here: http://bmrc.berkeley.edu/frame/research/mpeg/"); 268 273 } 269 274 … … 319 324 // set state of encode button 320 325 // if frames had been generated and parameters are valid : enabled encode button 321 if (checkEncoderParameters(fEncoderPath->text()) 322 && checkTempFolderParameters(fTempFolderPath->text()) 323 && checkSaveFileNameParameters(fSaveFileName->text())) { 324 if (fParentViewer->isReadyToEncode()) { 326 bool status = checkEncoderParameters(fEncoderPath->text()) 327 & checkTempFolderParameters(fTempFolderPath->text()) 328 & checkSaveFileNameParameters(fSaveFileName->text()); 329 if (status) { 330 if (fParentViewer->isStopped()) { 325 331 if (fParentViewer->generateMpegEncoderParameters()) { 326 fButtonEncode->setEnabled(fParentViewer-> ;;isReadyToEncode() );327 328 332 fButtonEncode->setEnabled(fParentViewer->isReadyToEncode() ); 333 } 334 } 329 335 } 330 336 } … … 346 352 palette.setColor( QPalette::Base, Qt::red); 347 353 if (fParentViewer->isReadyToEncode()) { 348 setRecordingInfos("No valid encode defined, screen \ncapture are saved in the\ntemp folder in ppm format.Please define a encoder and clic on Apply button");354 setRecordingInfos("No valid encode defined, screen capture had been saved in the temp folder in ppm format.\nPlease define a encoder and clic on Apply button"); 349 355 } 350 356 status = false; … … 352 358 palette.setColor( QPalette::Base, Qt::white); 353 359 fEncoderPath->setText(fParentViewer->getEncoderPath()); 354 if (fParentViewer->getEncoderPath() == "") {355 setRecordingInfos("mpeg_encode is needed to encode in video format.\nIt is available here: \nhttp://bmrc.berkeley.edu/frame/research/mpeg/");356 status = false;357 }358 360 } 359 361 fEncoderPath->setPalette(palette); … … 409 411 410 412 void G4OpenGLQtMovieDialog::setRecordingStatus(QString txt) { 413 fButtonEncode->setEnabled(fParentViewer->isReadyToEncode()); 411 414 fRecordingStatus->setText(txt); 412 415 } -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r747 r748 843 843 { 844 844 if (!GLWindow) { 845 G4cerr << "Visualization window not defined, please choose one before \n" << G4endl;845 G4cerr << "Visualization window not defined, please choose one before" << G4endl; 846 846 } else { 847 847 … … 1014 1014 void G4OpenGLQtViewer::showShortcuts() { 1015 1015 if (fMouseAction == STYLE1) { // rotate 1016 G4cout << "Click and move mouse to rotate volume \n" << G4endl;1017 G4cout << "Press left/right arrows to move volume left/right \n" << G4endl;1018 G4cout << "Press up/down arrows to move volume up/down \n" << G4endl;1019 G4cout << "Press ALT+up/down arrows to move volume toward/forward \n" << G4endl;1020 G4cout << "Press SHIFT+left/right arrows to rotate volume left/right \n" << G4endl;1021 G4cout << "Press SHIFT+up/down arrows to rotate volume up/down \n" << G4endl;1022 G4cout << "Press ALT+/- to slow/speed auto rotation/move \n" << G4endl;1023 G4cout << "In video mode : \n" << G4endl;1024 G4cout << " Press SPACE to Start/Pause video recording \n" << G4endl;1025 G4cout << " Press RETURN to Stop video recording \n" << G4endl;1016 G4cout << "Click and move mouse to rotate volume " << G4endl; 1017 G4cout << "Press left/right arrows to move volume left/right" << G4endl; 1018 G4cout << "Press up/down arrows to move volume up/down" << G4endl; 1019 G4cout << "Press ALT+up/down arrows to move volume toward/forward" << G4endl; 1020 G4cout << "Press SHIFT+left/right arrows to rotate volume left/right" << G4endl; 1021 G4cout << "Press SHIFT+up/down arrows to rotate volume up/down" << G4endl; 1022 G4cout << "Press ALT+/- to slow/speed auto rotation/move" << G4endl; 1023 G4cout << "In video mode : " << G4endl; 1024 G4cout << " Press SPACE to Start/Pause video recording " << G4endl; 1025 G4cout << " Press RETURN to Stop video recording " << G4endl; 1026 1026 } else if (fMouseAction == STYLE2) { //move 1027 G4cout << "Move camera point of view with mouse \n" << G4endl;1028 G4cout << "Press left/right arrows to move volume left/right \n" << G4endl;1029 G4cout << "Press up/down arrows to move volume up/down \n" << G4endl;1030 G4cout << "Press ALT+up/down arrows to move volume toward/forward \n" << G4endl;1031 G4cout << "Press SHIFT+left/right arrows to rotate volume left/right \n" << G4endl;1032 G4cout << "Press SHIFT+up/down arrows to rotate volume up/down \n" << G4endl;1033 G4cout << "Press +/- to zoom into volume \n" << G4endl;1034 G4cout << "Press ALT+/- to slow/speed auto rotation/move \n" << G4endl;1035 G4cout << "In video mode : \n" << G4endl;1036 G4cout << " Press SPACE to Start/Pause video recording \n" << G4endl;1037 G4cout << " Press RETURN to Stop video recording \n" << G4endl;1027 G4cout << "Move camera point of view with mouse" << G4endl; 1028 G4cout << "Press left/right arrows to move volume left/right" << G4endl; 1029 G4cout << "Press up/down arrows to move volume up/down" << G4endl; 1030 G4cout << "Press ALT+up/down arrows to move volume toward/forward" << G4endl; 1031 G4cout << "Press SHIFT+left/right arrows to rotate volume left/right" << G4endl; 1032 G4cout << "Press SHIFT+up/down arrows to rotate volume up/down" << G4endl; 1033 G4cout << "Press +/- to zoom into volume" << G4endl; 1034 G4cout << "Press ALT+/- to slow/speed auto rotation/move" << G4endl; 1035 G4cout << "In video mode : " << G4endl; 1036 G4cout << " Press SPACE to Start/Pause video recording " << G4endl; 1037 G4cout << " Press RETURN to Stop video recording " << G4endl; 1038 1038 } else if (fMouseAction == STYLE3) { //pick 1039 G4cout << "Click and pick \n" << G4endl;1039 G4cout << "Click and pick " << G4endl; 1040 1040 } 1041 1041 … … 1189 1189 * G4UnitDefinition::GetValueOf(unitParam->GetDefaultValue()); 1190 1190 if (defaultValue > 89.5 || defaultValue <= 0.0) { 1191 G4cerr << "Field half angle should be 0 < angle <= 89.5 degrees. Check your default Field half angle parameter \n";1191 G4cerr << "Field half angle should be 0 < angle <= 89.5 degrees. Check your default Field half angle parameter"; 1192 1192 } else { 1193 G4cout << "Perspective view has been set to default value. Field half angle="<<angleParam->GetDefaultValue() <<" \n" << G4endl;1193 G4cout << "Perspective view has been set to default value. Field half angle="<<angleParam->GetDefaultValue() <<" " << G4endl; 1194 1194 fVP.SetFieldHalfAngle (defaultValue); 1195 1195 SetView (); … … 1296 1296 GLWindow->setWindowState(GLWindow->windowState() ^ Qt::WindowFullScreen); 1297 1297 #else 1298 G4cerr << "This version of Qt could not do fullScreen. Resizing the widget is the only solution available. \n" << G4endl;1298 G4cerr << "This version of Qt could not do fullScreen. Resizing the widget is the only solution available." << G4endl; 1299 1299 #endif 1300 1300 } … … 1382 1382 (exportDialog->getHeight() !=fWindow->height())) { 1383 1383 if (format != QString("eps")) { 1384 G4cerr << "Export->Change Size : This function is not implemented, to export in another size, please resize your frame to what you need \n" << G4endl;1384 G4cerr << "Export->Change Size : This function is not implemented, to export in another size, please resize your frame to what you need" << G4endl; 1385 1385 1386 1386 // rescaleImage(exportDialog->getWidth(),exportDialog->getHeight());// re-scale image … … 1428 1428 #endif 1429 1429 } else { 1430 G4cerr << "This version of G4UI Could not generate the selected format \n" << G4endl;1430 G4cerr << "This version of G4UI Could not generate the selected format" << G4endl; 1431 1431 } 1432 1432 if (res == false) { 1433 1433 #if QT_VERSION < 0x040000 1434 G4cerr << "Error while saving file... "<<nomFich.ascii()<<" \n" << G4endl;1435 #else 1436 G4cerr << "Error while saving file... "<<nomFich.toStdString().c_str()<< "\n" <<G4endl;1434 G4cerr << "Error while saving file... "<<nomFich.ascii()<<"" << G4endl; 1435 #else 1436 G4cerr << "Error while saving file... "<<nomFich.toStdString().c_str()<< G4endl; 1437 1437 #endif 1438 1438 } else { 1439 1439 #if QT_VERSION < 0x040000 1440 G4cout << "File "<<nomFich.ascii()<<" has been saved \n" << G4endl;1441 #else 1442 G4cout << "File "<<nomFich.toStdString().c_str()<<" has been saved \n" << G4endl;1440 G4cout << "File "<<nomFich.ascii()<<" has been saved " << G4endl; 1441 #else 1442 G4cout << "File "<<nomFich.toStdString().c_str()<<" has been saved " << G4endl; 1443 1443 #endif 1444 1444 } … … 1769 1769 } else { 1770 1770 #if QT_VERSION < 0x040000 1771 G4cerr << "Could not open "<< aFilename.ascii() <<"\n"<< G4endl;1772 #else 1773 G4cerr << "Could not open "<< aFilename.toStdString().c_str() <<"\n"<< G4endl;1771 G4cerr << "Could not open "<< aFilename.ascii() << G4endl; 1772 #else 1773 G4cerr << "Could not open "<< aFilename.toStdString().c_str() << G4endl; 1774 1774 #endif 1775 1775 } … … 1953 1953 paint.end(); 1954 1954 #else 1955 G4cerr << "This fonction is only supported on Mac OsX or X11 with Qt3. Full platform supported with Qt4 \n" << G4endl;1955 G4cerr << "This fonction is only supported on Mac OsX or X11 with Qt3. Full platform supported with Qt4" << G4endl; 1956 1956 #endif 1957 1957 #else … … 2155 2155 tmp = createTempFolder(); 2156 2156 if (tmp != "") { 2157 setRecordingInfos("Can't create temp folder. \n"+tmp);2157 setRecordingInfos("Can't create temp folder."+tmp); 2158 2158 return; 2159 2159 } … … 2190 2190 } else if (step == STOP) { 2191 2191 txt = "Stop Recording..."; 2192 } else if (step == READY_TO_ENCODE) { 2193 txt = "Ready to Encode..."; 2192 2194 } else if (step == ENCODE) { 2193 2195 txt = "Encoding..."; … … 2280 2282 } 2281 2283 2284 bool G4OpenGLQtViewer::isStopped(){ 2285 if (fRecordingStep == STOP) { 2286 return true; 2287 } 2288 return false; 2289 } 2290 2282 2291 2283 2292 bool G4OpenGLQtViewer::isReadyToEncode(){ 2284 if (fRecordingStep == STOP) {2293 if (fRecordingStep == READY_TO_ENCODE) { 2285 2294 return true; 2286 2295 } … … 2342 2351 QDir dir = fileInfo->absoluteDir(); 2343 2352 if (!dir.exists()) { 2344 return "Folder does not exist \n";2353 return "Folder does not exist"; 2345 2354 } 2346 2355 … … 2386 2395 // check if it is already present 2387 2396 if (d->exists(path)) { 2388 return "Folder "+path+" already exists. \nPlease remove it first";2397 return "Folder "+path+" already exists.Please remove it first"; 2389 2398 } 2390 2399 if (d->mkdir(fTempFolderPath+path)) { … … 2392 2401 return ""; 2393 2402 } else { 2394 return "Can't create "+fTempFolderPath+path +"\n";2403 return "Can't create "+fTempFolderPath+path; 2395 2404 } 2396 2405 return "-"; … … 2418 2427 res = false; 2419 2428 QString file = fMovieTempFolderPath+currentFile; 2420 error +="Removing file failed : "+file +"\n";2429 error +="Removing file failed : "+file; 2421 2430 } 2422 2431 } … … 2425 2434 return ""; 2426 2435 } else { 2427 return "Dir "+fMovieTempFolderPath+" should be empty, \nbut could not remove it";2428 } 2429 2430 } 2431 return "Could not remove "+fMovieTempFolderPath+" because \nof the following errors :"+error;2436 return "Dir "+fMovieTempFolderPath+" should be empty, but could not remove it"; 2437 } 2438 2439 } 2440 return "Could not remove "+fMovieTempFolderPath+" because of the following errors :"+error; 2432 2441 } 2433 2442 … … 2631 2640 2632 2641 setRecordingInfos("Parameter file "+fParameterFileName+" generated in "+fMovieTempFolderPath); 2633 setRecordingStatus( ENCODE);2642 setRecordingStatus(READY_TO_ENCODE); 2634 2643 return true; 2635 2644 }
Note: See TracChangeset
for help on using the changeset viewer.