Changeset 730 for trunk/geant4/visualization/OpenGL
- Timestamp:
- Feb 25, 2008, 5:14:36 PM (17 years ago)
- Location:
- trunk/geant4/visualization/OpenGL
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r728 r730 71 71 virtual void updateQWidget()=0; 72 72 void setupViewport(int, int); 73 void setEncoderPath(QString path); 74 QString getEncoderPath(); 73 75 74 76 protected: … … 140 142 bool fHoldRotateEvent; 141 143 bool fAutoMove; 144 QString fEncoderPath; 142 145 QAction *fRotateAction; 143 146 QAction *fMoveAction; … … 159 162 void actionDrawingLineSurfaceRemoval(); 160 163 void actionCreateEPS(); 164 void actionCreateMovie(); 161 165 162 166 void showShortcuts(); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r729 r730 48 48 #include "G4Scene.hh" 49 49 #include "G4OpenGLQtExportDialog.hh" 50 #include "G4OpenGLQtMovieDialog.hh" 50 51 #include "G4UnitsTable.hh" 51 52 #include "G4Qt.hh" … … 300 301 ,fHoldRotateEvent(false) 301 302 ,fAutoMove(false) 303 ,fEncoderPath(NULL) 302 304 { 303 305 #ifdef GEANT4_QT_DEBUG … … 654 656 SLOT(actionCreateEPS())); 655 657 #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 656 680 657 681 … … 1420 1444 #ifdef GEANT4_QT_DEBUG 1421 1445 printf("G4OpenGLQtViewer::actionCreateEPS() \n"); 1446 #endif 1447 } 1448 1449 1450 void G4OpenGLQtViewer::actionCreateMovie() { 1451 1452 G4OpenGLQtMovieDialog* movieDialog= new G4OpenGLQtMovieDialog(GLWindow); 1453 movieDialog->show(); 1454 #ifdef GEANT4_QT_DEBUG 1455 printf("G4OpenGLQtViewer::actionCreateMovie() \n"); 1422 1456 #endif 1423 1457 } … … 2053 2087 #endif 2054 2088 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 2055 2092 moveScene(0,-1,0,false); 2056 }2057 else if (event->key() == Qt::Key_Up) { // go up2058 moveScene(0,1,0,false);2059 2093 } 2060 2094 if (event->key() == Qt::Key_Left) { // go left … … 2067 2101 fHoldKeyEvent = false; 2068 2102 } 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 */ 2108 QString 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 */ 2130 void G4OpenGLQtViewer::setEncoderPath(QString path) { 2131 fEncoderPath = path; 2132 } 2133 2069 2134 2070 2135 … … 2256 2321 fclose (fp); 2257 2322 2258 QProcess::execute ( "/sw/bin/mpeg_encode", QStringList("/temp/parameter_file.par"));2323 QProcess::execute (fEncoderPath, QStringList("/temp/parameter_file.par")); 2259 2324 return true; 2260 2325 }
Note: See TracChangeset
for help on using the changeset viewer.