Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
PlantDlg.h
1 //
2 // Name: PlantDlg.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __PlantDlg_H__
9 #define __PlantDlg_H__
10 
11 #include "EnviroUI.h"
12 #include "vtui/AutoDialog.h"
13 #include "../PlantingOptions.h"
14 #include "vtdata/Array.h"
15 
16 class vtSpeciesList3d;
17 class vtPlantInstance3d;
18 
19 // WDR: class declarations
20 
21 //---------------------------------------------------------------------------
22 // PlantDlg
23 //---------------------------------------------------------------------------
24 
25 class PlantDlg: public PlantDlgBase
26 {
27 public:
28  // constructors and destructors
29  PlantDlg( wxWindow *parent, wxWindowID id, const wxString &title,
30  const wxPoint& pos = wxDefaultPosition,
31  const wxSize& size = wxDefaultSize,
32  long style = wxDEFAULT_DIALOG_STYLE );
33  ~PlantDlg();
34 
35  void SetPlantList(vtSpeciesList3d *plants);
36  void SetDlgPlantOptions(PlantingOptions &opt);
37  void ShowOnlyAvailableSpecies(bool bFlag) { m_bOnlyAvailableSpecies = bFlag; }
38  void SetLang(const wxString &strTwoLetterLangCode);
39 
40  // WDR: method declarations for PlantDlg
41  wxChoice* GetLanguage() { return (wxChoice*) FindWindow( ID_LANGUAGE ); }
42  wxCheckBox* GetCommonNames() { return (wxCheckBox*) FindWindow( ID_COMMON_NAMES ); }
43  wxSlider* GetPlantVarianceSlider() { return (wxSlider*) FindWindow( ID_PLANT_VARIANCE_SLIDER ); }
44  wxRadioButton* GetPlantContinuous() { return (wxRadioButton*) FindWindow( ID_PLANT_CONTINUOUS ); }
45  wxRadioButton* GetPlantLinear() { return (wxRadioButton*) FindWindow( ID_PLANT_LINEAR ); }
46  wxRadioButton* GetPlantIndividual() { return (wxRadioButton*) FindWindow( ID_PLANT_INDIVIDUAL ); }
47  wxSlider* GetHeightSlider() { return (wxSlider*) FindWindow( ID_HEIGHT_SLIDER ); }
48  wxChoice* GetSpecies() { return (wxChoice*) FindWindow( ID_SPECIES ); }
49 
50 protected:
51  void UpdateEnabling();
52  void UpdateAvailableLanguages();
53  void UpdatePlantSizes();
54  void UpdatePlantNames();
55  void HeightToSlider();
56  void ModeToRadio();
57  void SpeciesIdToSpeciesIndex();
58  void SpeciesIndexToSpeciesId();
59  void UpdateHeightFromSpecies();
60 
61 private:
62  // WDR: member variable declarations for PlantDlg
63  bool m_bSetting;
64  bool m_bOnlyAvailableSpecies;
65 
66  // planting options
67  PlantingOptions m_opt;
68 
69  bool m_bCommonNames;
70  int m_iLanguage;
71  int m_iHeightSlider;
72  int m_iVarianceSlider;
73  int m_iSpeciesChoice;
74  wxString m_strLang;
75 
76  wxSlider *m_pHeightSlider;
77  wxChoice *m_pSpecies;
78  vtSpeciesList3d *m_pPlantList;
79 
80  // Each species has a size (height) which the user has indicated
81  vtArray<float> m_PreferredSizes;
82 
83 private:
84  // WDR: handler declarations for PlantDlg
85  void OnInitDialog(wxInitDialogEvent& event);
86  void OnLanguage( wxCommandEvent &event );
87  void OnCommonNames( wxCommandEvent &event );
88  void OnVarianceSlider( wxCommandEvent &event );
89  void OnVariance( wxCommandEvent &event );
90  void OnRadio( wxCommandEvent &event );
91  void OnSpacingEdit( wxCommandEvent &event );
92  void OnSelChangeSpecies( wxCommandEvent &event );
93  void OnHeightSlider( wxCommandEvent &event );
94  void OnHeightEdit( wxCommandEvent &event );
95 
96 private:
97  DECLARE_EVENT_TABLE()
98 };
99 
100 #endif // __PlantDlg_H__
101