[5809313] | 1 | // |
---|
| 2 | // mainfrm.h |
---|
| 3 | // |
---|
| 4 | // Main frame handling for Aven. |
---|
| 5 | // |
---|
| 6 | // Copyright (C) 2000-2001, Mark R. Shinwell. |
---|
[abfd57a] | 7 | // Copyright (C) 2001-2003,2004,2005 Olly Betts |
---|
[5809313] | 8 | // |
---|
| 9 | // This program is free software; you can redistribute it and/or modify |
---|
| 10 | // it under the terms of the GNU General Public License as published by |
---|
| 11 | // the Free Software Foundation; either version 2 of the License, or |
---|
| 12 | // (at your option) any later version. |
---|
| 13 | // |
---|
| 14 | // This program is distributed in the hope that it will be useful, |
---|
| 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | // GNU General Public License for more details. |
---|
| 18 | // |
---|
| 19 | // You should have received a copy of the GNU General Public License |
---|
| 20 | // along with this program; if not, write to the Free Software |
---|
[1b71c05] | 21 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
[5809313] | 22 | // |
---|
| 23 | |
---|
| 24 | #ifndef mainfrm_h |
---|
| 25 | #define mainfrm_h |
---|
| 26 | |
---|
| 27 | #include "wx.h" |
---|
[09d50cc] | 28 | #include <wx/docview.h> // for m_FileHistory |
---|
| 29 | #include <wx/print.h> |
---|
| 30 | #include <wx/printdlg.h> |
---|
[da4ddfe] | 31 | |
---|
[137bf99] | 32 | #include "gfxcore.h" |
---|
| 33 | #include "message.h" |
---|
[156dc16] | 34 | #include "aventreectrl.h" |
---|
[2d9ed8ad] | 35 | #include "img.h" |
---|
[156dc16] | 36 | |
---|
[137bf99] | 37 | #include <list> |
---|
| 38 | using namespace std; |
---|
[5341d94] | 39 | |
---|
[f17e6dc6] | 40 | #include <math.h> |
---|
| 41 | |
---|
[137bf99] | 42 | extern const int NUM_DEPTH_COLOURS; |
---|
| 43 | |
---|
| 44 | enum { |
---|
[e1d6f8b] | 45 | menu_FILE_PAGE_SETUP = 1000, |
---|
[d8a725c] | 46 | menu_FILE_EXPORT, |
---|
[137bf99] | 47 | menu_ROTATION_START, |
---|
| 48 | menu_ROTATION_STOP, |
---|
[2d9ed8ad] | 49 | menu_ROTATION_TOGGLE, |
---|
[137bf99] | 50 | menu_ROTATION_SPEED_UP, |
---|
| 51 | menu_ROTATION_SLOW_DOWN, |
---|
| 52 | menu_ROTATION_REVERSE, |
---|
| 53 | menu_ROTATION_STEP_CCW, |
---|
| 54 | menu_ROTATION_STEP_CW, |
---|
| 55 | menu_ORIENT_MOVE_NORTH, |
---|
| 56 | menu_ORIENT_MOVE_EAST, |
---|
| 57 | menu_ORIENT_MOVE_SOUTH, |
---|
| 58 | menu_ORIENT_MOVE_WEST, |
---|
| 59 | menu_ORIENT_SHIFT_LEFT, |
---|
| 60 | menu_ORIENT_SHIFT_RIGHT, |
---|
| 61 | menu_ORIENT_SHIFT_UP, |
---|
| 62 | menu_ORIENT_SHIFT_DOWN, |
---|
| 63 | menu_ORIENT_PLAN, |
---|
| 64 | menu_ORIENT_ELEVATION, |
---|
| 65 | menu_ORIENT_HIGHER_VP, |
---|
| 66 | menu_ORIENT_LOWER_VP, |
---|
| 67 | menu_ORIENT_DEFAULTS, |
---|
| 68 | menu_VIEW_SHOW_LEGS, |
---|
| 69 | menu_VIEW_SHOW_CROSSES, |
---|
| 70 | menu_VIEW_SHOW_NAMES, |
---|
| 71 | menu_VIEW_SHOW_SURFACE, |
---|
| 72 | menu_VIEW_SURFACE_DEPTH, |
---|
| 73 | menu_VIEW_SURFACE_DASHED, |
---|
| 74 | menu_VIEW_SHOW_OVERLAPPING_NAMES, |
---|
[fe444b8] | 75 | menu_VIEW_SHOW_ENTRANCES, |
---|
| 76 | menu_VIEW_SHOW_FIXED_PTS, |
---|
| 77 | menu_VIEW_SHOW_EXPORTED_PTS, |
---|
[e3513a5] | 78 | menu_VIEW_INDICATORS, |
---|
[137bf99] | 79 | menu_VIEW_COMPASS, |
---|
| 80 | menu_VIEW_CLINO, |
---|
| 81 | menu_VIEW_DEPTH_BAR, |
---|
| 82 | menu_VIEW_SCALE_BAR, |
---|
| 83 | menu_VIEW_STATUS_BAR, |
---|
[c1cf79d] | 84 | menu_VIEW_GRID, |
---|
[9059368] | 85 | menu_VIEW_SIDE_PANEL, |
---|
[7a89dc2] | 86 | menu_VIEW_METRIC, |
---|
| 87 | menu_VIEW_DEGREES, |
---|
[137bf99] | 88 | menu_CTL_REVERSE, |
---|
[1fd2edb] | 89 | menu_CTL_CANCEL_DIST_LINE, |
---|
[2a02de2] | 90 | button_HIDE |
---|
[137bf99] | 91 | }; |
---|
| 92 | |
---|
| 93 | class PointInfo { |
---|
| 94 | friend class MainFrm; |
---|
[c6d95d8] | 95 | Double x, y, z; |
---|
[137bf99] | 96 | bool isLine; // false => move, true => draw line |
---|
| 97 | bool isSurface; |
---|
| 98 | |
---|
| 99 | public: |
---|
[c6d95d8] | 100 | Double GetX() const { return x; } |
---|
| 101 | Double GetY() const { return y; } |
---|
| 102 | Double GetZ() const { return z; } |
---|
[137bf99] | 103 | bool IsLine() const { return isLine; } |
---|
| 104 | bool IsSurface() const { return isSurface; } |
---|
| 105 | }; |
---|
| 106 | |
---|
[fa42426] | 107 | #define LFLAG_SURFACE img_SFLAG_SURFACE |
---|
| 108 | #define LFLAG_UNDERGROUND img_SFLAG_UNDERGROUND |
---|
| 109 | #define LFLAG_EXPORTED img_SFLAG_EXPORTED |
---|
| 110 | #define LFLAG_FIXED img_SFLAG_FIXED |
---|
| 111 | #define LFLAG_ENTRANCE 0x100 |
---|
| 112 | #define LFLAG_HIGHLIGHTED 0x200 |
---|
| 113 | |
---|
| 114 | class LabelPlotCmp; |
---|
| 115 | |
---|
[137bf99] | 116 | class LabelInfo { |
---|
| 117 | friend class MainFrm; |
---|
[d5de678] | 118 | friend class GfxCore; |
---|
[fa42426] | 119 | friend class LabelPlotCmp; |
---|
[c6d95d8] | 120 | Double x, y, z; |
---|
[137bf99] | 121 | wxString text; |
---|
[2d9ed8ad] | 122 | int flags; |
---|
[6dde19f] | 123 | wxTreeItemId tree_id; |
---|
[e521e318] | 124 | |
---|
| 125 | public: |
---|
[c6d95d8] | 126 | Double GetX() const { return x; } |
---|
| 127 | Double GetY() const { return y; } |
---|
| 128 | Double GetZ() const { return z; } |
---|
[2d9ed8ad] | 129 | |
---|
[137bf99] | 130 | wxString GetText() const { return text; } |
---|
[2d9ed8ad] | 131 | |
---|
[e582cd4] | 132 | bool IsEntrance() const { return (flags & LFLAG_ENTRANCE) != 0; } |
---|
| 133 | bool IsFixedPt() const { return (flags & LFLAG_FIXED) != 0; } |
---|
| 134 | bool IsExportedPt() const { return (flags & LFLAG_EXPORTED) != 0; } |
---|
| 135 | bool IsUnderground() const { return (flags & LFLAG_UNDERGROUND) != 0; } |
---|
| 136 | bool IsSurface() const { return (flags & LFLAG_SURFACE) != 0; } |
---|
| 137 | bool IsHighLighted() const { return (flags & LFLAG_HIGHLIGHTED) != 0; } |
---|
[137bf99] | 138 | }; |
---|
| 139 | |
---|
| 140 | class MainFrm : public wxFrame { |
---|
[732b9b0] | 141 | wxFileHistory m_history; |
---|
[fa2cd10] | 142 | public: // FIXME: just public for workaround bodge in |
---|
| 143 | // wxSplitterWindow::OnSplitterDClick |
---|
[9059368] | 144 | int m_SashPosition; |
---|
[fa2cd10] | 145 | private: |
---|
[137bf99] | 146 | list<PointInfo*>* m_Points; |
---|
| 147 | list<LabelInfo*> m_Labels; |
---|
[c6d95d8] | 148 | Double m_XExt; |
---|
| 149 | Double m_YExt; |
---|
| 150 | Double m_ZExt; |
---|
| 151 | Double m_XMin; |
---|
| 152 | Double m_YMin; |
---|
| 153 | Double m_ZMin; |
---|
[137bf99] | 154 | int m_NumLegs; |
---|
| 155 | int m_NumPoints; |
---|
| 156 | int m_NumCrosses; |
---|
| 157 | int m_NumExtraLegs; |
---|
| 158 | GfxCore* m_Gfx; |
---|
| 159 | wxPen* m_Pens; |
---|
| 160 | wxBrush* m_Brushes; |
---|
[a9a32f2] | 161 | int m_NumEntrances; |
---|
| 162 | int m_NumFixedPts; |
---|
| 163 | int m_NumExportedPts; |
---|
[156dc16] | 164 | wxSplitterWindow* m_Splitter; |
---|
| 165 | wxPanel* m_Panel; |
---|
| 166 | AvenTreeCtrl* m_Tree; |
---|
| 167 | wxTextCtrl* m_FindBox; |
---|
| 168 | wxStaticText* m_MousePtr; |
---|
| 169 | wxStaticText* m_Coords; |
---|
| 170 | wxStaticText* m_StnCoords; |
---|
| 171 | wxStaticText* m_StnName; |
---|
| 172 | wxStaticText* m_StnAlt; |
---|
| 173 | wxStaticText* m_Dist1; |
---|
| 174 | wxStaticText* m_Dist2; |
---|
| 175 | wxStaticText* m_Dist3; |
---|
[01faa28] | 176 | wxStaticText* m_Found; |
---|
[2a02de2] | 177 | wxCheckBox* m_RegexpCheckBox; |
---|
[156dc16] | 178 | wxString m_File; |
---|
[09d50cc] | 179 | wxString m_Title, m_DateStamp; |
---|
[9f9c05e] | 180 | int separator; // character separating survey levels (often '.') |
---|
[156dc16] | 181 | |
---|
[168df28] | 182 | Vector3 m_Offsets; |
---|
[8000d8f] | 183 | |
---|
[abfd57a] | 184 | wxPageSetupDialogData m_pageSetupData; |
---|
[09d50cc] | 185 | wxPrintData m_printData; |
---|
| 186 | |
---|
[90a3cd5] | 187 | wxString icon_path; |
---|
| 188 | |
---|
[156dc16] | 189 | void FillTree(); |
---|
[137bf99] | 190 | void ClearPointLists(); |
---|
[1d0cd97] | 191 | bool LoadData(const wxString& file, wxString prefix = ""); |
---|
[137bf99] | 192 | void SortIntoDepthBands(list<PointInfo*>& points); |
---|
[c6d95d8] | 193 | void IntersectLineWithPlane(Double x0, Double y0, Double z0, |
---|
| 194 | Double x1, Double y1, Double z1, |
---|
| 195 | Double z, Double& x, Double& y); |
---|
| 196 | Double GetDepthBoundaryBetweenBands(int a, int b); |
---|
| 197 | int GetDepthColour(Double z); |
---|
| 198 | void CentreDataset(Double xmin, Double ymin, Double zmin); |
---|
[137bf99] | 199 | |
---|
| 200 | wxString GetTabMsg(int key) { |
---|
[421b7d2] | 201 | wxString x(msg(key)); x.Replace("##", "\t"); x.Replace("@", "&"); return x; |
---|
[137bf99] | 202 | } |
---|
| 203 | |
---|
[9d3d8cc] | 204 | void InitialisePensAndBrushes(); |
---|
| 205 | void CreateMenuBar(); |
---|
| 206 | void CreateToolBar(); |
---|
| 207 | void CreateSidePanel(); |
---|
| 208 | |
---|
[137bf99] | 209 | public: |
---|
| 210 | MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size); |
---|
[5809313] | 211 | ~MainFrm(); |
---|
| 212 | |
---|
[732b9b0] | 213 | void OnMRUFile(wxCommandEvent& event); |
---|
[5901b62] | 214 | void OpenFile(const wxString& file, wxString survey = "", bool delay = false); |
---|
[8000d8f] | 215 | void OnFileOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
[137bf99] | 216 | |
---|
[2a02de2] | 217 | void OnFind(wxCommandEvent& event); |
---|
| 218 | void OnHide(wxCommandEvent& event); |
---|
| 219 | |
---|
[5809313] | 220 | void OnOpen(wxCommandEvent& event); |
---|
[8000d8f] | 221 | void OnFileOpenTerrain(wxCommandEvent& event); |
---|
[09d50cc] | 222 | void OnPrint(wxCommandEvent& event); |
---|
| 223 | void OnPageSetup(wxCommandEvent& event); |
---|
[d8a725c] | 224 | void OnExport(wxCommandEvent& event); |
---|
[5809313] | 225 | void OnQuit(wxCommandEvent& event); |
---|
[5ffa439] | 226 | |
---|
[573f4e9] | 227 | void OnAbout(wxCommandEvent& event); |
---|
[137bf99] | 228 | void OnClose(wxCloseEvent&); |
---|
| 229 | |
---|
[2dfd768] | 230 | void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
[4b1fc48] | 231 | |
---|
[168df28] | 232 | void OnKeyPress(wxKeyEvent &e) { |
---|
| 233 | if (m_Gfx) { |
---|
| 234 | m_Gfx->SetFocus(); |
---|
| 235 | m_Gfx->OnKeyPress(e); |
---|
| 236 | } |
---|
| 237 | } |
---|
| 238 | |
---|
[1064451] | 239 | void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[d8a725c] | 240 | void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[1064451] | 241 | |
---|
[137bf99] | 242 | // temporary bodges until event handling problem is sorted out: |
---|
| 243 | void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnDefaultsUpdate(event); } |
---|
| 244 | void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnPlanUpdate(event); } |
---|
| 245 | void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnElevationUpdate(event); } |
---|
| 246 | void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnDisplayOverlappingNamesUpdate(event); } |
---|
| 247 | void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowCrossesUpdate(event); } |
---|
[fe444b8] | 248 | void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowEntrancesUpdate(event); } |
---|
| 249 | void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowFixedPtsUpdate(event); } |
---|
| 250 | void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowExportedPtsUpdate(event); } |
---|
[137bf99] | 251 | void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowStationNamesUpdate(event); } |
---|
| 252 | void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurveyLegsUpdate(event); } |
---|
| 253 | void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceUpdate(event); } |
---|
| 254 | void OnShowSurfaceDepthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDepthUpdate(event); } |
---|
| 255 | void OnShowSurfaceDashedUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDashedUpdate(event); } |
---|
| 256 | void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveEastUpdate(event); } |
---|
| 257 | void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveNorthUpdate(event); } |
---|
| 258 | void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveSouthUpdate(event); } |
---|
| 259 | void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveWestUpdate(event); } |
---|
| 260 | void OnStartRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStartRotationUpdate(event); } |
---|
[7ebc3d1] | 261 | void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleRotationUpdate(event); } |
---|
[137bf99] | 262 | void OnStopRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStopRotationUpdate(event); } |
---|
| 263 | void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnReverseControlsUpdate(event); } |
---|
| 264 | void OnSlowDownUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSlowDownUpdate(event); } |
---|
| 265 | void OnSpeedUpUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSpeedUpUpdate(event); } |
---|
| 266 | void OnStepOnceAnticlockwiseUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceAnticlockwiseUpdate(event); } |
---|
| 267 | void OnStepOnceClockwiseUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceClockwiseUpdate(event); } |
---|
| 268 | void OnHigherViewpointUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnHigherViewpointUpdate(event); } |
---|
| 269 | void OnLowerViewpointUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnLowerViewpointUpdate(event); } |
---|
| 270 | void OnShiftDisplayDownUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayDownUpdate(event); } |
---|
| 271 | void OnShiftDisplayLeftUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayLeftUpdate(event); } |
---|
| 272 | void OnShiftDisplayRightUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayRightUpdate(event); } |
---|
| 273 | void OnShiftDisplayUpUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayUpUpdate(event); } |
---|
| 274 | void OnZoomInUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnZoomInUpdate(event); } |
---|
| 275 | void OnZoomOutUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnZoomOutUpdate(event); } |
---|
| 276 | void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleScalebarUpdate(event); } |
---|
| 277 | void OnToggleDepthbarUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleDepthbarUpdate(event); } |
---|
| 278 | void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewCompassUpdate(event); } |
---|
[c1cf79d] | 279 | void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewGridUpdate(event); } |
---|
[137bf99] | 280 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewClinoUpdate(event); } |
---|
| 281 | void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnReverseDirectionOfRotationUpdate(event); } |
---|
[1fd2edb] | 282 | void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnCancelDistLineUpdate(event); } |
---|
[e3513a5] | 283 | void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnIndicatorsUpdate(event); } |
---|
[137bf99] | 284 | |
---|
[2dfd768] | 285 | void OnDefaults(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnDefaults(); } |
---|
| 286 | void OnPlan(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnPlan(); } |
---|
| 287 | void OnElevation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnElevation(); } |
---|
| 288 | void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnDisplayOverlappingNames(); } |
---|
| 289 | void OnShowCrosses(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowCrosses(); } |
---|
| 290 | void OnShowEntrances(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowEntrances(); } |
---|
| 291 | void OnShowFixedPts(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowFixedPts(); } |
---|
| 292 | void OnShowExportedPts(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowExportedPts(); } |
---|
| 293 | void OnShowStationNames(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowStationNames(); } |
---|
| 294 | void OnShowSurveyLegs(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurveyLegs(); } |
---|
| 295 | void OnShowSurface(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurface(); } |
---|
| 296 | void OnShowSurfaceDepth(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurfaceDepth(); } |
---|
| 297 | void OnShowSurfaceDashed(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurfaceDashed(); } |
---|
| 298 | void OnMoveEast(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveEast(); } |
---|
| 299 | void OnMoveNorth(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveNorth(); } |
---|
| 300 | void OnMoveSouth(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveSouth(); } |
---|
| 301 | void OnMoveWest(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveWest(); } |
---|
| 302 | void OnStartRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStartRotation(); } |
---|
| 303 | void OnToggleRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleRotation(); } |
---|
| 304 | void OnStopRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStopRotation(); } |
---|
| 305 | void OnReverseControls(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnReverseControls(); } |
---|
| 306 | void OnSlowDown(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnSlowDown(); } |
---|
| 307 | void OnSpeedUp(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnSpeedUp(); } |
---|
| 308 | void OnStepOnceAnticlockwise(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStepOnceAnticlockwise(); } |
---|
| 309 | void OnStepOnceClockwise(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStepOnceClockwise(); } |
---|
| 310 | void OnHigherViewpoint(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnHigherViewpoint(); } |
---|
| 311 | void OnLowerViewpoint(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnLowerViewpoint(); } |
---|
| 312 | void OnShiftDisplayDown(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShiftDisplayDown(); } |
---|
| 313 | void OnShiftDisplayLeft(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShiftDisplayLeft(); } |
---|
| 314 | void OnShiftDisplayRight(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShiftDisplayRight(); } |
---|
| 315 | void OnShiftDisplayUp(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShiftDisplayUp(); } |
---|
| 316 | void OnZoomIn(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnZoomIn(); } |
---|
| 317 | void OnZoomOut(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnZoomOut(); } |
---|
| 318 | void OnToggleScalebar(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleScalebar(); } |
---|
| 319 | void OnToggleDepthbar(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleDepthbar(); } |
---|
| 320 | void OnViewCompass(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnViewCompass(); } |
---|
| 321 | void OnViewClino(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnViewClino(); } |
---|
| 322 | void OnViewGrid(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnViewGrid(); } |
---|
| 323 | void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnReverseDirectionOfRotation(); } |
---|
| 324 | void OnCancelDistLine(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnCancelDistLine(); } |
---|
[137bf99] | 325 | // end of horrible bodges |
---|
[421b7d2] | 326 | |
---|
[7a89dc2] | 327 | void OnToggleMetric(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleMetric(); } |
---|
| 328 | void OnToggleDegrees(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleDegrees(); } |
---|
[5757725] | 329 | |
---|
[7a89dc2] | 330 | void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleMetricUpdate(event); } |
---|
| 331 | void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleDegreesUpdate(event); } |
---|
[5757725] | 332 | |
---|
[9059368] | 333 | void OnViewSidePanelUpdate(wxUpdateUIEvent& event); |
---|
| 334 | void OnViewSidePanel(wxCommandEvent& event); |
---|
[b1de3e0] | 335 | void ToggleSidePanel(); |
---|
[137bf99] | 336 | |
---|
[003d953] | 337 | Double GetXExtent() const { return m_XExt; } |
---|
| 338 | Double GetYExtent() const { return m_YExt; } |
---|
| 339 | Double GetZExtent() const { return m_ZExt; } |
---|
| 340 | Double GetXMin() const { return m_XMin; } |
---|
| 341 | Double GetYMin() const { return m_YMin; } |
---|
| 342 | Double GetYMax() const { return m_YMin + m_YExt; } |
---|
| 343 | Double GetZMin() const { return m_ZMin; } |
---|
| 344 | Double GetZMax() const { return m_ZMin + m_ZExt; } |
---|
| 345 | |
---|
| 346 | int GetNumLegs() const { return m_NumLegs; } |
---|
| 347 | int GetNumPoints() const { return m_NumPoints; } |
---|
| 348 | int GetNumCrosses() const { return m_NumCrosses; } |
---|
[137bf99] | 349 | |
---|
[003d953] | 350 | int GetNumDepthBands() const { return NUM_DEPTH_COLOURS; } |
---|
[137bf99] | 351 | |
---|
[003d953] | 352 | wxPen GetPen(int band) const { |
---|
[421b7d2] | 353 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 354 | return m_Pens[band]; |
---|
[137bf99] | 355 | } |
---|
| 356 | |
---|
[003d953] | 357 | wxBrush GetBrush(int band) const { |
---|
[421b7d2] | 358 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 359 | return m_Brushes[band]; |
---|
[137bf99] | 360 | } |
---|
| 361 | |
---|
[003d953] | 362 | void GetColour(int band, Double& r, Double& g, Double& b) const; |
---|
[c6d95d8] | 363 | |
---|
[003d953] | 364 | wxPen GetSurfacePen() const { return m_Pens[NUM_DEPTH_COLOURS]; } |
---|
[137bf99] | 365 | |
---|
[6dde19f] | 366 | void SelectTreeItem(LabelInfo* label); |
---|
[1fd2edb] | 367 | void ClearTreeSelection(); |
---|
| 368 | |
---|
[003d953] | 369 | int GetNumFixedPts() const { return m_NumFixedPts; } |
---|
| 370 | int GetNumExportedPts() const { return m_NumExportedPts; } |
---|
| 371 | int GetNumEntrances() const { return m_NumEntrances; } |
---|
[a9a32f2] | 372 | |
---|
[156dc16] | 373 | void ClearCoords(); |
---|
| 374 | void SetCoords(Double x, Double y); |
---|
[7a89dc2] | 375 | void SetAltitude(Double z); |
---|
[156dc16] | 376 | |
---|
[168df28] | 377 | Double GetXOffset() const { return m_Offsets.getX(); } |
---|
| 378 | Double GetYOffset() const { return m_Offsets.getY(); } |
---|
| 379 | Double GetZOffset() const { return m_Offsets.getZ(); } |
---|
[156dc16] | 380 | |
---|
[39e460c9] | 381 | void SetMouseOverStation(LabelInfo* label); |
---|
| 382 | |
---|
[003d953] | 383 | list<PointInfo*>::iterator GetPointsNC(int band) const { |
---|
[421b7d2] | 384 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 385 | return m_Points[band].begin(); |
---|
[ee119518] | 386 | } |
---|
| 387 | |
---|
[003d953] | 388 | list<PointInfo*>::iterator GetPointsEndNC(int band) const { |
---|
[421b7d2] | 389 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 390 | return m_Points[band].end(); |
---|
[ee119518] | 391 | } |
---|
| 392 | |
---|
[003d953] | 393 | list<PointInfo*>::const_iterator GetPoints(int band) const { |
---|
[421b7d2] | 394 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 395 | return m_Points[band].begin(); |
---|
[137bf99] | 396 | } |
---|
| 397 | |
---|
[003d953] | 398 | list<PointInfo*>::const_iterator GetPointsEnd(int band) const { |
---|
[421b7d2] | 399 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 400 | return m_Points[band].end(); |
---|
[137bf99] | 401 | } |
---|
| 402 | |
---|
[fa42426] | 403 | list<LabelInfo*>::const_iterator GetLabels() const { |
---|
| 404 | return m_Labels.begin(); |
---|
| 405 | } |
---|
| 406 | |
---|
[003d953] | 407 | list<LabelInfo*>::const_iterator GetLabelsEnd() const { |
---|
[421b7d2] | 408 | return m_Labels.end(); |
---|
[137bf99] | 409 | } |
---|
[5809313] | 410 | |
---|
[fa42426] | 411 | list<LabelInfo*>::const_reverse_iterator GetRevLabels() const { |
---|
| 412 | return m_Labels.rbegin(); |
---|
| 413 | } |
---|
| 414 | |
---|
| 415 | list<LabelInfo*>::const_reverse_iterator GetRevLabelsEnd() const { |
---|
| 416 | return m_Labels.rend(); |
---|
| 417 | } |
---|
| 418 | |
---|
[8734409] | 419 | void ShowInfo(const LabelInfo *label); |
---|
| 420 | void DisplayTreeInfo(const wxTreeItemData* data); |
---|
[156dc16] | 421 | void TreeItemSelected(wxTreeItemData* data); |
---|
[abfd57a] | 422 | wxPageSetupDialogData * GetPageSetupData() { return &m_pageSetupData; } |
---|
[8bac36d6] | 423 | |
---|
[84cab34] | 424 | private: |
---|
| 425 | DECLARE_EVENT_TABLE() |
---|
[5809313] | 426 | }; |
---|
| 427 | |
---|
| 428 | #endif |
---|