Changeset 745 for trunk/geant4
- Timestamp:
- Mar 6, 2008, 3:56:10 PM (16 years ago)
- Location:
- trunk/geant4/visualization/OpenGL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r744 r745 78 78 QString setSaveFileName(QString path); 79 79 QString getSaveFileName(); 80 enum RECORDING_STEP {WAIT=0,START,PAUSE,CONTINUE,STOP,ENCODE};81 RECORDING_STEP getRecordingStep();80 bool isRecording(); 81 bool isReadyToEncode(); 82 82 bool encodeVideo(); 83 83 … … 113 113 114 114 private: 115 enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4}; 116 enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP,ENCODE}; 117 115 118 void createPopupMenu(); 116 119 void createRadioAction(QAction *,QAction *, const std::string&,unsigned int a=1); … … 134 137 QMenu *fContextMenu; 135 138 #endif 136 enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4};137 139 138 140 mouseActions fMouseAction; // 1: rotate 2:move 3:pick 4:shortcuts -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc
r744 r745 240 240 241 241 fButtonEncode = new QPushButton( tr( "&Encode" ),buttonBox ); 242 if (fParentViewer->getRecordingStep() == G4OpenGLQtViewer::ENCODE) { 243 fButtonEncode->setEnabled(true); 244 } else { 245 fButtonEncode->setEnabled(false); 246 } 242 fButtonEncode->setEnabled(fParentViewer->isReadyToEncode()); 247 243 fButtonEncode->setAutoDefault( TRUE ); 248 244 buttonBoxLayout->addWidget(fButtonEncode); -
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r744 r745 1326 1326 setRecordingInfos("File "+fileName+" saved"); 1327 1327 fRecordFrameNumber++; 1328 #ifdef GEANT4_QT_DEBUG1329 printf("G4OpenGLStoredQtViewer::record frame %d\n",fRecordFrameNumber);1330 #endif1331 1328 } 1332 1329 … … 2172 2169 } 2173 2170 if (fRecordingStep == WAIT) { 2174 fRecordingStep = START;2171 setRecordingStatus(START); 2175 2172 } else if (fRecordingStep == START) { 2176 fRecordingStep = PAUSE;2173 setRecordingStatus(PAUSE); 2177 2174 } else if (fRecordingStep == PAUSE) { 2178 fRecordingStep = CONTINUE;2175 setRecordingStatus(CONTINUE); 2179 2176 } else if (fRecordingStep == CONTINUE) { 2180 fRecordingStep = PAUSE;2177 setRecordingStatus(PAUSE); 2181 2178 } 2182 2179 } … … 2185 2182 void G4OpenGLQtViewer::setRecordingStatus(RECORDING_STEP step) { 2186 2183 2184 #ifdef GEANT4_QT_DEBUG 2185 printf("setRecordingStatus \n"); 2186 #endif 2187 2187 QString txt = ""; 2188 2188 if (step == WAIT) { … … 2202 2202 } 2203 2203 2204 fRecordingStep = step; 2205 2204 2206 if (fMovieParametersDialog) { 2205 setRecordingInfos(txt);2207 fMovieParametersDialog->setRecordingStatus(txt); 2206 2208 } else { 2207 2209 #if QT_VERSION < 0x040000 … … 2216 2218 void G4OpenGLQtViewer::setRecordingInfos(QString txt) { 2217 2219 if (fMovieParametersDialog) { 2218 setRecordingInfos(txt);2220 fMovieParametersDialog->setRecordingInfos(txt); 2219 2221 } else { 2220 2222 #if QT_VERSION < 0x040000 … … 2277 2279 } 2278 2280 2279 G4OpenGLQtViewer::RECORDING_STEP G4OpenGLQtViewer::getRecordingStep(){ 2280 return fRecordingStep; 2281 } 2281 2282 bool G4OpenGLQtViewer::isRecording(){ 2283 if ((fRecordingStep == START) || (fRecordingStep == PAUSE) || (fRecordingStep == CONTINUE)) { 2284 return true; 2285 } 2286 return false; 2287 } 2288 2289 2290 bool G4OpenGLQtViewer::isReadyToEncode(){ 2291 if (fRecordingStep == STOP) { 2292 return true; 2293 } 2294 return false; 2295 } 2296 2282 2297 2283 2298 /** -
trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
r744 r745 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" … … 199 199 } 200 200 201 if ( (getRecordingStep() == START) || (getRecordingStep() == PAUSE) || (getRecordingStep() == CONTINUE)) {201 if (isRecording()) { 202 202 savePPMToTemp(); 203 fRecordFrameNumber++;204 #ifdef GEANT4_QT_DEBUG205 printf("G4OpenGLStoredQtViewer::record frame %d\n",fRecordFrameNumber);206 #endif207 203 } 208 204
Note: See TracChangeset
for help on using the changeset viewer.