Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ProjectionDlg.h
1 //
2 // Name: ProjectionDlg.h
3 //
4 // Copyright (c) 2002-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __ProjectionDlg_H__
9 #define __ProjectionDlg_H__
10 
11 #include "vtui_UI.h"
12 #include "vtui/AutoDialog.h"
13 #include "vtdata/Projections.h"
14 
15 enum ProjType
16 {
17  PT_ALBERS,
18  PT_GEO,
19  PT_HOM, // Hotine Oblique Mercator
20  PT_KROVAK,
21  PT_LAEA, // Lambert Azimuthal Equal-Area
22  PT_LCC, // Lambert Conformal Conic
23  PT_LCC1SP, // Lambert Conformal Conic with 1 Standard Parallel
24  PT_NZMG,
25  PT_OS,
26  PT_PS,
27  PT_SINUS,
28  PT_STEREO,
29  PT_MERC,
30  PT_TM,
31  PT_UTM,
32  PT_DYMAX
33 };
34 
35 // WDR: class declarations
36 
37 //----------------------------------------------------------------------------
38 // ProjectionDlg
39 //----------------------------------------------------------------------------
40 
42 {
43 public:
44  // constructors and destructors
45  ProjectionDlg( wxWindow *parent, wxWindowID id, const wxString &title,
46  const wxPoint& pos = wxDefaultPosition,
47  const wxSize& size = wxDefaultSize,
48  long style = wxDEFAULT_DIALOG_STYLE );
49 
50  void SetProjection(const vtProjection &proj);
51  void GetProjection(vtProjection &proj);
52  void SetGeoRefPoint(const DPoint2 &p) { m_GeoRefPoint = p; }
53 
54 protected:
55  // WDR: method declarations for ProjectionDlg
56  wxListCtrl* GetProjparam() { return (wxListCtrl*) FindWindow( ID_PROJPARAM ); }
57  wxChoice* GetHorizchoice() { return (wxChoice*) FindWindow( ID_HORUNITS ); }
58  wxChoice* GetZonechoice() { return (wxChoice*) FindWindow( ID_ZONE ); }
59  wxChoice* GetDatumchoice() { return (wxChoice*) FindWindow( ID_DATUM ); }
60  wxChoice* GetProjchoice() { return (wxChoice*) FindWindow( ID_PROJ ); }
61  wxTextCtrl* GetEllipsoid() { return (wxTextCtrl*) FindWindow( ID_ELLIPSOID ); }
62 
63  void SetUIFromProjection();
64  void SetProjectionUI(ProjType type);
65  void UpdateControlStatus();
66  void DisplayProjectionSpecificParams();
67  void AskStatePlane();
68  void RefreshDatums();
69  void UpdateDatumStatus();
70  void UpdateEllipsoid();
71 
72 private:
73  // WDR: member variable declarations for ProjectionDlg
74  wxListCtrl *m_pParamCtrl;
75  wxChoice *m_pZoneCtrl;
76  wxChoice *m_pHorizCtrl;
77  wxChoice *m_pDatumCtrl;
78  wxChoice *m_pProjCtrl;
79 
80  vtProjection m_proj;
81  ProjType m_eProj;
82  int m_iDatum;
83  int m_iZone;
84  int m_iProj;
85  int m_iUnits;
86  bool m_bShowAllDatums;
87  bool m_bInitializedUI;
88  DPoint2 m_GeoRefPoint;
89 
90 private:
91  // WDR: handler declarations for ProjectionDlg
92  void OnProjSave( wxCommandEvent &event );
93  void OnProjLoad( wxCommandEvent &event );
94  void OnDatum( wxCommandEvent &event );
95  void OnItemRightClick( wxListEvent &event );
96  void OnHorizUnits( wxCommandEvent &event );
97  void OnZone( wxCommandEvent &event );
98  void OnSetStatePlane( wxCommandEvent &event );
99  void OnSetEPSG( wxCommandEvent &event );
100  void OnProjChoice( wxCommandEvent &event );
101  void OnInitDialog(wxInitDialogEvent& event);
102  void OnShowAllDatums( wxCommandEvent &event );
103 
104 private:
105  DECLARE_EVENT_TABLE()
106 };
107 
108 #endif // __ProjectionDlg_H__
109