Changeset 754 for trunk/geant4
- Timestamp:
- Mar 11, 2008, 5:35:07 PM (17 years ago)
- Location:
- trunk/geant4/visualization/OpenGL
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh
r751 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLQtMovieDialog.hh,v 1. 5 2008/01/30 10:54:13lgarnier Exp $27 // $Id: G4OpenGLQtMovieDialog.hh,v 1.1 2008/03/10 16:57:04 lgarnier Exp $ 28 28 // GEANT4 tag $Name: 29 29 // -
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r752 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.hh,v 1. 7 2008/01/30 10:54:13lgarnier Exp $27 // $Id: G4OpenGLQtViewer.hh,v 1.9 2008/03/11 16:05:56 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 134 134 void setRecordingStatus(RECORDING_STEP); 135 135 void setRecordingInfos(QString); 136 QString getProcessErrorMsg(); 136 137 137 138 … … 205 206 void toggleAux(bool); 206 207 void toggleFullScreen(bool); 207 void processFinished(int); 208 void processStdout(); 208 void processEncodeFinished(); 209 void processLookForFinished(); 210 void processEncodeStdout(); 209 211 // Only use for Qt>4.0 210 212 // void dialogClosed(); -
trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh
r712 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLViewer.hh,v 1.2 1 2007/11/10 14:50:01 allisonExp $27 // $Id: G4OpenGLViewer.hh,v 1.22 2008/03/10 16:57:04 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc
r688 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLImmediateSceneHandler.cc,v 1.2 8 2008/01/04 22:07:01 allisonExp $27 // $Id: G4OpenGLImmediateSceneHandler.cc,v 1.29 2008/02/18 08:53:49 asaim Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 171 171 glPushMatrix(); 172 172 glLoadIdentity(); 173 glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX); 173 ////// glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX); 174 glOrtho (-1., 1., -1., 1., -1., 1.); 174 175 glMatrixMode (GL_MODELVIEW); 175 176 glPushMatrix(); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc
r734 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLQtExportDialog.cc,v 1. 6 2008/01/30 10:54:13lgarnier Exp $27 // $Id: G4OpenGLQtExportDialog.cc,v 1.7 2008/03/10 16:57:04 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc
r752 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLQtMovieDialog.cc,v 1. 6 2008/02/15 10:54:13lgarnier Exp $27 // $Id: G4OpenGLQtMovieDialog.cc,v 1.3 2008/03/11 16:05:56 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // 30 30 // 31 31 32 #define GEANT4_QT_DEBUG32 //#define GEANT4_QT_DEBUG 33 33 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER 34 34 … … 70 70 fParentViewer(parentViewer) 71 71 { 72 #if QT_VERSION > 0x030200 72 73 setModal(false); 74 #endif 73 75 #if QT_VERSION < 0x040000 74 76 setCaption( tr( " Movie parameters" )); … … 96 98 97 99 fEncoderStatus = new QLabel(encoderGroupBox); 100 101 #if QT_VERSION > 0x040000 98 102 fEncoderStatus->setWordWrap(true); 103 #else 104 fEncoderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak ); 105 #endif 106 99 107 fEncoderStatus->setText(""); 100 108 … … 133 141 134 142 fTempFolderStatus = new QLabel(tempFolderGroupBox); 143 #if QT_VERSION > 0x040000 135 144 fTempFolderStatus->setWordWrap(true); 145 #else 146 fTempFolderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak ); 147 #endif 136 148 fTempFolderStatus->setText(""); 137 149 … … 172 184 173 185 fSaveFileStatus = new QLabel(saveFileGroupBox); 186 #if QT_VERSION > 0x040000 174 187 fSaveFileStatus->setWordWrap(true); 188 #else 189 fSaveFileStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak ); 190 #endif 175 191 fSaveFileStatus->setText(""); 176 192 … … 198 214 // label 199 215 200 QLabel *infoLabel = new QLabel(" Press SPACE to Start/Pause video recording \n Press RETURN to Stop video recording" );216 QLabel *infoLabel = new QLabel(" Press SPACE to Start/Pause video recording \n Press RETURN to Stop video recording",this); 201 217 202 218 // global status … … 205 221 206 222 fRecordingStatus = new QLabel(statusGroupBox); 223 #if QT_VERSION > 0x040000 207 224 fRecordingStatus->setWordWrap(true); 225 #else 226 fRecordingStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak ); 227 #endif 208 228 QPalette palette( fRecordingStatus->palette() ); 229 #if QT_VERSION > 0x040000 209 230 palette.setColor( QPalette::Text, Qt::green); 231 #else 232 palette.setColor( QColorGroup::Text, Qt::green); 233 #endif 210 234 fRecordingStatus->setPalette(palette); 211 235 212 236 fRecordingInfos = new QLabel(statusGroupBox); 237 #if QT_VERSION > 0x040000 213 238 fRecordingInfos->setWordWrap(true); 239 #else 240 fRecordingInfos->setAlignment ( Qt::AlignAuto |Qt::WordBreak ); 241 #endif 214 242 setRecordingInfos(""); 215 243 … … 298 326 void G4OpenGLQtMovieDialog::selectEncoderPathAction() 299 327 { 328 #if QT_VERSION < 0x040000 329 QString nomFich = QFileDialog::getOpenFileName ( ".", 330 NULL, 331 this, 332 "Select your encoder", 333 tr("Select your encoder ...")); 334 #else 300 335 QString nomFich = QFileDialog::getOpenFileName ( this, 301 336 "Select your encoder", 302 337 tr("Select your encoder ...")); 338 339 #endif 340 303 341 if (nomFich == "") { 304 342 return; … … 311 349 void G4OpenGLQtMovieDialog::selectTempPathAction() 312 350 { 351 #if QT_VERSION < 0x040000 352 QString nomFich = QFileDialog::getOpenFileName ( ".", 353 NULL, 354 this, 355 "Select temporary folder", 356 tr("Select temporary folder ...")); 357 #else 313 358 QString nomFich = QFileDialog::getOpenFileName ( this, 314 359 "Select temporary folder", 315 360 tr("Select temporary folder ...")); 361 362 #endif 316 363 if (nomFich == "") { 317 364 return; … … 324 371 void G4OpenGLQtMovieDialog::selectSaveFileNameAction() 325 372 { 373 #if QT_VERSION < 0x040000 374 QString nomFich = QFileDialog::getSaveFileName ( ".", 375 NULL, 376 this, 377 "Select saved file", 378 tr("Select saved file ...")); 379 #else 326 380 QString nomFich = QFileDialog::getSaveFileName ( this, 327 381 "Select saved file", 328 382 tr("Select saved file ...")); 383 384 #endif 329 385 if (nomFich == "") { 330 386 return; … … 372 428 fEncoderStatus->setText(temp); 373 429 if (temp != "") { 430 #if QT_VERSION > 0x040000 374 431 palette.setColor( QPalette::Base, Qt::red); 432 #else 433 palette.setColor( QColorGroup::Base, Qt::red); 434 #endif 375 435 if (fParentViewer->isReadyToEncode()) { 376 436 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"); … … 378 438 status = false; 379 439 } else { 440 #if QT_VERSION > 0x040000 380 441 palette.setColor( QPalette::Base, Qt::white); 442 #else 443 palette.setColor( QColorGroup::Base, Qt::white); 444 #endif 381 445 fEncoderPath->setText(fParentViewer->getEncoderPath()); 382 446 } … … 398 462 fTempFolderStatus->setText(temp); 399 463 if (temp != "") { 464 #if QT_VERSION > 0x040000 400 465 palette.setColor( QPalette::Base, Qt::red); 466 #else 467 palette.setColor( QColorGroup::Base, Qt::red); 468 #endif 401 469 status = false; 402 470 } else { 471 #if QT_VERSION > 0x040000 403 472 palette.setColor( QPalette::Base, Qt::white); 473 #else 474 palette.setColor( QColorGroup::Base, Qt::white); 475 #endif 404 476 fTempFolderPath->setText(fParentViewer->getTempFolderPath()); 405 477 } … … 421 493 fSaveFileStatus->setText(temp); 422 494 if (temp != "") { 495 #if QT_VERSION > 0x040000 423 496 palette.setColor( QPalette::Base, Qt::red); 497 #else 498 palette.setColor( QColorGroup::Base, Qt::red); 499 #endif 424 500 status = false; 425 501 } else { 502 #if QT_VERSION > 0x040000 426 503 palette.setColor( QPalette::Base, Qt::white); 504 #else 505 palette.setColor( QColorGroup::Base, Qt::white); 506 #endif 427 507 fSaveFileName->setText(fParentViewer->getSaveFileName()); 428 508 } -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r753 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.cc,v 1.1 0 2008/01/30 10:54:13lgarnier Exp $27 // $Id: G4OpenGLQtViewer.cc,v 1.15 2008/03/11 16:31:09 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 36 36 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER 37 37 38 #define GEANT4_QT_DEBUG38 //#define GEANT4_QT_DEBUG 39 39 40 40 #include "G4OpenGLQtViewer.hh" … … 308 308 ,fMovieParametersDialog(NULL) 309 309 ,fRecordingStep(WAIT) 310 310 ,fProcess(NULL) 311 311 { 312 312 … … 324 324 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 325 325 { 326 #if QT_VERSION < 0x040000 327 G4cout <<removeTempFolder().ascii() <<G4endl; 328 #else 326 329 G4cout <<removeTempFolder().toStdString().c_str() <<G4endl; 330 #endif 331 327 332 #ifdef GEANT4_QT_DEBUG 328 333 printf("G4OpenGLQtViewer::~G4OpenGLQtViewer \n"); … … 2237 2242 2238 2243 //look for encoderPath 2239 QProcess search; 2240 search.setReadChannelMode(QProcess::MergedChannels); 2241 search.start ("which mpeg_encode"); 2242 2243 if (search.waitForFinished()) { 2244 fEncoderPath = QString(QString::fromLocal8Bit(search.readAll())).trimmed(); 2245 // if not found, return "not found" 2246 if (fEncoderPath.contains(" ")) { 2247 fEncoderPath = ""; 2248 } else if (!fEncoderPath.contains("mpeg_encode")) { 2249 fEncoderPath = ""; 2250 } 2251 } 2252 setEncoderPath(fEncoderPath); 2253 // init temp folder 2254 setTempFolderPath(QDir::temp ().absolutePath ()); 2244 fProcess = new QProcess(); 2245 2246 #if QT_VERSION < 0x040000 2247 QObject ::connect(fProcess,SIGNAL(LaunchFinished ()), 2248 this,SLOT(processLookForFinished())); 2249 fProcess->setCommunication(QProcess::DupStderr); 2250 fProcess->setArguments(QStringList("which mpeg_encode")); 2251 fProcess->start(); 2252 #else 2253 QObject ::connect(fProcess,SIGNAL(finished ( int)), 2254 this,SLOT(processLookForFinished())); 2255 fProcess->setReadChannelMode(QProcess::MergedChannels); 2256 fProcess->start ("which mpeg_encode"); 2257 #endif 2258 2255 2259 } 2256 2260 … … 2270 2274 return "File does not exist"; 2271 2275 } 2272 // check if it is not a dir 2273 QDir dir(path); 2274 dir.setFilter( QDir::Dirs); 2275 QStringList subDirList = dir.entryList(); 2276 2277 if (!subDirList.isEmpty()) { 2278 return "This is a directory"; 2279 } 2280 2276 2277 #if QT_VERSION < 0x040000 2278 path = QDir::cleanDirPath(path); 2279 #else 2281 2280 path = QDir::cleanPath(path); 2282 QFile *f = new QFile(path); 2281 #endif 2282 QFileInfo *f = new QFileInfo(path); 2283 2283 if (!f->exists()) { 2284 2284 return "File does not exist"; 2285 } 2286 if (!(f->permissions() & QFile::ExeUser)) { 2285 } else if (f->isDir()) { 2286 return "This is a directory"; 2287 } else if (!f->isExecutable()) { 2287 2288 return "File exist but is not executable"; 2289 } else if (!f->isFile()) { 2290 return "This is not a file"; 2288 2291 } 2289 2292 fEncoderPath = path; … … 2327 2330 return "Path does not exist"; 2328 2331 } 2332 #if QT_VERSION < 0x040000 2333 path = QDir::cleanDirPath(path); 2334 #else 2329 2335 path = QDir::cleanPath(path); 2330 QDir *d = new QDir(path); 2331 if (!d->exists(path)) { 2336 #endif 2337 QFileInfo *d = new QFileInfo(path); 2338 if (!d->exists()) { 2332 2339 return "Path does not exist"; 2333 } 2334 2335 d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable ); 2336 QStringList subDirList = d->entryList(); 2337 bool found = false; 2338 2339 for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) { 2340 const QString currentDir = *it; 2341 2342 if (currentDir == ".") { // we found it 2343 found = true; 2344 } 2345 } 2346 2347 if (!found) 2348 return "Path exist, but is not write accessible"; 2340 } else if (!d->isDir()) { 2341 return "This is not a directory"; 2342 } else if (!d->isReadable()) { 2343 return path +" is read protected"; 2344 } else if (!d->isWritable()) { 2345 return path +" is write protected"; 2346 } 2349 2347 2350 2348 fTempFolderPath = path; … … 2367 2365 return "Path does not exist"; 2368 2366 } 2369 // check if it is not a dir 2370 QDir tmp(path); 2371 tmp.setFilter( QDir::Dirs); 2372 QStringList subDirListTmp = tmp.entryList(); 2373 2374 if (!subDirListTmp.isEmpty()) { 2375 return "This is a directory"; 2376 } 2377 2367 2368 #if QT_VERSION < 0x040000 2369 path = QDir::cleanDirPath(path); 2370 #else 2378 2371 path = QDir::cleanPath(path); 2379 QFileInfo *fileInfo = new QFileInfo(path); 2380 QDir dir = fileInfo->absoluteDir(); 2381 if (!dir.exists()) { 2382 return "Folder does not exist"; 2383 } 2384 2385 dir.setFilter( QDir::Dirs | QDir::Writable ); 2386 QStringList subDirList = dir.entryList(); 2387 bool found = false; 2388 2389 for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) { 2390 const QString currentDir = *it; 2391 2392 if (currentDir == ".") { // we found it 2393 found = true; 2394 } 2395 } 2396 2397 if (!found) 2398 return "Path exist, but is not write accessible"; 2372 #endif 2373 QFileInfo *d = new QFileInfo(path); 2374 if (!d->exists()) { 2375 return "Path does not exist"; 2376 } else if (!d->isFile()) { 2377 return "This is not a file"; 2378 } else if (!d->isReadable()) { 2379 return path +" is read protected"; 2380 } else if (!d->isWritable()) { 2381 return path +" is write protected"; 2382 } 2399 2383 2400 2384 fSaveFileName = path; … … 2420 2404 return tmp; 2421 2405 } 2422 QString path = QString(QDir::separator())+"QtMovie_"+QDateTime::currentDateTime ().toString("dd-MM-yyyy_hh-mm-ss")+QString(QDir::separator()); 2406 #if QT_VERSION < 0x040000 2407 QString sep = QChar(QDir::separator()); 2408 #else 2409 QString sep = QDir::separator(); 2410 #endif 2411 QString path = sep+"QtMovie_"+QDateTime::currentDateTime ().toString("dd-MM-yyyy_hh-mm-ss")+sep; 2412 #if QT_VERSION < 0x040000 2413 QDir *d = new QDir(QDir::cleanDirPath(fTempFolderPath)); 2414 #else 2423 2415 QDir *d = new QDir(QDir::cleanPath(fTempFolderPath)); 2416 #endif 2424 2417 // check if it is already present 2425 2418 if (d->exists(path)) { … … 2442 2435 return ""; 2443 2436 } 2437 #if QT_VERSION < 0x040000 2438 QDir *d = new QDir(QDir::cleanDirPath(fMovieTempFolderPath)); 2439 #else 2444 2440 QDir *d = new QDir(QDir::cleanPath(fMovieTempFolderPath)); 2441 #endif 2445 2442 if (!d->exists()) { 2446 2443 return ""; // already remove … … 2483 2480 FILE* fp; 2484 2481 #if QT_VERSION < 0x040000 2485 fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).ascii , "w");2482 fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).ascii(), "w"); 2486 2483 #else 2487 2484 fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).toStdString().c_str(), "w"); … … 2683 2680 setRecordingStatus(ENCODING); 2684 2681 fProcess = new QProcess(); 2682 2683 #if QT_VERSION < 0x040000 2684 QObject ::connect(fProcess,SIGNAL(launchFinished ()), 2685 this,SLOT(processEncodeFinished())); 2686 QObject ::connect(fProcess,SIGNAL(readyReadStdOut ()), 2687 this,SLOT(processEncodeStdout())); 2688 fProcess->setCommunication(QProcess::DupStderr); 2689 fProcess->setArguments(QStringList(fEncoderPath)); 2690 fProcess->addArgument(fMovieTempFolderPath+fParameterFileName); 2691 fProcess->start(); 2692 #else 2693 #if QT_VERSION > 0x040100 2694 QObject ::connect(fProcess,SIGNAL(finished ( int,QProcess::ExitStatus)), 2695 this,SLOT(processEncodeFinished())); 2696 QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()), 2697 this,SLOT(processEncodeStdout())); 2698 #else 2699 QObject ::connect(fProcess,SIGNAL(finished ( int)), 2700 this,SLOT(processEncodeFinished())); 2701 QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()), 2702 this,SLOT(processEncodeStdout())); 2703 #endif 2704 fProcess->setReadChannelMode(QProcess::MergedChannels); 2685 2705 fProcess->start (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName)); 2686 #if QT_VERSION > 0x0401002687 QObject ::connect(fProcess,SIGNAL(finished ( int,QProcess::ExitStatus)),2688 this,SLOT(processFinished( int)));2689 QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),2690 this,SLOT(processStdout()));2691 #else2692 #if QT_VERSION > 0x0400002693 QObject ::connect(fProcess,SIGNAL(finished ( int)),2694 this,SLOT(processFinished( int)));2695 QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),2696 this,SLOT(processStdout()));2697 #else2698 QObject ::connect(fProcess,SIGNAL(finished ( int)),2699 this,SLOT(processFinished( int)));2700 QObject ::connect(fProcess,SIGNAL(readyReadStdOut ()),2701 this,SLOT(processStdout()));2702 #endif2703 2706 #endif 2704 2707 } … … 2709 2712 2710 2713 2711 void G4OpenGLQtViewer::process Stdout()2714 void G4OpenGLQtViewer::processEncodeStdout() 2712 2715 { 2713 2716 #if QT_VERSION > 0x040000 2714 2717 QString tmp = fProcess->readAllStandardOutput ().data(); 2715 #else2716 QString tmp = fProcess->readStdout ().data();2717 #endif2718 2718 int start = tmp.lastIndexOf("ESTIMATED TIME"); 2719 2719 tmp = tmp.mid(start,tmp.indexOf("\n",start)-start); 2720 #else 2721 QString tmp = fProcess->readStdout ().data(); 2722 int start = tmp.findRev("ESTIMATED TIME"); 2723 tmp = tmp.mid(start,tmp.find("\n",start)-start); 2724 #endif 2720 2725 setRecordingInfos(tmp); 2721 2726 } 2722 2727 2723 2728 2724 void G4OpenGLQtViewer::process Finished(int exitCode)2729 void G4OpenGLQtViewer::processEncodeFinished() 2725 2730 { 2726 2731 #ifdef GEANT4_QT_DEBUG 2727 printf("process Finished \n");2732 printf("processEncodeFinished \n"); 2728 2733 #endif 2729 2734 2730 2735 QString txt = ""; 2731 if (!exitCode) { 2736 txt = getProcessErrorMsg(); 2737 if (txt == "") { 2732 2738 setRecordingStatus(SUCCESS); 2733 2739 } else { 2734 switch (fProcess->error()) {2735 case QProcess::FailedToStart:2736 txt = "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.\n";2737 break;2738 case QProcess::Crashed:2739 txt = "The process crashed some time after starting successfully.\n";2740 break;2741 case QProcess::Timedout:2742 txt = "The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.\n";2743 break;2744 case QProcess::WriteError:2745 txt = "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.\n";2746 break;2747 case QProcess::ReadError:2748 txt = "An error occurred when attempting to read from the process. For example, the process may not be running.\n";2749 break;2750 case QProcess::UnknownError:2751 txt = "An unknown error occurred. This is the default return value of error().\n";2752 break;2753 }2754 2740 setRecordingStatus(FAILED); 2755 2741 } 2756 2742 setRecordingInfos(txt+removeTempFolder()); 2757 2743 #ifdef GEANT4_QT_DEBUG 2758 printf("processFinished END\n"); 2759 #endif 2744 printf("processEncodeFinished END\n"); 2745 #endif 2746 } 2747 2748 2749 void G4OpenGLQtViewer::processLookForFinished() 2750 { 2751 2752 QString txt = getProcessErrorMsg(); 2753 if (txt != "") { 2754 fEncoderPath = ""; 2755 } else { 2756 #if QT_VERSION > 0x040000 2757 fEncoderPath = QString(fProcess->readAllStandardOutput ().data()).trimmed(); 2758 #else 2759 fEncoderPath = QString(fProcess->readStdout ().data()).simplifyWhiteSpace(); 2760 #endif 2761 // if not found, return "not found" 2762 if (fEncoderPath.contains(" ")) { 2763 fEncoderPath = ""; 2764 } else if (!fEncoderPath.contains("mpeg_encode")) { 2765 fEncoderPath = ""; 2766 } 2767 setEncoderPath(fEncoderPath); 2768 } 2769 // init temp folder 2770 #if QT_VERSION > 0x040000 2771 setTempFolderPath(QDir::temp ().absolutePath ()); 2772 #else 2773 // Let's have a try 2774 setTempFolderPath("/tmp/"); 2775 #endif 2776 } 2777 2778 2779 QString G4OpenGLQtViewer::getProcessErrorMsg() 2780 { 2781 QString txt = ""; 2782 #if QT_VERSION < 0x040000 2783 if (!fProcess->normalExit ()) { 2784 txt = "Exist status "+ fProcess->exitStatus (); 2785 } 2786 #else 2787 switch (fProcess->error()) { 2788 case QProcess::FailedToStart: 2789 txt = "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.\n"; 2790 break; 2791 case QProcess::Crashed: 2792 txt = "The process crashed some time after starting successfully.\n"; 2793 break; 2794 case QProcess::Timedout: 2795 txt = "The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.\n"; 2796 break; 2797 case QProcess::WriteError: 2798 txt = "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.\n"; 2799 break; 2800 case QProcess::ReadError: 2801 txt = "An error occurred when attempting to read from the process. For example, the process may not be running.\n"; 2802 break; 2803 case QProcess::UnknownError: 2804 txt = "An unknown error occurred. This is the default return value of error().\n"; 2805 break; 2806 } 2807 #endif 2808 return txt; 2760 2809 } 2761 2810 -
trunk/geant4/visualization/OpenGL/src/G4OpenGLSceneHandler.cc
r688 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLSceneHandler.cc,v 1.5 2 2008/01/04 22:07:01allison Exp $27 // $Id: G4OpenGLSceneHandler.cc,v 1.53 2008/02/01 06:26:45 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 467 467 468 468 G4bool clipping = pViewer->fVP.IsSection() || pViewer->fVP.IsCutaway(); 469 470 // Lighting disabled unless otherwise requested 471 glDisable (GL_LIGHTING); 469 472 470 473 switch (drawing_style) { … … 494 497 } 495 498 } 496 glDisable (GL_LIGHTING);497 499 glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ()); 498 500 break; … … 526 528 glDepthFunc (GL_LEQUAL); //??? was GL_ALWAYS 527 529 glDisable (GL_CULL_FACE); 528 glDisable (GL_LIGHTING);529 530 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); 530 531 glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ()); … … 604 605 // having glBegin/End pairs *inside* loop in the more 605 606 // usual case of no hidden line removal. 607 608 // Lighting disabled unless otherwise requested 609 glDisable (GL_LIGHTING); 606 610 607 611 // Draw through stencil... … … 712 716 glDisable (GL_STENCIL_TEST); // Revert to default for next primitive. 713 717 glDepthMask (1); // Revert to default for next primitive. 718 glDisable (GL_LIGHTING); // Revert to default for next primitive. 714 719 } 715 720 -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
r745 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredQtViewer.cc,v 1. 9 2008/01/30 10:54:13lgarnier Exp $27 // $Id: G4OpenGLStoredQtViewer.cc,v 1.13 2008/03/11 16:31:09 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 34 34 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER 35 35 36 #define GEANT4_QT_DEBUG36 //#define GEANT4_QT_DEBUG 37 37 38 38 #include "G4OpenGLStoredQtViewer.hh" … … 361 361 #endif 362 362 if (hasPendingEvents ()) 363 G4MouseMoveEvent(event->x(),event->y(),event->buttons(),true); 363 #if QT_VERSION < 0x040000 364 G4MouseMoveEvent(event->x(),event->y(),event->state()); 365 #else 366 G4MouseMoveEvent(event->x(),event->y(),event->buttons()); 367 #endif 364 368 } 365 369 -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc
r688 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLStoredSceneHandler.cc,v 1.3 5 2008/01/04 22:07:01 allisonExp $27 // $Id: G4OpenGLStoredSceneHandler.cc,v 1.36 2008/02/18 08:53:49 asaim Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 133 133 glPushMatrix(); 134 134 glLoadIdentity(); 135 glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX); 135 // glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX); 136 glOrtho (-1., 1., -1., 1., -1., 1.); 136 137 glMatrixMode (GL_MODELVIEW); 137 138 glPushMatrix(); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc
r727 r754 25 25 // 26 26 // 27 // $Id: G4OpenGLViewer.cc,v 1.3 4 2007/05/24 18:27:13 allisonExp $28 // GEANT4 tag $Name: HEAD$27 // $Id: G4OpenGLViewer.cc,v 1.36 2008/03/10 16:57:04 lgarnier Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 // … … 372 372 373 373 G4int size = 5000000; 374 375 GLfloat* feedback_buffer; 376 GLint returned; 377 FILE* file; 378 379 feedback_buffer = new GLfloat[size]; 374 GLfloat* feedback_buffer = new GLfloat[size]; 380 375 glFeedbackBuffer (size, GL_3D_COLOR, feedback_buffer); 381 376 glRenderMode (GL_FEEDBACK); 382 377 383 378 DrawView(); 379 380 GLint returned; 384 381 returned = glRenderMode (GL_RENDER); 385 382 383 FILE* file; 386 384 if (print_string) { 387 385 file = fopen (print_string, "w");
Note: See TracChangeset
for help on using the changeset viewer.