Ignore:
Timestamp:
Feb 25, 2008, 5:14:36 PM (16 years ago)
Author:
garnier
Message:

debut de la boite de dialog pour les param video

Location:
trunk/geant4/visualization/OpenGL/src
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r729 r730  
    4848#include "G4Scene.hh"
    4949#include "G4OpenGLQtExportDialog.hh"
     50#include "G4OpenGLQtMovieDialog.hh"
    5051#include "G4UnitsTable.hh"
    5152#include "G4Qt.hh"
     
    300301  ,fHoldRotateEvent(false)
    301302  ,fAutoMove(false)
     303  ,fEncoderPath(NULL)
    302304{
    303305#ifdef GEANT4_QT_DEBUG
     
    654656                    SLOT(actionCreateEPS()));
    655657#endif
     658
     659#if QT_VERSION < 0x040000
     660#if QT_VERSION < 0x030200
     661  QAction *createMovie =  new QAction("&Make movie ...","&Make movie ...",CTRL+Key_M,mActions,0,true);
     662#else
     663  QAction *createMovie =  new QAction("&Make movie ...",CTRL+Key_M,mActions);
     664#endif
     665  createMovie->addTo(mActions);
     666  QObject ::connect(createMovie,
     667                    SIGNAL(activated()),
     668                    this,
     669                    SLOT(actionCreateMovie()));
     670
     671#else
     672  // === Action Menu ===
     673  QAction *createMovie = mActions->addAction("Make movie ...");
     674  QObject ::connect(createMovie,
     675                    SIGNAL(triggered()),
     676                    this,
     677                    SLOT(actionCreateMovie()));
     678#endif
     679
    656680
    657681
     
    14201444#ifdef GEANT4_QT_DEBUG
    14211445  printf("G4OpenGLQtViewer::actionCreateEPS() \n");
     1446#endif
     1447}
     1448
     1449
     1450void G4OpenGLQtViewer::actionCreateMovie() {
     1451
     1452  G4OpenGLQtMovieDialog* movieDialog= new G4OpenGLQtMovieDialog(GLWindow);
     1453  movieDialog->show();
     1454#ifdef GEANT4_QT_DEBUG
     1455  printf("G4OpenGLQtViewer::actionCreateMovie() \n");
    14221456#endif
    14231457}
     
    20532087#endif
    20542088    if (event->key() == Qt::Key_Down) { // go down
     2089      moveScene(0,1,0,false);
     2090    }
     2091    else if (event->key() == Qt::Key_Up) {  // go up
    20552092      moveScene(0,-1,0,false);
    2056     }
    2057     else if (event->key() == Qt::Key_Up) {  // go up
    2058       moveScene(0,1,0,false);
    20592093    }
    20602094    if (event->key() == Qt::Key_Left) { // go left
     
    20672101  fHoldKeyEvent = false;
    20682102}
     2103 
     2104
     2105/** @return if encoder path was not specified, try to guess it and open the movie parameter dialog box.
     2106 * if path was already specified, return it.
     2107 */
     2108QString G4OpenGLQtViewer::getEncoderPath() {
     2109  if (fEncoderPath == NULL) {
     2110   
     2111    //look for encoderPath
     2112    QProcess search;
     2113    search.setReadChannelMode(QProcess::MergedChannels);
     2114    search.start ("which mpeg_encode");
     2115   
     2116    if (search.waitForFinished()) {
     2117      fEncoderPath = QString::fromLocal8Bit(search.readAll());
     2118    }
     2119    G4OpenGLQtMovieDialog* movieDialog= new G4OpenGLQtMovieDialog(GLWindow);
     2120    movieDialog->show();
     2121  } else {
     2122    return fEncoderPath ;
     2123  }
     2124}
     2125 
     2126
     2127/**
     2128 * set the new encoder path
     2129*/
     2130void G4OpenGLQtViewer::setEncoderPath(QString path) {
     2131  fEncoderPath = path;
     2132}
     2133 
    20692134
    20702135
     
    22562321  fclose (fp);
    22572322
    2258   QProcess::execute ("/sw/bin/mpeg_encode", QStringList("/temp/parameter_file.par"));
     2323  QProcess::execute (fEncoderPath, QStringList("/temp/parameter_file.par"));
    22592324  return true;
    22602325}
Note: See TracChangeset for help on using the changeset viewer.