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