32 #if defined (G4VIS_BUILD_OPENGLWT_DRIVER) || defined (G4VIS_USE_OPENGLWT)
34 #ifndef G4OPENGLWTVIEWER_HH
35 #define G4OPENGLWTVIEWER_HH
44 #include <Wt/WContainerWidget>
45 #include <Wt/WMatrix4x4>
47 class G4OpenGLSceneHandler;
52 class WContextMenuEvent;
62 class G4OpenGLSceneHandler;
63 class G4OpenGLWtMovieDialog;
65 class G4OpenGLWtViewer:
virtual public G4OpenGLViewer {
68 G4OpenGLWtViewer (G4OpenGLSceneHandler& scene);
69 virtual ~G4OpenGLWtViewer ();
70 virtual void updateWWidget()=0;
72 Wt::WMatrix4x4 mMatrix;
75 Wt::WString setEncoderPath(Wt::WString path);
76 Wt::WString getEncoderPath();
77 Wt::WString setTempFolderPath(Wt::WString path);
78 Wt::WString getTempFolderPath();
79 Wt::WString setSaveFileName(Wt::WString path);
80 Wt::WString getSaveFileName();
95 bool isReadyToEncode();
96 void resetRecording();
100 bool generateMpegEncoderParameters();
101 void displayRecordingStatus();
103 void drawText(
const char * ,
int x,
int y,
int z,
int size);
105 void CreateGLWtContext ();
106 virtual void CreateMainWindow (Wt::WGLWidget*,Wt::WString);
107 #ifdef _A_FINIR_FIXME
108 void G4manageContextMenuEvent(Wt::WContextMenuEvent *
e);
110 void G4MousePressEvent(Wt::WMouseEvent *event);
111 void G4MouseReleaseEvent();
112 void G4MouseDoubleClickEvent();
113 void G4MouseMoveEvent(Wt::WMouseEvent *event);
115 void G4keyPressEvent (Wt::WKeyEvent * event);
116 void rotateWtScene(
float,
float);
117 void rotateWtSceneToggle(
float,
float);
118 void moveScene(
float,
float,
float,
bool);
119 #ifdef _A_FINIR_FIXME
120 void updateKeyModifierState(Wt::KeyboardModifiers);
123 inline Wt::WGLWidget* getGLWindow() {
129 Wt::WGLWidget* fWindow;
130 Wt::WWidget* fGLWindow;
131 bool hasPendingEvents();
132 void resizeGL(
int width,
int height);
134 #ifdef _A_FINIR_FIXME
135 void savePPMToTemp();
137 int fRecordFrameNumber;
144 enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4};
145 enum RECORDING_STEP {WAIT,
START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,
ENCODING,FAILED,
SUCCESS,BAD_ENCODER,BAD_OUTPUT,BAD_TMP,SAVE};
147 #ifdef _A_FINIR_FIXME
148 void createPopupMenu();
149 void createRadioAction(Wt::WAction *,Wt::WAction *,
const std::string&,
unsigned int a=1);
151 void rescaleImage(
int,
int);
152 #ifdef _A_FINIR_FIXME
153 bool printPDF(
const std::string,
int,WImage);
154 void showMovieParametersDialog();
155 void initMovieParameters();
156 Wt::WString createTempFolder();
157 Wt::WString removeTempFolder();
158 void setRecordingStatus(RECORDING_STEP);
159 void setRecordingInfos(Wt::WString);
160 Wt::WString getProcessErrorMsg();
165 mouseActions fMouseAction;
166 Wt::WPoint fLastPos1;
167 Wt::WPoint fLastPos2;
168 Wt::WPoint fLastPos3;
184 bool fHoldRotateEvent;
186 Wt::WString fEncoderPath;
187 Wt::WString fTempFolderPath;
188 Wt::WString fMovieTempFolderPath;
189 Wt::WString fSaveFileName;
190 Wt::WString fParameterFileName;
191 #ifdef _A_FINIR_FIXME
192 WAction *fRotateAction;
193 WAction *fMoveAction;
194 WAction *fPickAction;
195 WAction *fFullScreenOn;
196 WAction *fFullScreenOff;
197 WAction *fDrawingWireframe;
198 WAction *fDrawingLineRemoval;
199 WAction *fDrawingSurfaceRemoval;
200 WAction *fDrawingLineSurfaceRemoval;
202 G4OpenGLWtMovieDialog* fMovieParametersDialog;
203 RECORDING_STEP fRecordingStep;
205 Wt::WTime *fLastEventTime;
207 int fNbMaxFramesPerSec;
208 float fNbMaxAnglePerSec;
209 int fLaunchSpinDelay;
210 Wt::WTabWidget* fUISceneTreeComponentsTBWidget;
216 bool fControlKeyPress;
221 #ifdef _A_FINIR_FIXME
222 void rotateTheta(
int);
230 void startPauseVideo();
233 #ifdef _A_FINIR_FIXME
234 void actionMouseRotate();
235 void actionMouseMove();
236 void actionMousePick();
237 void actionDrawingWireframe();
238 void actionDrawingLineRemoval();
239 void actionDrawingSurfaceRemoval();
240 void actionDrawingLineSurfaceRemoval();
241 void actionSaveImage();
242 void actionChangeBackgroundColor();
243 void actionChangeTextColor();
244 void actionChangeDefaultColor();
245 void actionMovieParameters();
248 void showShortcuts();
249 #ifdef _A_FINIR_FIXME
250 void toggleDrawingAction(
int);
251 void toggleMouseAction(mouseActions);
252 void toggleRepresentation(
bool);
253 void toggleProjection(
bool);
254 void toggleTransparency(
bool);
255 void toggleAntialiasing(
bool);
256 void toggleHaloing(
bool);
257 void toggleAux(
bool);
258 void toggleFullScreen(
bool);
260 void processEncodeFinished();
261 void processLookForFinished();
262 void processEncodeStdout();