Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
TParamsDlg.h
1 //
2 // Name: TParamsDlg.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __TParamsDlg_H__
9 #define __TParamsDlg_H__
10 
11 #include "EnviroUI.h"
12 #include "vtui/AutoDialog.h"
13 #include "vtlib/core/TParams.h"
14 #include "vtdata/vtTime.h"
15 
16 // WDR: class declarations
17 
18 //----------------------------------------------------------------------------
19 // TParamsDlg
20 //----------------------------------------------------------------------------
21 
23 {
24 public:
25  // constructors and destructors
26  TParamsDlg( wxWindow *parent, wxWindowID id, const wxString &title,
27  const wxPoint& pos = wxDefaultPosition,
28  const wxSize& size = wxDefaultSize,
29  long style = wxDEFAULT_DIALOG_STYLE );
30  ~TParamsDlg();
31 
32  void OnInitDialog(wxInitDialogEvent& event);
33 
34  bool TransferDataToWindow();
35  bool TransferDataFromWindow();
36 
37  void SetParams(const TParams &Params);
38  void GetParams(TParams &Params);
39  void UpdateEnableState();
40  void RefreshLocationFields();
41  void UpdateTimeString();
42  void UpdateColorControl();
43  void UpdateColorMapChoice();
44  void DeleteItem(wxListBox *pBox);
45  int FindLayerByFilename(const vtString &fname);
46  void UpdateScenarioChoices();
47 
48  // overall name
49  wxString m_strTerrainName;
50 
51  // elevation
52  bool m_bGrid;
53  bool m_bTin;
54  bool m_bTileset;
55  bool m_bExternal;
56  wxString m_strExternalData;
57  wxString m_strFilename;
58  wxString m_strFilenameTin;
59  wxString m_strFilenameTileset;
60  float m_fVerticalExag;
61 
62  // navigation
63  float m_fMinHeight;
64  int m_iNavStyle;
65  float m_fNavSpeed;
66  wxString m_strLocFile;
67  int m_iInitLocation;
68  wxString m_strInitLocation;
69  float m_fHither;
70  bool m_bAccel;
71  bool m_bAllowRoll;
72 
73  // LOD
74  int m_iLodMethod;
75  int m_iTriCount;
76  bool m_bTriStrips;
77  int m_iVertCount;
78  int m_iTileCacheSize;
79  bool m_bTileThreading;
80 
81  // time
82  bool m_bTimeOn;
83  vtTime m_InitTime;
84  float m_fTimeSpeed;
85 
86  // texture
87  int m_iTexture;
88  wxString m_strTextureSingle;
89  wxString m_strTextureTileset;
90  bool m_bTextureGradual;
91  float m_fTextureLODFactor;
92  bool m_bMipmap;
93  bool m_b16bit;
94  bool m_bPreLight;
95  float m_fPreLightFactor;
96  bool m_bCastShadows;
97  wxString m_strColorMap;
98  bool m_bTextureRetain;
99 
100  // detail texture
101  bool m_bDetailTexture;
102  wxString m_strDetailName;
103  float m_fDetailScale;
104  float m_fDetailDistance;
105 
106  // culture
107  bool m_bRoads;
108  wxString m_strRoadFile;
109  bool m_bHwy;
110  bool m_bPaved;
111  bool m_bDirt;
112  float m_fRoadHeight;
113  float m_fRoadDistance;
114  bool m_bTexRoads;
115  bool m_bRoadCulture;
116 
117  bool m_bPlants;
118  wxString m_strVegFile;
119  int m_iVegDistance;
120 
121  bool m_bFog;
122  float m_fFogDistance;
123 
124  wxString m_strContent;
125 
126  std::vector<vtTagArray> m_Layers;
127  vtStringArray m_AnimPaths;
128  int m_iStructDistance;
129  bool m_bStructureShadows;
130  int m_iShadowRez;
131  float m_fDarkness;
132  bool m_bShadowsDefaultOn;
133  bool m_bShadowsEveryFrame;
134  bool m_bLimitShadowArea;
135  float m_fShadowRadius;
136  bool m_bPagingStructures;
137  int m_iPagingStructureMax;
138  float m_fPagingStructureDist;
139 
140  // ephemeris
141  bool m_bSky;
142  wxString m_strSkyTexture;
143  bool m_bOceanPlane;
144  float m_fOceanPlaneLevel;
145  bool m_bWater;
146  wxString m_strFilenameWater;
147  bool m_bDepressOcean;
148  float m_fDepressOceanLevel;
149  bool m_bHorizon;
150  wxColor m_BgColor;
151 
152 // bool m_bVehicles;
153 // float m_fVehicleSize;
154 // float m_fVehicleSpeed;
155 
156  bool m_bRouteEnable; // not yet used
157  wxString m_strRouteFile; // not yet used
158 
159  // HUD
160  wxString m_strOverlayFile;
161  int m_iOverlayX;
162  int m_iOverlayY;
163  bool m_bOverview;
164  bool m_bCompass;
165 
166  wxString m_strInitScenario;
167 
168  wxString m_strInitTime;
169 // wxString m_strMemRequired;
170 
171 // Scenarios
172  std::vector<ScenarioParams> m_Scenarios;
173 
174  // WDR: method declarations for TParamsDlg
175  wxTextCtrl* GetTtExternalData() { return (wxTextCtrl*) FindWindow( ID_TT_EXTERNAL_DATA ); }
176  wxRadioButton* GetUseExternal() { return (wxRadioButton*) FindWindow( ID_USE_EXTERNAL ); }
177  wxChoice* GetScenarios() { return (wxChoice*) FindWindow( ID_CHOICE_SCENARIO ); }
178  wxButton* GetMovedownScenario() { return (wxButton*) FindWindow( ID_MOVEDOWN_SCENARIO ); }
179  wxButton* GetMoveupScenario() { return (wxButton*) FindWindow( ID_MOVEUP_SCENARIO ); }
180  wxButton* GetEditScenario() { return (wxButton*) FindWindow( ID_EDIT_SCENARIO ); }
181  wxButton* GetDeleteScenario() { return (wxButton*) FindWindow( ID_DELETE_SCENARIO ); }
182  wxListBox* GetScenarioList() { return (wxListBox*) FindWindow( ID_SCENARIO_LIST ); }
183  wxListBox* GetAnimPaths() { return (wxListBox*) FindWindow( ID_ANIM_PATHS ); }
184  wxComboBox* GetDTName() { return (wxComboBox*) FindWindow( ID_DT_NAME ); }
185  wxChoice* GetColorMap() { return (wxChoice*) FindWindow( ID_CHOICE_COLORS ); }
186  wxStaticBitmap* GetColorBitmap() { return (wxStaticBitmap*) FindWindow( ID_COLOR3 ); }
187  wxChoice* GetChoiceShadowRez() { return (wxChoice*) FindWindow( ID_CHOICE_SHADOW_REZ ); }
188  wxCheckBox* GetCheckStructureShadows() { return (wxCheckBox*) FindWindow( ID_CHECK_STRUCTURE_SHADOWS ); }
189  wxComboBox* GetContentFile() { return (wxComboBox*) FindWindow( ID_CONTENT_FILE ); }
190  wxChoice* GetNavStyle() { return (wxChoice*) FindWindow( ID_NAV_STYLE ); }
191  wxRadioButton* GetUseGrid() { return (wxRadioButton*) FindWindow( ID_USE_GRID ); }
192  wxRadioButton* GetUseTin() { return (wxRadioButton*) FindWindow( ID_USE_TIN ); }
193  wxRadioButton* GetUseTileset() { return (wxRadioButton*) FindWindow( ID_USE_TILESET ); }
194  wxComboBox* GetLocfile() { return (wxComboBox*) FindWindow( ID_LOCFILE ); }
195  wxRadioButton* GetTileset() { return (wxRadioButton*) FindWindow( ID_TILESET ); }
196  wxRadioButton* GetDerived() { return (wxRadioButton*) FindWindow( ID_DERIVED ); }
197  wxRadioButton* GetSingle() { return (wxRadioButton*) FindWindow( ID_SINGLE ); }
198  wxRadioButton* GetNone() { return (wxRadioButton*) FindWindow( ID_NONE ); }
199  wxTextCtrl* GetLightFactor() { return (wxTextCtrl*) FindWindow( ID_LIGHT_FACTOR ); }
200  wxComboBox* GetRoadfile() { return (wxComboBox*) FindWindow( ID_ROADFILE ); }
201  wxComboBox* GetTreefile() { return (wxComboBox*) FindWindow( ID_TREEFILE ); }
202  wxComboBox* GetTfileSingle() { return (wxComboBox*) FindWindow( ID_TFILE_SINGLE ); }
203  wxComboBox* GetTfileTileset() { return (wxComboBox*) FindWindow( ID_TFILE_TILESET ); }
204  wxChoice* GetLodmethod() { return (wxChoice*) FindWindow( ID_LODMETHOD ); }
205  wxComboBox* GetFilename() { return (wxComboBox*) FindWindow( ID_FILENAME ); }
206  wxComboBox* GetFilenameTin() { return (wxComboBox*) FindWindow( ID_FILENAME_TIN ); }
207  wxComboBox* GetFilenameTileset() { return (wxComboBox*) FindWindow( ID_FILENAME_TILES ); }
208  wxComboBox* GetSkytexture() { return (wxComboBox*) FindWindow( ID_SKYTEXTURE ); }
209  wxTextCtrl* GetFogDistance() { return (wxTextCtrl*) FindWindow( ID_FOG_DISTANCE ); }
210  wxChoice* GetLocField() { return (wxChoice*) FindWindow( ID_INIT_LOCATION ); }
211  wxListBox* GetStructFiles() { return (wxListBox*) FindWindow( ID_STRUCTFILES ); }
212  wxListBox* GetRawFiles() { return (wxListBox*) FindWindow( ID_RAWFILES ); }
213  wxListBox* GetImageFiles() { return (wxListBox*) FindWindow( ID_IMAGEFILES ); }
214  wxComboBox* GetFilenameWater() { return (wxComboBox*) FindWindow( ID_FILENAME_WATER ); }
215 
216  bool m_bReady;
217  bool m_bSetting;
218  vtStringArray m_TextureFiles;
219 
220 private:
221  // WDR: member variable declarations for TParamsDlg
222  wxComboBox* m_pFilename;
223  wxComboBox* m_pFilenameTin;
224  wxComboBox* m_pFilenameTileset;
225  wxListBox* m_pAnimFiles;
226  wxListBox* m_pRawFiles;
227  wxComboBox* m_pDTName;
228  wxChoice* m_pNavStyle;
229  wxTextCtrl* m_pPreLightFactor;
230  wxListBox* m_pStructFiles;
231  wxListBox* m_pImageFiles;
232  wxComboBox* m_pRoadFile;
233  wxComboBox* m_pTreeFile;
234  wxComboBox* m_pTextureFileSingle;
235  wxComboBox* m_pTextureFileTileset;
236  wxChoice* m_pLodMethod;
237  wxRadioButton* m_pNone;
238  wxRadioButton* m_pSingle;
239  wxRadioButton* m_pDerived;
240  wxRadioButton* m_pTiled;
241  wxRadioButton* m_pTileset;
242  wxComboBox* m_pLocFile;
243  wxComboBox* m_pSkyTexture;
244  wxChoice* m_pLocField;
245  wxChoice* m_pShadowRez;
246  wxChoice* m_pColorMap;
247  wxListBox* m_pScenarioList;
248  wxComboBox* m_pFilenameWater;
249 
250 private:
251  // WDR: handler declarations for TParamsDlg
252  void OnComboTFileSingle( wxCommandEvent &event );
253  void OnOverlay( wxCommandEvent &event );
254  void OnBgColor( wxCommandEvent &event );
255  void OnTextureNone( wxCommandEvent &event );
256  void OnTextureSingle( wxCommandEvent &event );
257  void OnTextureDerived( wxCommandEvent &event );
258  void OnTextureTiled( wxCommandEvent &event );
259  void OnTextureTileset( wxCommandEvent &event );
260  void OnEditColors( wxCommandEvent &event );
261  void OnCheckBoxElevType( wxCommandEvent &event );
262  void OnCheckBox( wxCommandEvent &event );
263  void OnListDblClickStructure( wxCommandEvent &event );
264  void OnListDblClickRaw( wxCommandEvent &event );
265  void OnListDblClickAnimPaths( wxCommandEvent &event );
266  void OnListDblClickImage( wxCommandEvent &event );
267  void OnChoiceLocFile( wxCommandEvent &event );
268  void OnChoiceInitLocation( wxCommandEvent &event );
269  void OnSetInitTime( wxCommandEvent &event );
270  void OnStyle( wxCommandEvent &event );
271  void OnScenarioListEvent( wxCommandEvent &event );
272  void OnNewScenario( wxCommandEvent &event );
273  void OnDeleteScenario( wxCommandEvent &event );
274  void OnEditScenario( wxCommandEvent &event );
275  void OnMoveUpScenario( wxCommandEvent &event );
276  void OnMoveDownSceanario( wxCommandEvent &event );
277  void OnChoiceScenario( wxCommandEvent &event );
278 
279 private:
280  DECLARE_EVENT_TABLE()
281 };
282 
283 #endif // __TParamsDlg_H__
284