00001 00008 #ifndef MAINWINDOW_H 00009 #define MAINWINDOW_H 00010 00011 #include <wx/wx.h> 00012 #include <wx/aboutdlg.h> 00013 #include "RTVolumeRenderer.h" 00014 #include "TransferFunctionWidget.h" 00015 #include "ColorBox.h" 00016 00022 class MainWindow : public wxFrame, ColorBoxListner 00023 { 00024 public: 00030 MainWindow(const wxString &name); 00031 00035 ~MainWindow(); 00036 00042 void OnQuit(wxCommandEvent &e); 00043 00049 void OnAbout(wxCommandEvent &e); 00050 00056 void OnReSize(wxSizeEvent &e); 00057 00063 void OnIdle(wxIdleEvent &e); 00064 00070 void OnDrawCubeClick(wxCommandEvent &e); 00071 00077 void OnDrawOutlineClick(wxCommandEvent &e); 00078 00084 void OnDrawPlanesClick(wxCommandEvent &e); 00085 00091 void OnUseTexClick(wxCommandEvent &e); 00092 00098 void OnDetachCameraClick(wxCommandEvent &e); 00099 00105 void OnRealTimeClick(wxCommandEvent &e); 00106 00112 void OnDrawTimer(wxTimerEvent &e); 00113 00119 void OnPlanesSliderScroll(wxScrollEvent &e); 00120 00126 void OnResolutionSelection(wxCommandEvent &e); 00127 00133 void OnLoadDataSetButtonClick(wxCommandEvent &e); 00134 00140 void OnSetLightDirButtonClick(wxCommandEvent &e); 00141 00147 void OnResetLightDirButtonClick(wxCommandEvent &e); 00148 00154 virtual void ColorChanged(const ColorBox *cbox); 00155 00156 protected: 00157 00161 void Update(float dt); 00162 00166 void Draw(); 00167 00168 const static int MIN_WIDTH = 800; 00169 const static int MIN_HEIGHT = 600; 00170 00171 wxAboutDialogInfo aboutInfo; 00172 00173 RTVolumeRenderer *renderer; 00174 00175 TransferFunctionWidget *transFunc; 00176 00177 wxSizer *topLevel; // enforces the minimum size of the window. 00178 wxStaticText *fpsDisplay; 00179 00180 ColorBox *bgColorBox; 00181 ColorBox *cubeColorBox; 00182 ColorBox *outlineColorBox; 00183 ColorBox *planeColorBox; 00184 ColorBox *lightColorBox; 00185 00186 wxTextCtrl *xDir; 00187 wxTextCtrl *yDir; 00188 wxTextCtrl *zDir; 00189 Vector3f lightDirection; 00190 00191 wxStaticText *volTexName; 00192 wxStaticText *volTexSize; 00193 00194 wxTimer drawTimer; // used in non-realtime more. 00195 bool realTime; 00196 00197 // frame rate counter 00198 float timer; 00199 float fps; 00200 wxLongLong lastTime; 00201 wxLongLong currTime; 00202 int counter; 00203 00204 DECLARE_EVENT_TABLE() 00205 }; 00206 00207 #endif // MAINWINDOW_H