Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
DistanceDlg.h
1 //
2 // Name: DistanceDlg.h
3 //
4 // Copyright (c) 2002-2011 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __DistanceDlg_H__
9 #define __DistanceDlg_H__
10 
11 #include "vtui_UI.h"
12 #include "vtui/AutoDialog.h"
13 #include "vtdata/Projections.h"
14 
15 // WDR: class declarations
16 
17 //----------------------------------------------------------------------------
18 // DistanceDlg
19 //----------------------------------------------------------------------------
20 
22 {
23 public:
24  // constructors and destructors
25  DistanceDlg( wxWindow *parent, wxWindowID id, const wxString &title,
26  const wxPoint& pos = wxDefaultPosition,
27  const wxSize& size = wxDefaultSize,
28  long style = wxDEFAULT_DIALOG_STYLE );
29  ~DistanceDlg();
30 
31  // WDR: method declarations for DistanceDlg
32  wxButton* GetDistToolClear() { return (wxButton*) FindWindow( ID_DIST_TOOL_CLEAR ); }
33  wxRadioButton* GetRadioPath() { return (wxRadioButton*) FindWindow( ID_RADIO_PATH ); }
34  wxRadioButton* GetRadioLine() { return (wxRadioButton*) FindWindow( ID_RADIO_LINE ); }
35  wxTextCtrl* GetVertical() { return (wxTextCtrl*) FindWindow( ID_VERTICAL ); }
36  wxTextCtrl* GetGroundDist() { return (wxTextCtrl*) FindWindow( ID_GROUND_DIST ); }
37  wxChoice* GetUnits1() { return (wxChoice*) FindWindow( ID_UNITS1 ); }
38  wxChoice* GetUnits2() { return (wxChoice*) FindWindow( ID_UNITS2 ); }
39  wxChoice* GetUnits3() { return (wxChoice*) FindWindow( ID_UNITS3 ); }
40  wxChoice* GetUnits4() { return (wxChoice*) FindWindow( ID_UNITS4 ); }
41  wxChoice* GetUnits5() { return (wxChoice*) FindWindow( ID_UNITS5 ); }
42  wxTextCtrl* GetMapOffset() { return (wxTextCtrl*) FindWindow( ID_MAP_OFFSET ); }
43  wxTextCtrl* GetMapDist() { return (wxTextCtrl*) FindWindow( ID_MAP_DIST ); }
44  wxTextCtrl* GetGeodDist() { return (wxTextCtrl*) FindWindow( ID_GEOD_DIST ); }
45 
46  void SetProjection(const vtProjection &proj);
47  void SetPoints(const DPoint2 &p1, const DPoint2 &p2, bool bUpdate);
48  void SetPath(const DLine2 &path, bool bUpdate);
49  void GetPoints(DPoint2 &p1, DPoint2 &p2);
50  void SetGroundAndVertical(float fGround, float fVertical, bool bUpdate);
51  void UpdateAvailableUnits();
52  void ShowValues();
53  void Zero();
54 
55  virtual void OnMode(bool bPath) = 0;
56  virtual void SetPathToBase(const DLine2 &path) = 0;
57  virtual void Reset() = 0;
58 
59 private:
60  // WDR: member variable declarations for DistanceDlg
61  vtProjection m_proj;
62  int m_iUnits1;
63  int m_iUnits2;
64  int m_iUnits3;
65  int m_iUnits4;
66  int m_iUnits5;
67  DPoint2 m_p1, m_p2;
68  DLine2 m_path;
69  float m_fGround, m_fVertical;
70  bool m_bPathMode;
71  OCT *m_pTransformToGeo;
72 
73 private:
74  // WDR: handler declarations for DistanceDlg
75  void OnLoadPath( wxCommandEvent &event );
76  void OnClear( wxCommandEvent &event );
77  void OnRadioPath( wxCommandEvent &event );
78  void OnRadioLine( wxCommandEvent &event );
79  void OnUnits( wxCommandEvent &event );
80  void OnInitDialog(wxInitDialogEvent& event);
81 
82 private:
83  DECLARE_EVENT_TABLE()
84 };
85 
86 #endif // __DistanceDlg_H__
87