33 #ifdef G4VIS_BUILD_OPENGLWT_DRIVER 
   35 #ifndef G4OPENGLWTVIEWER_HH 
   36 #define G4OPENGLWTVIEWER_HH 
   45 #include <Wt/WContainerWidget> 
   46 #include <Wt/WMatrix4x4> 
   48 class G4OpenGLSceneHandler;
 
   53 class WContextMenuEvent;
 
   63 class G4OpenGLSceneHandler;
 
   64 class G4OpenGLWtMovieDialog;
 
   66 class G4OpenGLWtViewer:  
virtual public G4OpenGLViewer {
 
   69   G4OpenGLWtViewer (G4OpenGLSceneHandler& scene);
 
   70   virtual ~G4OpenGLWtViewer ();
 
   71   virtual void updateWWidget()=0;
 
   73   Wt::WMatrix4x4 mMatrix;
 
   76   Wt::WString setEncoderPath(Wt::WString path);
 
   77   Wt::WString getEncoderPath();
 
   78   Wt::WString setTempFolderPath(Wt::WString path);
 
   79   Wt::WString getTempFolderPath();
 
   80   Wt::WString setSaveFileName(Wt::WString path);
 
   81   Wt::WString getSaveFileName();
 
   96   bool isReadyToEncode();
 
   97   void resetRecording();
 
  101   bool generateMpegEncoderParameters();
 
  102   void displayRecordingStatus();
 
  104   void drawText(
const char * ,
int x,
int y,
int z, 
int size);
 
  106   void CreateGLWtContext ();
 
  107   virtual void CreateMainWindow (Wt::WGLWidget*,Wt::WString);
 
  108 #ifdef _A_FINIR_FIXME 
  109   void G4manageContextMenuEvent(Wt::WContextMenuEvent *e);
 
  111   void G4MousePressEvent(Wt::WMouseEvent *event);
 
  112   void G4MouseReleaseEvent();
 
  113   void G4MouseDoubleClickEvent();
 
  114   void G4MouseMoveEvent(Wt::WMouseEvent *event);
 
  116   void G4keyPressEvent (Wt::WKeyEvent * event); 
 
  117   void rotateWtScene(
float, 
float);
 
  118   void rotateWtSceneToggle(
float, 
float);
 
  119   void moveScene(
float, 
float, 
float,
bool);
 
  120 #ifdef _A_FINIR_FIXME 
  121   void updateKeyModifierState(Wt::KeyboardModifiers);
 
  124   inline Wt::WGLWidget* getGLWindow() {
 
  130   Wt::WGLWidget* fWindow;
 
  131   Wt::WWidget* fGLWindow;
 
  132   bool hasPendingEvents();
 
  133   void resizeGL(
int width, 
int height);
 
  135 #ifdef _A_FINIR_FIXME 
  136   void savePPMToTemp();
 
  138   int fRecordFrameNumber;
 
  145   enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4}; 
 
  146   enum RECORDING_STEP {WAIT,
START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,
ENCODING,FAILED,SUCCESS,BAD_ENCODER,BAD_OUTPUT,BAD_TMP,SAVE}; 
 
  148 #ifdef _A_FINIR_FIXME 
  149   void createPopupMenu();
 
  150   void createRadioAction(Wt::WAction *,Wt::WAction *, 
const std::string&,
unsigned int a=1);
 
  152   void rescaleImage(
int, 
int);
 
  153 #ifdef _A_FINIR_FIXME 
  154   bool printPDF(
const std::string,
int,WImage);  
 
  155   void showMovieParametersDialog();
 
  156   void initMovieParameters();
 
  157   Wt::WString createTempFolder();
 
  158   Wt::WString removeTempFolder();
 
  159   void setRecordingStatus(RECORDING_STEP);
 
  160   void setRecordingInfos(Wt::WString);
 
  161   Wt::WString getProcessErrorMsg();
 
  166   mouseActions fMouseAction; 
 
  167   Wt::WPoint fLastPos1;
 
  168   Wt::WPoint fLastPos2;
 
  169   Wt::WPoint fLastPos3;
 
  185   bool fHoldRotateEvent;
 
  187   Wt::WString fEncoderPath;
 
  188   Wt::WString fTempFolderPath;
 
  189   Wt::WString fMovieTempFolderPath;
 
  190   Wt::WString fSaveFileName;
 
  191   Wt::WString fParameterFileName;
 
  192 #ifdef _A_FINIR_FIXME 
  193   WAction *fRotateAction;
 
  194   WAction *fMoveAction;
 
  195   WAction *fPickAction;
 
  196   WAction *fFullScreenOn;
 
  197   WAction *fFullScreenOff;
 
  198   WAction *fDrawingWireframe;
 
  199   WAction *fDrawingLineRemoval;
 
  200   WAction *fDrawingSurfaceRemoval;
 
  201   WAction *fDrawingLineSurfaceRemoval;
 
  203   G4OpenGLWtMovieDialog* fMovieParametersDialog;
 
  204   RECORDING_STEP fRecordingStep;
 
  206   Wt::WTime *fLastEventTime;
 
  208   int fNbMaxFramesPerSec;
 
  209   float fNbMaxAnglePerSec;
 
  210   int fLaunchSpinDelay;
 
  211   Wt::WTabWidget* fUISceneTreeComponentsTBWidget;
 
  217   bool fControlKeyPress;
 
  222 #ifdef _A_FINIR_FIXME 
  223  void rotateTheta(
int);
 
  231   void startPauseVideo();
 
  234 #ifdef _A_FINIR_FIXME 
  235   void actionMouseRotate();
 
  236   void actionMouseMove();
 
  237   void actionMousePick();
 
  238   void actionDrawingWireframe();
 
  239   void actionDrawingLineRemoval();
 
  240   void actionDrawingSurfaceRemoval();
 
  241   void actionDrawingLineSurfaceRemoval();
 
  242   void actionSaveImage();
 
  243   void actionChangeBackgroundColor();
 
  244   void actionChangeTextColor();
 
  245   void actionChangeDefaultColor();
 
  246   void actionMovieParameters();
 
  249   void showShortcuts();
 
  250 #ifdef _A_FINIR_FIXME 
  251   void toggleDrawingAction(
int);
 
  252   void toggleMouseAction(mouseActions);
 
  253   void toggleRepresentation(
bool);
 
  254   void toggleProjection(
bool);
 
  255   void toggleTransparency(
bool);
 
  256   void toggleAntialiasing(
bool);
 
  257   void toggleHaloing(
bool);
 
  258   void toggleAux(
bool);
 
  259   void toggleFullScreen(
bool);
 
  261   void processEncodeFinished();
 
  262   void processLookForFinished();
 
  263   void processEncodeStdout();
 
std::vector< ExP01TrackerHit * > a