Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
LinearStructDlg.h
1 //
2 // Name: LinearStructDlg.h
3 //
4 // Copyright (c) 2001-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __LinearStruct_H__
9 #define __LinearStruct_H__
10 
11 #include "vtui_UI.h"
12 #include "vtui/AutoDialog.h"
13 #include "vtdata/Fence.h"
14 #include "ProfileEditDlg.h"
15 
16 // WDR: class declarations
17 
18 //----------------------------------------------------------------------------
19 // LinearStructureDlg
20 //----------------------------------------------------------------------------
21 
23 {
24 public:
25  // constructors and destructors
26  LinearStructureDlg( wxWindow *parent, wxWindowID id, const wxString &title,
27  const wxPoint& pos = wxDefaultPosition,
28  const wxSize& size = wxDefaultSize,
29  long style = wxDEFAULT_DIALOG_STYLE );
30 
31  void SetStructureMaterials(const vtMaterialDescriptorArray *desc);
32 
33  void GuessStyle();
34  void OnInitDialog(wxInitDialogEvent& event);
35  void SlidersToValues(int which);
36  void ValuesToSliders();
37  void UpdateTypes();
38  void UpdateEnabling();
39  void SetOptions(const vtLinearParams &param);
40  void UpdateChoices();
41  void UpdateConnectChoices();
42  void UpdateProfiles();
43 
44  // Override this with desired result
45  virtual void OnSetOptions(const vtLinearParams &param, bool bProfileChanged = false) {};
46 
47  // WDR: method declarations for LinearStructureDlg
48  wxButton* GetProfileEdit() { return (wxButton*) FindWindow( ID_PROFILE_EDIT ); }
49  wxChoice* GetChoiceProfile() { return (wxChoice*) FindWindow( ID_CHOICE_PROFILE ); }
50  wxCheckBox* GetConstantTop() { return (wxCheckBox*) FindWindow( ID_CONSTANT_TOP ); }
51  wxSlider* GetSlopeSlider() { return (wxSlider*) FindWindow( ID_SLOPE_SLIDER ); }
52  wxTextCtrl* GetSlope() { return (wxTextCtrl*) FindWindow( ID_SLOPE ); }
53  wxTextCtrl* GetConnBottomEdit() { return (wxTextCtrl*) FindWindow( ID_CONN_BOTTOM_EDIT ); }
54  wxTextCtrl* GetConnTopEdit() { return (wxTextCtrl*) FindWindow( ID_CONN_TOP_EDIT ); }
55  wxTextCtrl* GetConnWidthEdit() { return (wxTextCtrl*) FindWindow( ID_CONN_WIDTH_EDIT ); }
56  wxTextCtrl* GetPostSizeEdit() { return (wxTextCtrl*) FindWindow( ID_POST_SIZE_EDIT ); }
57  wxTextCtrl* GetPostHeightEdit() { return (wxTextCtrl*) FindWindow( ID_POST_HEIGHT_EDIT ); }
58  wxTextCtrl* GetPostSpacingEdit() { return (wxTextCtrl*) FindWindow( ID_POST_SPACING_EDIT ); }
59 
60  wxSlider* GetConnBottomSlider() { return (wxSlider*) FindWindow( ID_CONN_BOTTOM_SLIDER ); }
61  wxSlider* GetConnTopSlider() { return (wxSlider*) FindWindow( ID_CONN_TOP_SLIDER ); }
62  wxSlider* GetConnWidthSlider() { return (wxSlider*) FindWindow( ID_CONN_WIDTH_SLIDER ); }
63  wxSlider* GetPostSizeSlider() { return (wxSlider*) FindWindow( ID_POST_SIZE_SLIDER ); }
64  wxSlider* GetPostHeightSlider() { return (wxSlider*) FindWindow( ID_POST_HEIGHT_SLIDER ); }
65  wxSlider* GetPostSpacingSlider() { return (wxSlider*) FindWindow( ID_POST_SPACING_SLIDER ); }
66 
67  wxChoice* GetExtension() { return (wxChoice*) FindWindow( ID_CHOICE_EXTENSION ); }
68  wxChoice* GetConnMat() { return (wxChoice*) FindWindow( ID_CONN_MATERIAL ); }
69  wxChoice* GetConnType() { return (wxChoice*) FindWindow( ID_CONN_TYPE ); }
70  wxChoice* GetPostType() { return (wxChoice*) FindWindow( ID_POST_TYPE ); }
71  wxChoice* GetStyle() { return (wxChoice*) FindWindow( ID_LINEAR_STRUCTURE_STYLE ); }
72 
73 protected:
74  void AddConnectStringsFromDescriptors(const vtMaterialDescriptorArray *mats);
75 
76  // WDR: member variable declarations for LinearStructureDlg
77  int m_iStyle;
78  int m_iPostHeight;
79  int m_iPostSpacing;
80  int m_iPostSize;
81  int m_iConnWidth;
82  int m_iConnTop;
83  int m_iConnBottom;
84  int m_iSlope;
85 
86  bool m_bSetting;
87 
88  vtLinearParams m_param;
89  const vtMaterialDescriptorArray *m_pStructureMaterials;
90  ProfileEditDlg *m_pProfileEditDlg;
91 
92 private:
93  // WDR: handler declarations for LinearStructureDlg
94  void OnProfileEdit( wxCommandEvent &event );
95  void OnChoiceProfile( wxCommandEvent &event );
96  void OnConstantTop( wxCommandEvent &event );
97  void OnTextEdit( wxCommandEvent &event );
98  void OnConnMaterial( wxCommandEvent &event );
99  void OnConnType( wxCommandEvent &event );
100  void OnPostType( wxCommandEvent &event );
101  void OnExtension( wxCommandEvent &event );
102  void OnSlider( wxCommandEvent &event );
103  void OnStyle( wxCommandEvent &event );
104 
105 private:
106  DECLARE_EVENT_TABLE()
107 };
108 
109 #endif // __LinearStruct_H__
110