Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
HeightDlg.h
1 //
2 // HeightDlg.h
3 //
4 // Copyright (c) 2002-2005 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef __HeightDlg_H__
9 #define __HeightDlg_H__
10 
11 #ifndef WX_PRECOMP
12  #include "wx/wx.h"
13 #endif
14 
15 #include "vtui_UI.h"
16 #include "vtui/AutoDialog.h"
17 #include "vtui/wxString2.h"
18 #include "vtdata/Building.h"
19 #include "vtdata/HeightField.h"
20 
21 
22 // WDR: class declarations
23 
24 //---------------------------------------------------------------------------
25 // CHeightDialog
26 //---------------------------------------------------------------------------
27 
29 {
30 public:
31  // constructors and destructors
32  CHeightDialog( wxWindow *parent, wxWindowID id, const wxString &title,
33  const wxPoint& pos = wxDefaultPosition,
34  const wxSize& size = wxDefaultSize,
35  long style = wxDEFAULT_DIALOG_STYLE );
36 
37  void Setup(vtBuilding * const pBuilding, vtHeightField *pHeightField);
38  void OnLeftClickGrid( wxGridEvent &event );
39  void OnGridCellChange( wxGridEvent &event );
40 
41  // WDR: method declarations for CHeightDialog
42  wxGrid* GetHeightgrid() { return (wxGrid*) FindWindow( ID_HEIGHTGRID ); }
43  wxTextCtrl* GetBaselineoffset() { return (wxTextCtrl*) FindWindow( ID_BASELINEOFFSET ); }
44 
45 protected:
46  // WDR: member variable declarations for CHeightDialog
47 
48 protected:
49  void ValidateGrid();
50  // WDR: handler declarations for CHeightDialog
51  void OnCancel( wxCommandEvent &event );
52  void OnBaselineOffset( wxCommandEvent &event );
53  void OnOK( wxCommandEvent &event );
54  void OnRecalculateHeights( wxCommandEvent &event );
55  void OnClose(wxCloseEvent& event);
56 
57 private:
58  enum {BASELINE_COL = 0, RELATIVE_COL, ACTIVE_COL, STOREYS_COL, HEIGHT_COL};
59  enum {SCALE_EVENLY = 0, SCALE_FROM_BOTTOM, SCALE_FROM_TOP};
60  bool m_bGridModified;
61  wxGrid *m_pHeightGrid;
62  vtBuilding *m_pBuilding;
63  vtHeightField *m_pHeightField;
64  wxTextCtrl* m_pBaselineOffset;
65  float m_fBaselineOffset;
66  int m_BottomRow;
67  int m_NumLevels;
68  double m_dBaseLine;
69  vtBuilding m_OldBuilding;
70  DECLARE_EVENT_TABLE()
71 };
72 
73 
74 
75 
76 #endif