2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 // PofView.h : main header file for the POFVIEW application
15 #include "wx/wxprec.h"
21 #include "wx/artprov.h"
22 #include "wx/treectrl.h"
23 #include "wx/glcanvas.h"
24 #include "wx/aboutdlg.h"
30 ///////////////////////////////////////////////////////////////////////////////
32 ///////////////////////////////////////////////////////////////////////////////
33 class AboutBox : public wxDialog
38 wxStaticBitmap* m_bitmap2;
39 wxStaticText* m_staticText3;
40 wxStaticText* m_staticText4;
45 AboutBox( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("About PofView"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
50 ///////////////////////////////////////////////////////////////////////////////
51 /// Class SubobjectsDialog
52 ///////////////////////////////////////////////////////////////////////////////
53 class SubobjectsDialog : public wxDialog
57 void AddModel(int sm, wxTreeItemId parent);
59 wxDECLARE_EVENT_TABLE();
67 wxTreeCtrl* m_treeCtrlSubobjects;
68 wxStaticText* m_staticTextName;
69 wxTextCtrl* m_textCtrlName;
70 wxStaticText* m_staticTextBspGenVersion;
71 wxTextCtrl* m_textCtrlBspGenVersion;
72 wxStaticText* m_staticTextPolys;
73 wxTextCtrl* m_textCtrlNumPolys;
74 wxStaticText* m_staticTextVerts;
75 wxTextCtrl* m_textCtrlNumVerts;
76 wxStaticText* m_staticTextMovementType;
77 wxTextCtrl* m_textCtrlMovementType;
78 wxStaticText* m_staticTextMovementAxis;
79 wxTextCtrl* m_textCtrlMovementAxis;
80 wxStaticText* m_staticTextDetail1;
81 wxStaticText* m_staticTextDetail2;
82 wxStaticText* m_staticTextDetail3;
83 wxStaticText* m_staticTextDetail4;
84 wxStaticText* m_staticTextDetail5;
85 wxStaticText* m_staticTextDetail6;
86 wxStaticText* m_staticTextPOFInfo;
88 void OnSelChanged(wxTreeEvent& event);
92 SubobjectsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Subobjects"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
98 ///////////////////////////////////////////////////////////////////////////////
99 /// Class PofViewTimer
100 ///////////////////////////////////////////////////////////////////////////////
104 class PofViewTimer : public wxTimer
107 PofViewCanvas *m_canvas;
111 PofViewTimer(PofViewCanvas *canvas);
119 ///////////////////////////////////////////////////////////////////////////////
120 /// Class PofViewCanvas
121 ///////////////////////////////////////////////////////////////////////////////
122 class PofViewCanvas : public wxGLCanvas
128 matrix m_ViewerOrient;
129 matrix m_ObjectOrient;
131 physics_info m_ViewerPhysics;
132 control_info m_Viewer_ci;
140 PofViewTimer *m_timer;
142 bool thrust_anim_inited;
145 int model_afterburner;
147 int shipp_thruster_bitmap;
148 float shipp_thruster_frame;
150 int shipp_thruster_glow_bitmap;
151 float shipp_thruster_glow_frame;
152 float shipp_thruster_glow_noise;
154 void InitThrusters();
156 wxDECLARE_EVENT_TABLE();
159 void OnPaint(wxPaintEvent& event);
160 void OnSize(wxSizeEvent& event);
161 void OnEraseBackground(wxEraseEvent& event);
162 void OnMouse(wxMouseEvent& event);
166 PofViewCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("TestGLCanvas"));
168 virtual ~PofViewCanvas();
171 void DoThrusterFrame(float frame_time);
172 void MoveViewer(float frame_time);
175 ///////////////////////////////////////////////////////////////////////////////
176 /// Class PofViewFrame
177 ///////////////////////////////////////////////////////////////////////////////
178 class PofViewFrame : public wxFrame
181 wxString m_file_name;
183 int m_current_detail_level;
185 bool pofview_initted;
187 wxGLContext* m_glContext;
192 void SetToolDefaults();
197 wxDECLARE_EVENT_TABLE();
203 ID_M_VIEW_TOOLBAR = 1000,
216 ID_M_VIEW_AUTOCENTER,
224 // do not alter order!!!
234 ID_M_TOOLSHOWDAMAGED,
235 ID_M_TOOLTOGGLELIGHTS,
236 ID_M_TOOLTOGGLETURRETS
239 wxMenuBar* m_menubar1;
244 wxToolBar* m_toolBar1;
246 wxStatusBar* m_statusBar1;
247 PofViewCanvas* m_canvas;
249 void OnFileOpen( wxCommandEvent& event );
250 void OnFileClose( wxCommandEvent& event );
251 void OnFilePrintSetup( wxCommandEvent& event );
252 void OnExit( wxCommandEvent& event );
253 void OnViewToolbar( wxCommandEvent& event );
254 void OnViewStatusBar( wxCommandEvent& event );
255 void OnHelpAbout( wxCommandEvent& event );
256 void OnSetDetail( wxCommandEvent& event );
257 void OnShowTree( wxCommandEvent& event );
261 PofViewFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("PofView"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
265 void SetDetailLevel(int detail_lvl);
267 const wxString GetFileName() { return m_file_name; }
268 int GetModelnum() { return m_model_num; }
269 int GetDetailLevel() { return m_current_detail_level; }
271 bool ShowOutline() { return m_menuView->IsChecked(ID_M_VIEW_OUTLINE); }
272 bool ShowShields() { return m_menuView->IsChecked(ID_M_VIEW_SHIELDS); }
273 bool ShowInvisible() { return m_menuView->IsChecked(ID_M_VIEW_INVISIBLE); }
274 bool ShowThrusters() { return m_menuView->IsChecked(ID_M_VIEW_THRUSTERS); }
275 bool ShowPivots() { return m_menuView->IsChecked(ID_M_VIEW_PIVTOS); }
276 bool ShowPaths() { return m_menuView->IsChecked(ID_M_VIEW_PATHS); }
277 bool ShowRadius() { return m_menuView->IsChecked(ID_M_VIEW_RADIUS); }
278 bool ShowBayPaths() { return m_menuView->IsChecked(ID_M_VIEW_BAYPATHS); }
280 bool ShowDamaged() { return m_toolBar1->GetToolState(ID_M_TOOLSHOWDAMAGED); }
282 bool UseSmoothing() { return m_menuView->IsChecked(ID_M_VIEW_SMOOTHING); }
283 bool UseTexturing() { return m_menuView->IsChecked(ID_M_VIEW_TEXTURING); }
284 bool UseAutocenter() { return m_menuView->IsChecked(ID_M_VIEW_AUTOCENTER); }
285 bool UseLighting() { return m_menuView->IsChecked(ID_M_VIEW_LIGHTING); }
287 bool LightingOn() { return m_toolBar1->GetToolState(ID_M_TOOLTOGGLELIGHTS); }