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