Changeset 754


Ignore:
Timestamp:
Mar 11, 2008, 5:35:07 PM (16 years ago)
Author:
garnier
Message:

corrections pour Qt3 mises sous cvs

Location:
trunk/geant4/visualization/OpenGL
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh

    r751 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLQtMovieDialog.hh,v 1.5 2008/01/30 10:54:13 lgarnier Exp $
     27// $Id: G4OpenGLQtMovieDialog.hh,v 1.1 2008/03/10 16:57:04 lgarnier Exp $
    2828// GEANT4 tag $Name:
    2929//
  • trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh

    r752 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.hh,v 1.7 2008/01/30 10:54:13 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.hh,v 1.9 2008/03/11 16:05:56 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    134134  void setRecordingStatus(RECORDING_STEP);
    135135  void setRecordingInfos(QString);
     136  QString getProcessErrorMsg();
    136137
    137138
     
    205206  void toggleAux(bool);
    206207  void toggleFullScreen(bool);
    207   void processFinished(int);
    208   void processStdout();
     208  void processEncodeFinished();
     209  void processLookForFinished();
     210  void processEncodeStdout();
    209211  // Only use for Qt>4.0
    210212  //  void dialogClosed();
  • trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh

    r712 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLViewer.hh,v 1.21 2007/11/10 14:50:01 allison Exp $
     27// $Id: G4OpenGLViewer.hh,v 1.22 2008/03/10 16:57:04 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc

    r688 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLImmediateSceneHandler.cc,v 1.28 2008/01/04 22:07:01 allison Exp $
     27// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.29 2008/02/18 08:53:49 asaim Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    171171  glPushMatrix();
    172172  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.);
    174175  glMatrixMode (GL_MODELVIEW);
    175176  glPushMatrix();
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc

    r734 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLQtExportDialog.cc,v 1.6 2008/01/30 10:54:13 lgarnier Exp $
     27// $Id: G4OpenGLQtExportDialog.cc,v 1.7 2008/03/10 16:57:04 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc

    r752 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLQtMovieDialog.cc,v 1.6 2008/02/15 10:54:13 lgarnier Exp $
     27// $Id: G4OpenGLQtMovieDialog.cc,v 1.3 2008/03/11 16:05:56 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
    3030//
    3131
    32 #define GEANT4_QT_DEBUG
     32//#define GEANT4_QT_DEBUG
    3333#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
    3434
     
    7070    fParentViewer(parentViewer)
    7171{
     72#if QT_VERSION > 0x030200
    7273  setModal(false);
     74#endif
    7375#if QT_VERSION < 0x040000
    7476  setCaption( tr( " Movie parameters" ));
     
    9698
    9799  fEncoderStatus = new QLabel(encoderGroupBox);
     100
     101#if QT_VERSION > 0x040000
    98102  fEncoderStatus->setWordWrap(true);
     103#else
     104  fEncoderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
     105#endif
     106
    99107  fEncoderStatus->setText("");
    100108
     
    133141
    134142  fTempFolderStatus = new QLabel(tempFolderGroupBox);
     143#if QT_VERSION > 0x040000
    135144  fTempFolderStatus->setWordWrap(true);
     145#else
     146  fTempFolderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
     147#endif
    136148  fTempFolderStatus->setText("");
    137149
     
    172184
    173185  fSaveFileStatus = new QLabel(saveFileGroupBox);
     186#if QT_VERSION > 0x040000
    174187  fSaveFileStatus->setWordWrap(true);
     188#else
     189  fSaveFileStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
     190#endif
    175191  fSaveFileStatus->setText("");
    176192
     
    198214  // label
    199215
    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);
    201217
    202218  // global status
     
    205221
    206222  fRecordingStatus = new QLabel(statusGroupBox);
     223#if QT_VERSION > 0x040000
    207224  fRecordingStatus->setWordWrap(true);
     225#else
     226  fRecordingStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
     227#endif
    208228  QPalette palette( fRecordingStatus->palette() );
     229#if QT_VERSION > 0x040000
    209230  palette.setColor( QPalette::Text, Qt::green);
     231#else
     232  palette.setColor( QColorGroup::Text, Qt::green);
     233#endif
    210234  fRecordingStatus->setPalette(palette);
    211235
    212236  fRecordingInfos = new QLabel(statusGroupBox);
     237#if QT_VERSION > 0x040000
    213238  fRecordingInfos->setWordWrap(true);
     239#else
     240  fRecordingInfos->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
     241#endif
    214242  setRecordingInfos("");
    215243
     
    298326void G4OpenGLQtMovieDialog::selectEncoderPathAction()
    299327{
     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
    300335  QString nomFich =  QFileDialog::getOpenFileName ( this,
    301336                                                    "Select your encoder",
    302337                                                    tr("Select your encoder ..."));
     338
     339#endif
     340
    303341  if (nomFich == "") {
    304342    return;
     
    311349void G4OpenGLQtMovieDialog::selectTempPathAction()
    312350{
     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
    313358  QString nomFich =  QFileDialog::getOpenFileName ( this,
    314359                                                    "Select temporary folder",
    315360                                                    tr("Select temporary folder ..."));
     361
     362#endif
    316363  if (nomFich == "") {
    317364    return;
     
    324371void G4OpenGLQtMovieDialog::selectSaveFileNameAction()
    325372{
     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
    326380  QString nomFich =  QFileDialog::getSaveFileName ( this,
    327381                                                    "Select saved file",
    328382                                                    tr("Select saved file ..."));
     383
     384#endif
    329385  if (nomFich == "") {
    330386    return;
     
    372428  fEncoderStatus->setText(temp);
    373429  if (temp != "") {
     430#if QT_VERSION > 0x040000
    374431    palette.setColor( QPalette::Base, Qt::red);
     432#else
     433    palette.setColor( QColorGroup::Base, Qt::red);
     434#endif
    375435    if (fParentViewer->isReadyToEncode()) {
    376436      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");
     
    378438    status = false;
    379439  } else {
     440#if QT_VERSION > 0x040000
    380441    palette.setColor( QPalette::Base, Qt::white);
     442#else
     443    palette.setColor( QColorGroup::Base, Qt::white);
     444#endif
    381445    fEncoderPath->setText(fParentViewer->getEncoderPath());
    382446  }
     
    398462  fTempFolderStatus->setText(temp);
    399463  if (temp != "") {
     464#if QT_VERSION > 0x040000
    400465    palette.setColor( QPalette::Base, Qt::red);
     466#else
     467    palette.setColor( QColorGroup::Base, Qt::red);
     468#endif
    401469    status = false;
    402470  } else {
     471#if QT_VERSION > 0x040000
    403472    palette.setColor( QPalette::Base, Qt::white);
     473#else
     474    palette.setColor( QColorGroup::Base, Qt::white);
     475#endif
    404476    fTempFolderPath->setText(fParentViewer->getTempFolderPath());
    405477  }
     
    421493  fSaveFileStatus->setText(temp);
    422494  if (temp != "") {
     495#if QT_VERSION > 0x040000
    423496    palette.setColor( QPalette::Base, Qt::red);
     497#else
     498    palette.setColor( QColorGroup::Base, Qt::red);
     499#endif
    424500    status = false;
    425501  } else {
     502#if QT_VERSION > 0x040000
    426503    palette.setColor( QPalette::Base, Qt::white);
     504#else
     505    palette.setColor( QColorGroup::Base, Qt::white);
     506#endif
    427507    fSaveFileName->setText(fParentViewer->getSaveFileName());
    428508  }
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r753 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.cc,v 1.10 2008/01/30 10:54:13 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.cc,v 1.15 2008/03/11 16:31:09 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    3636#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
    3737
    38 #define GEANT4_QT_DEBUG
     38//#define GEANT4_QT_DEBUG
    3939
    4040#include "G4OpenGLQtViewer.hh"
     
    308308  ,fMovieParametersDialog(NULL)
    309309  ,fRecordingStep(WAIT)
    310 
     310  ,fProcess(NULL)
    311311{
    312312
     
    324324//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    325325{
     326#if QT_VERSION < 0x040000
     327  G4cout <<removeTempFolder().ascii() <<G4endl;
     328#else
    326329  G4cout <<removeTempFolder().toStdString().c_str() <<G4endl;
     330#endif
     331
    327332#ifdef GEANT4_QT_DEBUG
    328333  printf("G4OpenGLQtViewer::~G4OpenGLQtViewer \n");
     
    22372242 
    22382243   //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 
    22552259}
    22562260
     
    22702274    return "File does not exist";
    22712275  }
    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
    22812280  path =  QDir::cleanPath(path);
    2282   QFile *f = new QFile(path);
     2281#endif
     2282  QFileInfo *f = new QFileInfo(path);
    22832283  if (!f->exists()) {
    22842284    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()) {
    22872288    return "File exist but is not executable";
     2289  } else if (!f->isFile()) {
     2290    return "This is not a file";
    22882291  }
    22892292  fEncoderPath = path;
     
    23272330    return "Path does not exist";
    23282331  }
     2332#if QT_VERSION < 0x040000
     2333  path =  QDir::cleanDirPath(path);
     2334#else
    23292335  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()) {
    23322339    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  }
    23492347 
    23502348  fTempFolderPath = path;
     
    23672365    return "Path does not exist";
    23682366  }
    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
    23782371  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  }
    23992383 
    24002384  fSaveFileName = path;
     
    24202404    return tmp;
    24212405  }
    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
    24232415  QDir *d = new QDir(QDir::cleanPath(fTempFolderPath));
     2416#endif
    24242417  // check if it is already present
    24252418  if (d->exists(path)) {
     
    24422435    return "";
    24432436  }
     2437#if QT_VERSION < 0x040000
     2438  QDir *d = new QDir(QDir::cleanDirPath(fMovieTempFolderPath));
     2439#else
    24442440  QDir *d = new QDir(QDir::cleanPath(fMovieTempFolderPath));
     2441#endif
    24452442  if (!d->exists()) {
    24462443    return "";  // already remove
     
    24832480  FILE* fp;
    24842481#if QT_VERSION < 0x040000
    2485   fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).ascii, "w");
     2482  fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).ascii(), "w");
    24862483#else
    24872484  fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).toStdString().c_str(), "w");
     
    26832680    setRecordingStatus(ENCODING);
    26842681    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);
    26852705    fProcess->start (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName));
    2686 #if QT_VERSION > 0x040100
    2687         QObject ::connect(fProcess,SIGNAL(finished ( int,QProcess::ExitStatus)),
    2688                       this,SLOT(processFinished( int)));
    2689         QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
    2690                       this,SLOT(processStdout()));
    2691 #else
    2692 #if QT_VERSION > 0x040000
    2693         QObject ::connect(fProcess,SIGNAL(finished ( int)),
    2694                       this,SLOT(processFinished( int)));
    2695         QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
    2696                       this,SLOT(processStdout()));
    2697 #else
    2698         QObject ::connect(fProcess,SIGNAL(finished ( int)),
    2699                       this,SLOT(processFinished( int)));
    2700         QObject ::connect(fProcess,SIGNAL(readyReadStdOut ()),
    2701                       this,SLOT(processStdout()));
    2702 #endif
    27032706#endif
    27042707  }
     
    27092712
    27102713
    2711 void G4OpenGLQtViewer::processStdout()
     2714void G4OpenGLQtViewer::processEncodeStdout()
    27122715{
    27132716#if QT_VERSION > 0x040000
    27142717  QString tmp = fProcess->readAllStandardOutput ().data();
    2715 #else
    2716   QString tmp = fProcess->readStdout ().data();
    2717 #endif
    27182718  int start = tmp.lastIndexOf("ESTIMATED TIME");
    27192719  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
    27202725  setRecordingInfos(tmp);
    27212726}
    27222727
    27232728
    2724 void G4OpenGLQtViewer::processFinished(int exitCode)
     2729void G4OpenGLQtViewer::processEncodeFinished()
    27252730{
    27262731#ifdef GEANT4_QT_DEBUG
    2727   printf("processFinished \n");
     2732  printf("processEncodeFinished \n");
    27282733#endif
    27292734
    27302735  QString txt = "";
    2731   if (!exitCode) {
     2736  txt = getProcessErrorMsg();
     2737  if (txt == "") {
    27322738    setRecordingStatus(SUCCESS);
    27332739  } 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     }
    27542740    setRecordingStatus(FAILED);
    27552741  }
    27562742  setRecordingInfos(txt+removeTempFolder());
    27572743#ifdef GEANT4_QT_DEBUG
    2758   printf("processFinished END\n");
    2759 #endif
     2744  printf("processEncodeFinished END\n");
     2745#endif
     2746}
     2747
     2748
     2749void 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
     2779QString 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;
    27602809}
    27612810
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLSceneHandler.cc

    r688 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLSceneHandler.cc,v 1.52 2008/01/04 22:07:01 allison Exp $
     27// $Id: G4OpenGLSceneHandler.cc,v 1.53 2008/02/01 06:26:45 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    467467
    468468  G4bool clipping = pViewer->fVP.IsSection() || pViewer->fVP.IsCutaway();
     469
     470  // Lighting disabled unless otherwise requested
     471  glDisable (GL_LIGHTING);
    469472
    470473  switch (drawing_style) {
     
    494497      }
    495498    }
    496     glDisable (GL_LIGHTING);
    497499    glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ());
    498500    break;
     
    526528    glDepthFunc (GL_LEQUAL);    //??? was GL_ALWAYS
    527529    glDisable (GL_CULL_FACE);
    528     glDisable (GL_LIGHTING);
    529530    glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
    530531    glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ());
     
    604605                 // having glBegin/End pairs *inside* loop in the more
    605606                 // usual case of no hidden line removal.
     607
     608      // Lighting disabled unless otherwise requested
     609      glDisable (GL_LIGHTING);
    606610
    607611      // Draw through stencil...
     
    712716  glDisable (GL_STENCIL_TEST);  // Revert to default for next primitive.
    713717  glDepthMask (1);              // Revert to default for next primitive.
     718  glDisable (GL_LIGHTING);      // Revert to default for next primitive.
    714719}
    715720
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc

    r745 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredQtViewer.cc,v 1.9 2008/01/30 10:54:13 lgarnier Exp $
     27// $Id: G4OpenGLStoredQtViewer.cc,v 1.13 2008/03/11 16:31:09 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    3434#ifdef G4VIS_BUILD_OPENGLQT_DRIVER
    3535
    36 #define GEANT4_QT_DEBUG
     36//#define GEANT4_QT_DEBUG
    3737
    3838#include "G4OpenGLStoredQtViewer.hh"
     
    361361#endif
    362362  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
    364368}
    365369
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc

    r688 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLStoredSceneHandler.cc,v 1.35 2008/01/04 22:07:01 allison Exp $
     27// $Id: G4OpenGLStoredSceneHandler.cc,v 1.36 2008/02/18 08:53:49 asaim Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    133133    glPushMatrix();
    134134    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.);
    136137    glMatrixMode (GL_MODELVIEW);
    137138    glPushMatrix();
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc

    r727 r754  
    2525//
    2626//
    27 // $Id: G4OpenGLViewer.cc,v 1.34 2007/05/24 18:27:13 allison Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4OpenGLViewer.cc,v 1.36 2008/03/10 16:57:04 lgarnier Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030//
     
    372372 
    373373  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];
    380375  glFeedbackBuffer (size, GL_3D_COLOR, feedback_buffer);
    381376  glRenderMode (GL_FEEDBACK);
    382377 
    383378  DrawView();
     379
     380  GLint returned;
    384381  returned = glRenderMode (GL_RENDER);
    385382 
     383  FILE* file;
    386384  if (print_string) {
    387385    file = fopen (print_string, "w");
Note: See TracChangeset for help on using the changeset viewer.