[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; |
---|
| 131 | |
---|
| 132 | public: |
---|
[c6d95d8] | 133 | Double GetX() const { return x; } |
---|
| 134 | Double GetY() const { return y; } |
---|
| 135 | Double GetZ() const { return z; } |
---|
[137bf99] | 136 | bool IsLine() const { return isLine; } |
---|
| 137 | bool IsSurface() const { return isSurface; } |
---|
| 138 | }; |
---|
| 139 | |
---|
| 140 | class LabelInfo { |
---|
| 141 | friend class MainFrm; |
---|
[d5de678] | 142 | friend class GfxCore; |
---|
[c6d95d8] | 143 | Double x, y, z; |
---|
[137bf99] | 144 | wxString text; |
---|
[2d9ed8ad] | 145 | int flags; |
---|
[6dde19f] | 146 | wxTreeItemId tree_id; |
---|
[e521e318] | 147 | |
---|
| 148 | public: |
---|
[c6d95d8] | 149 | Double GetX() const { return x; } |
---|
| 150 | Double GetY() const { return y; } |
---|
| 151 | Double GetZ() const { return z; } |
---|
[2d9ed8ad] | 152 | |
---|
[137bf99] | 153 | wxString GetText() const { return text; } |
---|
[2d9ed8ad] | 154 | |
---|
| 155 | bool IsEntrance() const { return flags & img_SFLAG_ENTRANCE; } |
---|
| 156 | bool IsFixedPt() const { return flags & img_SFLAG_FIXED; } |
---|
| 157 | bool IsExportedPt() const { return flags & img_SFLAG_EXPORTED; } |
---|
| 158 | bool IsUnderground() const { return flags & img_SFLAG_UNDERGROUND; } |
---|
| 159 | bool IsSurface() const { return flags & img_SFLAG_SURFACE; } |
---|
[137bf99] | 160 | }; |
---|
| 161 | |
---|
| 162 | class MainFrm : public wxFrame { |
---|
[732b9b0] | 163 | wxFileHistory m_history; |
---|
[9059368] | 164 | int m_SashPosition; |
---|
[137bf99] | 165 | list<PointInfo*>* m_Points; |
---|
| 166 | list<LabelInfo*> m_Labels; |
---|
[c6d95d8] | 167 | Double m_XExt; |
---|
| 168 | Double m_YExt; |
---|
| 169 | Double m_ZExt; |
---|
| 170 | Double m_XMin; |
---|
| 171 | Double m_YMin; |
---|
| 172 | Double m_ZMin; |
---|
[137bf99] | 173 | int m_NumLegs; |
---|
| 174 | int m_NumPoints; |
---|
| 175 | int m_NumCrosses; |
---|
| 176 | int m_NumExtraLegs; |
---|
| 177 | GfxCore* m_Gfx; |
---|
| 178 | wxPen* m_Pens; |
---|
| 179 | wxBrush* m_Brushes; |
---|
[a9a32f2] | 180 | int m_NumEntrances; |
---|
| 181 | int m_NumFixedPts; |
---|
| 182 | int m_NumExportedPts; |
---|
[156dc16] | 183 | wxSplitterWindow* m_Splitter; |
---|
| 184 | wxPanel* m_Panel; |
---|
| 185 | AvenTreeCtrl* m_Tree; |
---|
| 186 | wxTreeItemId m_TreeRoot; |
---|
| 187 | wxTextCtrl* m_FindBox; |
---|
| 188 | wxStaticText* m_MousePtr; |
---|
| 189 | wxStaticText* m_Coords; |
---|
| 190 | wxStaticText* m_StnCoords; |
---|
| 191 | wxStaticText* m_StnName; |
---|
| 192 | wxStaticText* m_StnAlt; |
---|
| 193 | wxStaticText* m_Dist1; |
---|
| 194 | wxStaticText* m_Dist2; |
---|
| 195 | wxStaticText* m_Dist3; |
---|
[01faa28] | 196 | wxStaticText* m_Found; |
---|
[2a02de2] | 197 | wxCheckBox* m_RegexpCheckBox; |
---|
[156dc16] | 198 | wxString m_File; |
---|
[2c30188] | 199 | #ifdef AVENPRES |
---|
| 200 | FILE* m_PresFP; |
---|
[156dc16] | 201 | bool m_PresLoaded; |
---|
| 202 | bool m_Recording; |
---|
[2c30188] | 203 | #endif |
---|
[156dc16] | 204 | |
---|
| 205 | struct { |
---|
[421b7d2] | 206 | Double x, y, z; |
---|
[156dc16] | 207 | } m_Offsets; |
---|
[8000d8f] | 208 | |
---|
[2c30188] | 209 | #ifdef AVENGL |
---|
[8000d8f] | 210 | struct { |
---|
| 211 | Double xmin, xmax; |
---|
| 212 | Double ymin, ymax; |
---|
| 213 | Double zmin, zmax; |
---|
| 214 | } m_TerrainExtents; |
---|
| 215 | |
---|
| 216 | struct { |
---|
| 217 | int x, y; |
---|
| 218 | } m_TerrainSize; |
---|
| 219 | |
---|
| 220 | Double* m_TerrainGrid; |
---|
[2c30188] | 221 | #endif |
---|
[421b7d2] | 222 | |
---|
[6dde19f] | 223 | void SetTreeItemColour(LabelInfo* label); |
---|
[156dc16] | 224 | void FillTree(); |
---|
[137bf99] | 225 | void ClearPointLists(); |
---|
[1d0cd97] | 226 | bool LoadData(const wxString& file, wxString prefix = ""); |
---|
[8000d8f] | 227 | #ifdef AVENGL |
---|
| 228 | bool LoadTerrain(const wxString& file); |
---|
| 229 | void OpenTerrain(const wxString& file); |
---|
| 230 | #endif |
---|
[137bf99] | 231 | void SortIntoDepthBands(list<PointInfo*>& points); |
---|
[c6d95d8] | 232 | void IntersectLineWithPlane(Double x0, Double y0, Double z0, |
---|
| 233 | Double x1, Double y1, Double z1, |
---|
| 234 | Double z, Double& x, Double& y); |
---|
| 235 | Double GetDepthBoundaryBetweenBands(int a, int b); |
---|
| 236 | int GetDepthColour(Double z); |
---|
| 237 | void CentreDataset(Double xmin, Double ymin, Double zmin); |
---|
[137bf99] | 238 | |
---|
| 239 | wxString GetTabMsg(int key) { |
---|
[421b7d2] | 240 | wxString x(msg(key)); x.Replace("##", "\t"); x.Replace("@", "&"); return x; |
---|
[137bf99] | 241 | } |
---|
| 242 | |
---|
[9d3d8cc] | 243 | void InitialisePensAndBrushes(); |
---|
| 244 | void CreateMenuBar(); |
---|
| 245 | void CreateToolBar(); |
---|
| 246 | void CreateSidePanel(); |
---|
| 247 | |
---|
[137bf99] | 248 | public: |
---|
| 249 | MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size); |
---|
[5809313] | 250 | ~MainFrm(); |
---|
| 251 | |
---|
[732b9b0] | 252 | void OnMRUFile(wxCommandEvent& event); |
---|
[5901b62] | 253 | void OpenFile(const wxString& file, wxString survey = "", bool delay = false); |
---|
[003d953] | 254 | #ifdef AVENPRES |
---|
[5ffa439] | 255 | void OnOpenPresUpdate(wxUpdateUIEvent& event); |
---|
[003d953] | 256 | #endif |
---|
[8000d8f] | 257 | void OnFileOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
[137bf99] | 258 | |
---|
[2a02de2] | 259 | void OnFind(wxCommandEvent& event); |
---|
| 260 | void OnHide(wxCommandEvent& event); |
---|
| 261 | |
---|
[5809313] | 262 | void OnOpen(wxCommandEvent& event); |
---|
[8000d8f] | 263 | void OnFileOpenTerrain(wxCommandEvent& event); |
---|
[003d953] | 264 | #ifdef AVENPRES |
---|
[156dc16] | 265 | void OnOpenPres(wxCommandEvent& event); |
---|
[003d953] | 266 | #endif |
---|
[5809313] | 267 | void OnQuit(wxCommandEvent& event); |
---|
[5ffa439] | 268 | |
---|
[003d953] | 269 | #ifdef AVENPRES |
---|
[156dc16] | 270 | void OnPresCreate(wxCommandEvent& event); |
---|
| 271 | void OnPresGo(wxCommandEvent& event); |
---|
| 272 | void OnPresGoBack(wxCommandEvent& event); |
---|
| 273 | void OnPresFinish(wxCommandEvent& event); |
---|
| 274 | void OnPresRestart(wxCommandEvent& event); |
---|
| 275 | void OnPresRecord(wxCommandEvent& event); |
---|
| 276 | void OnPresErase(wxCommandEvent& event); |
---|
| 277 | void OnPresEraseAll(wxCommandEvent& event); |
---|
[5ffa439] | 278 | |
---|
| 279 | void OnPresCreateUpdate(wxUpdateUIEvent& event); |
---|
| 280 | void OnPresGoUpdate(wxUpdateUIEvent& event); |
---|
| 281 | void OnPresGoBackUpdate(wxUpdateUIEvent& event); |
---|
| 282 | void OnPresFinishUpdate(wxUpdateUIEvent& event); |
---|
| 283 | void OnPresRestartUpdate(wxUpdateUIEvent& event); |
---|
| 284 | void OnPresRecordUpdate(wxUpdateUIEvent& event); |
---|
| 285 | void OnPresEraseUpdate(wxUpdateUIEvent& event); |
---|
| 286 | void OnPresEraseAllUpdate(wxUpdateUIEvent& event); |
---|
[003d953] | 287 | #endif |
---|
[5ffa439] | 288 | |
---|
[573f4e9] | 289 | void OnAbout(wxCommandEvent& event); |
---|
[137bf99] | 290 | void OnClose(wxCloseEvent&); |
---|
| 291 | |
---|
[4b1fc48] | 292 | void OnSetFocus(wxFocusEvent &e) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
| 293 | |
---|
[137bf99] | 294 | // temporary bodges until event handling problem is sorted out: |
---|
| 295 | void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnDefaultsUpdate(event); } |
---|
| 296 | void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnPlanUpdate(event); } |
---|
| 297 | void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnElevationUpdate(event); } |
---|
| 298 | void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnDisplayOverlappingNamesUpdate(event); } |
---|
| 299 | void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowCrossesUpdate(event); } |
---|
[fe444b8] | 300 | void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowEntrancesUpdate(event); } |
---|
| 301 | void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowFixedPtsUpdate(event); } |
---|
| 302 | void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowExportedPtsUpdate(event); } |
---|
[137bf99] | 303 | void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowStationNamesUpdate(event); } |
---|
| 304 | void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurveyLegsUpdate(event); } |
---|
| 305 | void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceUpdate(event); } |
---|
| 306 | void OnShowSurfaceDepthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDepthUpdate(event); } |
---|
| 307 | void OnShowSurfaceDashedUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDashedUpdate(event); } |
---|
| 308 | void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveEastUpdate(event); } |
---|
| 309 | void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveNorthUpdate(event); } |
---|
| 310 | void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveSouthUpdate(event); } |
---|
| 311 | void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveWestUpdate(event); } |
---|
| 312 | void OnStartRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStartRotationUpdate(event); } |
---|
[7ebc3d1] | 313 | void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleRotationUpdate(event); } |
---|
[137bf99] | 314 | void OnStopRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStopRotationUpdate(event); } |
---|
| 315 | void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnReverseControlsUpdate(event); } |
---|
| 316 | void OnSlowDownUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSlowDownUpdate(event); } |
---|
| 317 | void OnSpeedUpUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSpeedUpUpdate(event); } |
---|
| 318 | void OnStepOnceAnticlockwiseUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceAnticlockwiseUpdate(event); } |
---|
| 319 | void OnStepOnceClockwiseUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceClockwiseUpdate(event); } |
---|
| 320 | void OnHigherViewpointUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnHigherViewpointUpdate(event); } |
---|
| 321 | void OnLowerViewpointUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnLowerViewpointUpdate(event); } |
---|
| 322 | void OnShiftDisplayDownUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayDownUpdate(event); } |
---|
| 323 | void OnShiftDisplayLeftUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayLeftUpdate(event); } |
---|
| 324 | void OnShiftDisplayRightUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayRightUpdate(event); } |
---|
| 325 | void OnShiftDisplayUpUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayUpUpdate(event); } |
---|
| 326 | void OnZoomInUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnZoomInUpdate(event); } |
---|
| 327 | void OnZoomOutUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnZoomOutUpdate(event); } |
---|
| 328 | void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleScalebarUpdate(event); } |
---|
| 329 | void OnToggleDepthbarUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleDepthbarUpdate(event); } |
---|
| 330 | void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewCompassUpdate(event); } |
---|
[c1cf79d] | 331 | void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewGridUpdate(event); } |
---|
[137bf99] | 332 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewClinoUpdate(event); } |
---|
| 333 | void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnReverseDirectionOfRotationUpdate(event); } |
---|
[1fd2edb] | 334 | void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnCancelDistLineUpdate(event); } |
---|
[c6d95d8] | 335 | #ifdef AVENGL |
---|
| 336 | void OnAntiAliasUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnAntiAliasUpdate(event); } |
---|
[8000d8f] | 337 | void OnSolidSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSolidSurfaceUpdate(event); } |
---|
[c6d95d8] | 338 | #endif |
---|
[e3513a5] | 339 | void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnIndicatorsUpdate(event); } |
---|
[137bf99] | 340 | |
---|
[1fd2edb] | 341 | void OnDefaults(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnDefaults(); } |
---|
| 342 | void OnPlan(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnPlan(); } |
---|
| 343 | void OnElevation(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnElevation(); } |
---|
| 344 | void OnDisplayOverlappingNames(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnDisplayOverlappingNames(); } |
---|
| 345 | void OnShowCrosses(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowCrosses(); } |
---|
| 346 | void OnShowEntrances(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowEntrances(); } |
---|
| 347 | void OnShowFixedPts(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowFixedPts(); } |
---|
| 348 | void OnShowExportedPts(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowExportedPts(); } |
---|
| 349 | void OnShowStationNames(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowStationNames(); } |
---|
| 350 | void OnShowSurveyLegs(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowSurveyLegs(); } |
---|
| 351 | void OnShowSurface(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowSurface(); } |
---|
| 352 | void OnShowSurfaceDepth(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDepth(); } |
---|
| 353 | void OnShowSurfaceDashed(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDashed(); } |
---|
| 354 | void OnMoveEast(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnMoveEast(); } |
---|
| 355 | void OnMoveNorth(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnMoveNorth(); } |
---|
| 356 | void OnMoveSouth(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnMoveSouth(); } |
---|
| 357 | void OnMoveWest(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnMoveWest(); } |
---|
| 358 | void OnStartRotation(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnStartRotation(); } |
---|
| 359 | void OnToggleRotation(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnToggleRotation(); } |
---|
| 360 | void OnStopRotation(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnStopRotation(); } |
---|
| 361 | void OnReverseControls(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnReverseControls(); } |
---|
| 362 | void OnSlowDown(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnSlowDown(); } |
---|
| 363 | void OnSpeedUp(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnSpeedUp(); } |
---|
| 364 | void OnStepOnceAnticlockwise(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceAnticlockwise(); } |
---|
| 365 | void OnStepOnceClockwise(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceClockwise(); } |
---|
| 366 | void OnHigherViewpoint(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnHigherViewpoint(); } |
---|
| 367 | void OnLowerViewpoint(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnLowerViewpoint(); } |
---|
[4b1fc48] | 368 | void OnShiftDisplayDown(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayDown(); } |
---|
| 369 | void OnShiftDisplayLeft(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayLeft(); } |
---|
| 370 | void OnShiftDisplayRight(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayRight(); } |
---|
| 371 | void OnShiftDisplayUp(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayUp(); } |
---|
[1fd2edb] | 372 | void OnZoomIn(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnZoomIn(); } |
---|
| 373 | void OnZoomOut(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnZoomOut(); } |
---|
| 374 | void OnToggleScalebar(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnToggleScalebar(); } |
---|
| 375 | void OnToggleDepthbar(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnToggleDepthbar(); } |
---|
| 376 | void OnViewCompass(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnViewCompass(); } |
---|
| 377 | void OnViewClino(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnViewClino(); } |
---|
| 378 | void OnViewGrid(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnViewGrid(); } |
---|
| 379 | void OnReverseDirectionOfRotation(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnReverseDirectionOfRotation(); } |
---|
[6d109e5] | 380 | void OnCancelDistLine(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnCancelDistLine(); } |
---|
[c6d95d8] | 381 | #ifdef AVENGL |
---|
[4b1fc48] | 382 | void OnAntiAlias(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnAntiAlias(); } |
---|
| 383 | void OnSolidSurface(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnSolidSurface(); } |
---|
[c6d95d8] | 384 | #endif |
---|
[137bf99] | 385 | // end of horrible bodges |
---|
[421b7d2] | 386 | |
---|
[7a89dc2] | 387 | void OnToggleMetric(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleMetric(); } |
---|
| 388 | void OnToggleDegrees(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleDegrees(); } |
---|
[5757725] | 389 | |
---|
[7a89dc2] | 390 | void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleMetricUpdate(event); } |
---|
| 391 | void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleDegreesUpdate(event); } |
---|
[5757725] | 392 | |
---|
[9059368] | 393 | void OnViewSidePanelUpdate(wxUpdateUIEvent& event); |
---|
| 394 | void OnViewSidePanel(wxCommandEvent& event); |
---|
[b1de3e0] | 395 | void ToggleSidePanel(); |
---|
[137bf99] | 396 | |
---|
[003d953] | 397 | Double GetXExtent() const { return m_XExt; } |
---|
| 398 | Double GetYExtent() const { return m_YExt; } |
---|
| 399 | Double GetZExtent() const { return m_ZExt; } |
---|
| 400 | Double GetXMin() const { return m_XMin; } |
---|
| 401 | Double GetYMin() const { return m_YMin; } |
---|
| 402 | Double GetYMax() const { return m_YMin + m_YExt; } |
---|
| 403 | Double GetZMin() const { return m_ZMin; } |
---|
| 404 | Double GetZMax() const { return m_ZMin + m_ZExt; } |
---|
| 405 | |
---|
[2c30188] | 406 | #ifdef AVENGL |
---|
[003d953] | 407 | int GetTerrainXSize() const { return m_TerrainSize.x; } |
---|
| 408 | int GetTerrainYSize() const { return m_TerrainSize.y; } |
---|
| 409 | |
---|
| 410 | Double GetTerrainMinX() const { return m_TerrainExtents.xmin; } |
---|
| 411 | Double GetTerrainMaxX() const { return m_TerrainExtents.xmax; } |
---|
| 412 | Double GetTerrainMinY() const { return m_TerrainExtents.ymin; } |
---|
| 413 | Double GetTerrainMaxY() const { return m_TerrainExtents.ymax; } |
---|
| 414 | Double GetTerrainMinZ() const { return m_TerrainExtents.zmin; } |
---|
| 415 | Double GetTerrainMaxZ() const { return m_TerrainExtents.zmax; } |
---|
| 416 | |
---|
| 417 | Double GetTerrainXSquareSize() const { |
---|
| 418 | return (m_TerrainExtents.xmax - m_TerrainExtents.xmin) |
---|
| 419 | / m_TerrainSize.x; |
---|
| 420 | } |
---|
| 421 | Double GetTerrainYSquareSize() const { |
---|
| 422 | return (m_TerrainExtents.ymax - m_TerrainExtents.ymin) |
---|
| 423 | / m_TerrainSize.y; |
---|
| 424 | } |
---|
| 425 | |
---|
| 426 | Double GetTerrainHeight(int x, int y) const { |
---|
[8000d8f] | 427 | assert(x >= 0 && x < m_TerrainSize.x); |
---|
| 428 | assert(y >= 0 && y < m_TerrainSize.y); |
---|
| 429 | |
---|
| 430 | return m_TerrainGrid[x + m_TerrainSize.x * y]; |
---|
| 431 | } |
---|
[2c30188] | 432 | #endif |
---|
[137bf99] | 433 | |
---|
[003d953] | 434 | int GetNumLegs() const { return m_NumLegs; } |
---|
| 435 | int GetNumPoints() const { return m_NumPoints; } |
---|
| 436 | int GetNumCrosses() const { return m_NumCrosses; } |
---|
[137bf99] | 437 | |
---|
[003d953] | 438 | int GetNumDepthBands() const { return NUM_DEPTH_COLOURS; } |
---|
[137bf99] | 439 | |
---|
[003d953] | 440 | wxPen GetPen(int band) const { |
---|
[421b7d2] | 441 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 442 | return m_Pens[band]; |
---|
[137bf99] | 443 | } |
---|
| 444 | |
---|
[003d953] | 445 | wxBrush GetBrush(int band) const { |
---|
[421b7d2] | 446 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 447 | return m_Brushes[band]; |
---|
[137bf99] | 448 | } |
---|
| 449 | |
---|
[003d953] | 450 | void GetColour(int band, Double& r, Double& g, Double& b) const; |
---|
[c6d95d8] | 451 | |
---|
[003d953] | 452 | wxPen GetSurfacePen() const { return m_Pens[NUM_DEPTH_COLOURS]; } |
---|
[137bf99] | 453 | |
---|
[6dde19f] | 454 | void SelectTreeItem(LabelInfo* label); |
---|
[1fd2edb] | 455 | void ClearTreeSelection(); |
---|
| 456 | |
---|
[003d953] | 457 | int GetNumFixedPts() const { return m_NumFixedPts; } |
---|
| 458 | int GetNumExportedPts() const { return m_NumExportedPts; } |
---|
| 459 | int GetNumEntrances() const { return m_NumEntrances; } |
---|
[a9a32f2] | 460 | |
---|
[156dc16] | 461 | void ClearCoords(); |
---|
| 462 | void SetCoords(Double x, Double y); |
---|
[7a89dc2] | 463 | void SetAltitude(Double z); |
---|
[156dc16] | 464 | |
---|
[003d953] | 465 | Double GetXOffset() const { return m_Offsets.x; } |
---|
| 466 | Double GetYOffset() const { return m_Offsets.y; } |
---|
| 467 | Double GetZOffset() const { return m_Offsets.z; } |
---|
[156dc16] | 468 | |
---|
[39e460c9] | 469 | void SetMouseOverStation(LabelInfo* label); |
---|
| 470 | |
---|
[003d953] | 471 | list<PointInfo*>::iterator GetPointsNC(int band) const { |
---|
[421b7d2] | 472 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 473 | return m_Points[band].begin(); |
---|
[ee119518] | 474 | } |
---|
| 475 | |
---|
[003d953] | 476 | list<PointInfo*>::iterator GetPointsEndNC(int band) const { |
---|
[421b7d2] | 477 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 478 | return m_Points[band].end(); |
---|
[ee119518] | 479 | } |
---|
| 480 | |
---|
[003d953] | 481 | list<PointInfo*>::const_iterator GetPoints(int band) const { |
---|
[421b7d2] | 482 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 483 | return m_Points[band].begin(); |
---|
[137bf99] | 484 | } |
---|
| 485 | |
---|
[003d953] | 486 | list<LabelInfo*>::const_iterator GetLabels() const { |
---|
[421b7d2] | 487 | return m_Labels.begin(); |
---|
[137bf99] | 488 | } |
---|
| 489 | |
---|
[003d953] | 490 | list<PointInfo*>::const_iterator GetPointsEnd(int band) const { |
---|
[421b7d2] | 491 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 492 | return m_Points[band].end(); |
---|
[137bf99] | 493 | } |
---|
| 494 | |
---|
[003d953] | 495 | list<LabelInfo*>::const_iterator GetLabelsEnd() const { |
---|
[421b7d2] | 496 | return m_Labels.end(); |
---|
[137bf99] | 497 | } |
---|
[5809313] | 498 | |
---|
[7a89dc2] | 499 | void ShowInfo(LabelInfo *label); |
---|
[156dc16] | 500 | void DisplayTreeInfo(wxTreeItemData* data); |
---|
| 501 | void TreeItemSelected(wxTreeItemData* data); |
---|
[8bac36d6] | 502 | |
---|
[84cab34] | 503 | private: |
---|
| 504 | DECLARE_EVENT_TABLE() |
---|
[5809313] | 505 | }; |
---|
| 506 | |
---|
| 507 | #endif |
---|