Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
StyleDlg.h
1 //
2 // Name: StyleDlg.h
3 //
4 // Copyright (c) 2004-2011 Virtual Terrain Project.
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __StyleDlg_H__
9 #define __StyleDlg_H__
10 
11 #include "wx/colourdata.h"
12 
13 #include "EnviroUI.h"
14 #include "vtui/AutoDialog.h"
15 #include "vtdata/Features.h"
16 
17 class vtTagArray;
18 
19 // WDR: class declarations
20 
21 //----------------------------------------------------------------------------
22 // StyleDlg
23 //----------------------------------------------------------------------------
24 
25 class StyleDlg: public StyleDlgBase
26 {
27 public:
28  // constructors and destructors
29  StyleDlg( wxWindow *parent, wxWindowID id, const wxString &title,
30  const wxPoint& pos = wxDefaultPosition,
31  const wxSize& size = wxDefaultSize,
32  long style = wxDEFAULT_DIALOG_STYLE );
33 
34  // This dialog can operate on a featureset in memory. If you do not give
35  // it a featureset, it will assume the layer's filename is a SHP on disk
36  // and use that instead.
37  void SetFeatureSet(const vtFeatureSet *pSet)
38  {
39  m_pFeatureSet = pSet;
40  }
41 
42  void SetOptions(const vtTagArray &Layer);
43  void GetOptions(vtTagArray &pLayer);
44  wxNotebook *GetNotebook() { return m_notebook; }
45 
46 private:
47  // WDR: method declarations for StyleDlg
48  wxTextCtrl* GetFeatureType() { return (wxTextCtrl*) FindWindow( ID_FEATURE_TYPE ); }
49  // Object Geometry
50  wxRadioButton* GetRadio1() { return (wxRadioButton*) FindWindow( ID_RADIO1 ); }
51  wxBitmapButton* GetObjectGeomColor() { return (wxBitmapButton*) FindWindow( ID_OBJECT_GEOM_COLOR ); }
52  wxRadioButton* GetRadioUseObjectColorField() { return (wxRadioButton*) FindWindow( ID_RADIO_USE_OBJECT_COLOR_FIELD ); }
53  wxChoice* GetObjectColorField() { return (wxChoice*) FindWindow( ID_OBJECT_COLOR_FIELD ); }
54  wxTextCtrl* GetObjectGeomSize() { return (wxTextCtrl*) FindWindow( ID_OBJECT_GEOM_SIZE ); }
55  wxTextCtrl* GetObjectGeomHeight() { return (wxTextCtrl*) FindWindow( ID_OBJECT_GEOM_HEIGHT ); }
56  // Line Geometry
57  wxRadioButton* GetRadio2() { return (wxRadioButton*) FindWindow( ID_RADIO2 ); }
58  wxBitmapButton* GetLineGeomColor() { return (wxBitmapButton*) FindWindow( ID_LINE_GEOM_COLOR ); }
59  wxRadioButton* GetRadioUseLineColorField() { return (wxRadioButton*) FindWindow( ID_RADIO_USE_LINE_COLOR_FIELD ); }
60  wxChoice* GetLineColorField() { return (wxChoice*) FindWindow( ID_LINE_COLOR_FIELD ); }
61  wxTextCtrl* GetLineGeomHeight() { return (wxTextCtrl*) FindWindow( ID_LINE_GEOM_HEIGHT ); }
62  wxTextCtrl* GetLineWidth() { return (wxTextCtrl*) FindWindow( ID_LINE_WIDTH ); }
63  wxCheckBox* GetTessellate() { return (wxCheckBox*) FindWindow( ID_TESSELLATE ); }
64  // Text Labels
65  wxRadioButton* GetRadio3() { return (wxRadioButton*) FindWindow( ID_RADIO3 ); }
66  wxBitmapButton* GetTextColor() { return (wxBitmapButton*) FindWindow( ID_TEXT_COLOR ); }
67  wxRadioButton* GetRadioUseTextColorField() { return (wxRadioButton*) FindWindow( ID_RADIO_USE_TEXT_COLOR_FIELD ); }
68  wxChoice* GetTextColorField() { return (wxChoice*) FindWindow( ID_TEXT_COLOR_FIELD ); }
69  wxChoice* GetTextField() { return (wxChoice*) FindWindow( ID_TEXT_FIELD ); }
70  wxTextCtrl* GetLabelHeight() { return (wxTextCtrl*) FindWindow( ID_LABEL_HEIGHT ); }
71  wxTextCtrl* GetLabelSize() { return (wxTextCtrl*) FindWindow( ID_LABEL_SIZE ); }
72  wxTextCtrl* GetFont() { return (wxTextCtrl*) FindWindow( ID_FONT ); }
73  // Texture Overlay
74  wxCheckBox* GetEnableTextureOverlay() { return (wxCheckBox*) FindWindow( ID_ENABLE_TEXTURE_OVERLAY ); }
75  wxChoice* GetTextureMode() { return (wxChoice*) FindWindow( ID_TEXTURE_MODE ); }
76 
77 private:
78  // WDR: member variable declarations for StyleDlg
79  const vtFeatureSet *m_pFeatureSet;
80  vtString m_strResolved;
81 
82  OGRwkbGeometryType m_type;
83  wxString m_strFeatureType;
84 
85  // Object Geometry
86  bool m_bObjectGeometry;
87  RGBi m_ObjectGeomColor;
88  bool m_bRadioUseObjectColorField;
89  int m_iObjectColorField;
90  float m_fObjectGeomHeight;
91  float m_fObjectGeomSize;
92 
93  // Line Geometry
94  bool m_bLineGeometry;
95  RGBi m_LineGeomColor;
96  bool m_bRadioUseLineColorField;
97  int m_iLineColorField;
98  float m_fLineGeomHeight;
99  float m_fLineWidth;
100  bool m_bTessellate;
101 
102  // Text Labels
103  bool m_bTextLabels;
104  RGBi m_LabelColor;
105  bool m_bRadioUseTextColorField;
106  int m_iTextColorField;
107  int m_iTextField;
108  float m_fLabelHeight;
109  float m_fLabelSize;
110  wxString m_strFont;
111 
112  // Texture Overlay
113  bool m_bTextureOverlay;
114  wxString m_strTextureMode;
115 
116  vtFeatureSetPoint2D m_DummyFeatures;
117  wxColourData m_ColourData;
118  wxColour m_Colour;
119 
120 private:
121  void RefreshFields();
122  void UpdateEnabling();
123  void UpdateColorButtons();
124  RGBi AskColor(const RGBi &input);
125 
126  // WDR: handler declarations for StyleDlg
127  void OnRadio( wxCommandEvent &event );
128  void OnLabelColor( wxCommandEvent &event );
129  void OnLineGeomColor( wxCommandEvent &event );
130  void OnObjectGeomColor( wxCommandEvent &event );
131  void OnCheck( wxCommandEvent &event );
132  void OnInitDialog(wxInitDialogEvent& event);
133 
134 private:
135  DECLARE_EVENT_TABLE()
136 };
137 
138 #endif // __StyleDlg_H__
139