[5809313] | 1 | // |
---|
| 2 | // mainfrm.h |
---|
| 3 | // |
---|
| 4 | // Main frame handling for Aven. |
---|
| 5 | // |
---|
| 6 | // Copyright (C) 2000-2001, Mark R. Shinwell. |
---|
| 7 | // |
---|
| 8 | // This program is free software; you can redistribute it and/or modify |
---|
| 9 | // it under the terms of the GNU General Public License as published by |
---|
| 10 | // the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | // (at your option) any later version. |
---|
| 12 | // |
---|
| 13 | // This program is distributed in the hope that it will be useful, |
---|
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | // GNU General Public License for more details. |
---|
| 17 | // |
---|
| 18 | // You should have received a copy of the GNU General Public License |
---|
| 19 | // along with this program; if not, write to the Free Software |
---|
| 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 21 | // |
---|
| 22 | |
---|
| 23 | #ifndef mainfrm_h |
---|
| 24 | #define mainfrm_h |
---|
| 25 | |
---|
| 26 | #include "wx.h" |
---|
[137bf99] | 27 | #include "gfxcore.h" |
---|
| 28 | #include "message.h" |
---|
[156dc16] | 29 | #include "aventreectrl.h" |
---|
[2d9ed8ad] | 30 | #include "img.h" |
---|
[156dc16] | 31 | |
---|
[137bf99] | 32 | #include <list> |
---|
[dc8d2eb] | 33 | // FIXME: do this with a configure test... |
---|
| 34 | #if defined(__GNUC__) && __GNUC__ == 3 |
---|
| 35 | #include <ext/hash_map> |
---|
| 36 | #else |
---|
[156dc16] | 37 | #include <hash_map> |
---|
[dc8d2eb] | 38 | #endif |
---|
[5809313] | 39 | |
---|
[137bf99] | 40 | using namespace std; |
---|
[5341d94] | 41 | |
---|
[f17e6dc6] | 42 | #include <math.h> |
---|
| 43 | |
---|
| 44 | // This is for mingw32/Visual C++: |
---|
| 45 | #ifndef M_PI |
---|
| 46 | #define M_PI 3.14159265358979323846 |
---|
| 47 | #endif |
---|
| 48 | |
---|
[137bf99] | 49 | extern const int NUM_DEPTH_COLOURS; |
---|
| 50 | |
---|
| 51 | enum { |
---|
| 52 | menu_FILE_OPEN = 1000, |
---|
[156dc16] | 53 | menu_FILE_OPEN_PRES, |
---|
[8000d8f] | 54 | #ifdef AVENGL |
---|
| 55 | menu_FILE_OPEN_TERRAIN, |
---|
| 56 | #endif |
---|
[137bf99] | 57 | menu_FILE_QUIT, |
---|
| 58 | menu_ROTATION_START, |
---|
| 59 | menu_ROTATION_STOP, |
---|
[2d9ed8ad] | 60 | menu_ROTATION_TOGGLE, |
---|
[137bf99] | 61 | menu_ROTATION_SPEED_UP, |
---|
| 62 | menu_ROTATION_SLOW_DOWN, |
---|
| 63 | menu_ROTATION_REVERSE, |
---|
| 64 | menu_ROTATION_STEP_CCW, |
---|
| 65 | menu_ROTATION_STEP_CW, |
---|
| 66 | menu_ORIENT_MOVE_NORTH, |
---|
| 67 | menu_ORIENT_MOVE_EAST, |
---|
| 68 | menu_ORIENT_MOVE_SOUTH, |
---|
| 69 | menu_ORIENT_MOVE_WEST, |
---|
| 70 | menu_ORIENT_SHIFT_LEFT, |
---|
| 71 | menu_ORIENT_SHIFT_RIGHT, |
---|
| 72 | menu_ORIENT_SHIFT_UP, |
---|
| 73 | menu_ORIENT_SHIFT_DOWN, |
---|
| 74 | menu_ORIENT_PLAN, |
---|
| 75 | menu_ORIENT_ELEVATION, |
---|
| 76 | menu_ORIENT_HIGHER_VP, |
---|
| 77 | menu_ORIENT_LOWER_VP, |
---|
| 78 | menu_ORIENT_ZOOM_IN, |
---|
| 79 | menu_ORIENT_ZOOM_OUT, |
---|
| 80 | menu_ORIENT_DEFAULTS, |
---|
| 81 | menu_VIEW_SHOW_LEGS, |
---|
| 82 | menu_VIEW_SHOW_CROSSES, |
---|
| 83 | menu_VIEW_SHOW_NAMES, |
---|
| 84 | menu_VIEW_SHOW_SURFACE, |
---|
| 85 | menu_VIEW_SURFACE_DEPTH, |
---|
| 86 | menu_VIEW_SURFACE_DASHED, |
---|
| 87 | menu_VIEW_SHOW_OVERLAPPING_NAMES, |
---|
[fe444b8] | 88 | menu_VIEW_SHOW_ENTRANCES, |
---|
| 89 | menu_VIEW_SHOW_FIXED_PTS, |
---|
| 90 | menu_VIEW_SHOW_EXPORTED_PTS, |
---|
[e3513a5] | 91 | menu_VIEW_INDICATORS, |
---|
[137bf99] | 92 | menu_VIEW_COMPASS, |
---|
| 93 | menu_VIEW_CLINO, |
---|
| 94 | menu_VIEW_DEPTH_BAR, |
---|
| 95 | menu_VIEW_SCALE_BAR, |
---|
| 96 | menu_VIEW_STATUS_BAR, |
---|
[c1cf79d] | 97 | menu_VIEW_GRID, |
---|
[c6d95d8] | 98 | #ifdef AVENGL |
---|
| 99 | menu_VIEW_ANTIALIAS, |
---|
[8000d8f] | 100 | menu_VIEW_SOLID_SURFACE, |
---|
[c6d95d8] | 101 | #endif |
---|
[156dc16] | 102 | menu_PRES_CREATE, |
---|
| 103 | menu_PRES_GO, |
---|
| 104 | menu_PRES_GO_BACK, |
---|
| 105 | menu_PRES_RESTART, |
---|
| 106 | menu_PRES_RECORD, |
---|
| 107 | menu_PRES_FINISH, |
---|
| 108 | menu_PRES_ERASE, |
---|
| 109 | menu_PRES_ERASE_ALL, |
---|
[137bf99] | 110 | menu_CTL_REVERSE, |
---|
[2a02de2] | 111 | menu_HELP_ABOUT, |
---|
| 112 | button_FIND, |
---|
| 113 | button_HIDE |
---|
[137bf99] | 114 | }; |
---|
| 115 | |
---|
| 116 | class PointInfo { |
---|
| 117 | friend class MainFrm; |
---|
[c6d95d8] | 118 | Double x, y, z; |
---|
[137bf99] | 119 | bool isLine; // false => move, true => draw line |
---|
| 120 | bool isSurface; |
---|
[ee119518] | 121 | bool isChangingUGState; |
---|
| 122 | bool lastWasMove; |
---|
[e61185d] | 123 | wxPoint* dest; |
---|
[137bf99] | 124 | |
---|
| 125 | public: |
---|
[c6d95d8] | 126 | Double GetX() const { return x; } |
---|
| 127 | Double GetY() const { return y; } |
---|
| 128 | Double GetZ() const { return z; } |
---|
[137bf99] | 129 | bool IsLine() const { return isLine; } |
---|
| 130 | bool IsSurface() const { return isSurface; } |
---|
[ee119518] | 131 | |
---|
| 132 | void SetChangingUGState(bool b) { isChangingUGState = b; } |
---|
| 133 | bool IsChangingUGState() const { return isChangingUGState; } |
---|
| 134 | |
---|
| 135 | void SetLastWasMove(bool b) { lastWasMove = b; } |
---|
| 136 | bool LastWasMove() const { return lastWasMove; } |
---|
[e61185d] | 137 | |
---|
| 138 | void SetDestination(wxPoint* p) { dest = p; } |
---|
| 139 | wxPoint* GetDestination() const { return dest; } |
---|
[137bf99] | 140 | }; |
---|
| 141 | |
---|
| 142 | class LabelInfo { |
---|
| 143 | friend class MainFrm; |
---|
[c6d95d8] | 144 | Double x, y, z; |
---|
[137bf99] | 145 | wxString text; |
---|
[2d9ed8ad] | 146 | int flags; |
---|
[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 { |
---|
| 163 | list<PointInfo*>* m_Points; |
---|
| 164 | list<LabelInfo*> m_Labels; |
---|
[156dc16] | 165 | hash_map<wxTreeItemId, LabelInfo*> m_LabelMap; |
---|
[c6d95d8] | 166 | Double m_XExt; |
---|
| 167 | Double m_YExt; |
---|
| 168 | Double m_ZExt; |
---|
| 169 | Double m_XMin; |
---|
| 170 | Double m_YMin; |
---|
| 171 | Double m_ZMin; |
---|
[137bf99] | 172 | int m_NumLegs; |
---|
| 173 | int m_NumPoints; |
---|
| 174 | int m_NumCrosses; |
---|
| 175 | int m_NumExtraLegs; |
---|
| 176 | GfxCore* m_Gfx; |
---|
| 177 | wxPen* m_Pens; |
---|
| 178 | wxBrush* m_Brushes; |
---|
| 179 | wxString m_FileToLoad; |
---|
[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 | wxBoxSizer* m_PanelSizer; |
---|
| 187 | wxPanel* m_FindPanel; |
---|
| 188 | wxTreeItemId m_TreeRoot; |
---|
| 189 | wxButton* m_FindButton; |
---|
| 190 | wxButton* m_HideButton; |
---|
| 191 | wxTextCtrl* m_FindBox; |
---|
| 192 | wxBoxSizer* m_FindButtonSizer; |
---|
[01faa28] | 193 | wxBoxSizer* m_HideButtonSizer; |
---|
[156dc16] | 194 | wxBoxSizer* m_FindSizer; |
---|
| 195 | wxStaticText* m_MousePtr; |
---|
| 196 | wxStaticText* m_Coords; |
---|
| 197 | wxStaticText* m_StnCoords; |
---|
| 198 | wxStaticText* m_StnName; |
---|
| 199 | wxStaticText* m_StnAlt; |
---|
| 200 | wxStaticText* m_Dist1; |
---|
| 201 | wxStaticText* m_Dist2; |
---|
| 202 | wxStaticText* m_Dist3; |
---|
[01faa28] | 203 | wxStaticText* m_Found; |
---|
[2a02de2] | 204 | wxCheckBox* m_RegexpCheckBox; |
---|
[156dc16] | 205 | FILE* m_PresFP; |
---|
| 206 | wxString m_File; |
---|
| 207 | bool m_PresLoaded; |
---|
| 208 | bool m_Recording; |
---|
| 209 | |
---|
| 210 | struct { |
---|
| 211 | Double x, y, z; |
---|
| 212 | } m_Offsets; |
---|
[8000d8f] | 213 | |
---|
| 214 | struct { |
---|
| 215 | Double xmin, xmax; |
---|
| 216 | Double ymin, ymax; |
---|
| 217 | Double zmin, zmax; |
---|
| 218 | } m_TerrainExtents; |
---|
| 219 | |
---|
| 220 | struct { |
---|
| 221 | int x, y; |
---|
| 222 | } m_TerrainSize; |
---|
| 223 | |
---|
| 224 | Double* m_TerrainGrid; |
---|
[156dc16] | 225 | |
---|
[2d9ed8ad] | 226 | void SetTreeItemColour(wxTreeItemId& id, 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) { |
---|
| 243 | wxString x(msg(key)); x.Replace("##", "\t"); x.Replace("@", "&"); return x; |
---|
| 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 | |
---|
[ce3ce72] | 255 | void OpenFile(const wxString& file, wxString survey = "", bool delay = true); |
---|
[003d953] | 256 | #ifdef AVENPRES |
---|
[5ffa439] | 257 | void OnOpenPresUpdate(wxUpdateUIEvent& event); |
---|
[003d953] | 258 | #endif |
---|
[8000d8f] | 259 | void OnFileOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
[137bf99] | 260 | |
---|
[2a02de2] | 261 | void OnFind(wxCommandEvent& event); |
---|
| 262 | void OnHide(wxCommandEvent& event); |
---|
| 263 | |
---|
[5809313] | 264 | void OnOpen(wxCommandEvent& event); |
---|
[8000d8f] | 265 | void OnFileOpenTerrain(wxCommandEvent& event); |
---|
[003d953] | 266 | #ifdef AVENPRES |
---|
[156dc16] | 267 | void OnOpenPres(wxCommandEvent& event); |
---|
[003d953] | 268 | #endif |
---|
[5809313] | 269 | void OnQuit(wxCommandEvent& event); |
---|
[5ffa439] | 270 | |
---|
[003d953] | 271 | #ifdef AVENPRES |
---|
[156dc16] | 272 | void OnPresCreate(wxCommandEvent& event); |
---|
| 273 | void OnPresGo(wxCommandEvent& event); |
---|
| 274 | void OnPresGoBack(wxCommandEvent& event); |
---|
| 275 | void OnPresFinish(wxCommandEvent& event); |
---|
| 276 | void OnPresRestart(wxCommandEvent& event); |
---|
| 277 | void OnPresRecord(wxCommandEvent& event); |
---|
| 278 | void OnPresErase(wxCommandEvent& event); |
---|
| 279 | void OnPresEraseAll(wxCommandEvent& event); |
---|
[5ffa439] | 280 | |
---|
| 281 | void OnPresCreateUpdate(wxUpdateUIEvent& event); |
---|
| 282 | void OnPresGoUpdate(wxUpdateUIEvent& event); |
---|
| 283 | void OnPresGoBackUpdate(wxUpdateUIEvent& event); |
---|
| 284 | void OnPresFinishUpdate(wxUpdateUIEvent& event); |
---|
| 285 | void OnPresRestartUpdate(wxUpdateUIEvent& event); |
---|
| 286 | void OnPresRecordUpdate(wxUpdateUIEvent& event); |
---|
| 287 | void OnPresEraseUpdate(wxUpdateUIEvent& event); |
---|
| 288 | void OnPresEraseAllUpdate(wxUpdateUIEvent& event); |
---|
[003d953] | 289 | #endif |
---|
[5ffa439] | 290 | |
---|
[573f4e9] | 291 | void OnAbout(wxCommandEvent& event); |
---|
[137bf99] | 292 | void OnClose(wxCloseEvent&); |
---|
| 293 | |
---|
[4b1fc48] | 294 | void OnSetFocus(wxFocusEvent &e) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
| 295 | |
---|
[137bf99] | 296 | // temporary bodges until event handling problem is sorted out: |
---|
| 297 | void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnDefaultsUpdate(event); } |
---|
| 298 | void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnPlanUpdate(event); } |
---|
| 299 | void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnElevationUpdate(event); } |
---|
| 300 | void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnDisplayOverlappingNamesUpdate(event); } |
---|
| 301 | void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowCrossesUpdate(event); } |
---|
[fe444b8] | 302 | void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowEntrancesUpdate(event); } |
---|
| 303 | void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowFixedPtsUpdate(event); } |
---|
| 304 | void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowExportedPtsUpdate(event); } |
---|
[137bf99] | 305 | void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowStationNamesUpdate(event); } |
---|
| 306 | void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurveyLegsUpdate(event); } |
---|
| 307 | void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceUpdate(event); } |
---|
| 308 | void OnShowSurfaceDepthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDepthUpdate(event); } |
---|
| 309 | void OnShowSurfaceDashedUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShowSurfaceDashedUpdate(event); } |
---|
| 310 | void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveEastUpdate(event); } |
---|
| 311 | void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveNorthUpdate(event); } |
---|
| 312 | void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveSouthUpdate(event); } |
---|
| 313 | void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnMoveWestUpdate(event); } |
---|
| 314 | void OnStartRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStartRotationUpdate(event); } |
---|
[7ebc3d1] | 315 | void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleRotationUpdate(event); } |
---|
[137bf99] | 316 | void OnStopRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStopRotationUpdate(event); } |
---|
| 317 | void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnReverseControlsUpdate(event); } |
---|
| 318 | void OnSlowDownUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSlowDownUpdate(event); } |
---|
| 319 | void OnSpeedUpUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSpeedUpUpdate(event); } |
---|
| 320 | void OnStepOnceAnticlockwiseUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceAnticlockwiseUpdate(event); } |
---|
| 321 | void OnStepOnceClockwiseUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnStepOnceClockwiseUpdate(event); } |
---|
| 322 | void OnHigherViewpointUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnHigherViewpointUpdate(event); } |
---|
| 323 | void OnLowerViewpointUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnLowerViewpointUpdate(event); } |
---|
| 324 | void OnShiftDisplayDownUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayDownUpdate(event); } |
---|
| 325 | void OnShiftDisplayLeftUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayLeftUpdate(event); } |
---|
| 326 | void OnShiftDisplayRightUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayRightUpdate(event); } |
---|
| 327 | void OnShiftDisplayUpUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayUpUpdate(event); } |
---|
| 328 | void OnZoomInUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnZoomInUpdate(event); } |
---|
| 329 | void OnZoomOutUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnZoomOutUpdate(event); } |
---|
| 330 | void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleScalebarUpdate(event); } |
---|
| 331 | void OnToggleDepthbarUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnToggleDepthbarUpdate(event); } |
---|
| 332 | void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewCompassUpdate(event); } |
---|
[c1cf79d] | 333 | void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewGridUpdate(event); } |
---|
[137bf99] | 334 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnViewClinoUpdate(event); } |
---|
| 335 | void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnReverseDirectionOfRotationUpdate(event); } |
---|
[c6d95d8] | 336 | #ifdef AVENGL |
---|
| 337 | void OnAntiAliasUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnAntiAliasUpdate(event); } |
---|
[8000d8f] | 338 | void OnSolidSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnSolidSurfaceUpdate(event); } |
---|
[c6d95d8] | 339 | #endif |
---|
[e3513a5] | 340 | void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Gfx) m_Gfx->OnIndicatorsUpdate(event); } |
---|
[137bf99] | 341 | |
---|
[4b1fc48] | 342 | void OnDefaults(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnDefaults(); } |
---|
| 343 | void OnPlan(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnPlan(); } |
---|
| 344 | void OnElevation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnElevation(); } |
---|
| 345 | void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnDisplayOverlappingNames(); } |
---|
| 346 | void OnShowCrosses(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowCrosses(); } |
---|
| 347 | void OnShowEntrances(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowEntrances(); } |
---|
| 348 | void OnShowFixedPts(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowFixedPts(); } |
---|
| 349 | void OnShowExportedPts(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowExportedPts(); } |
---|
| 350 | void OnShowStationNames(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowStationNames(); } |
---|
| 351 | void OnShowSurveyLegs(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurveyLegs(); } |
---|
| 352 | void OnShowSurface(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurface(); } |
---|
| 353 | void OnShowSurfaceDepth(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurfaceDepth(); } |
---|
| 354 | void OnShowSurfaceDashed(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnShowSurfaceDashed(); } |
---|
| 355 | void OnMoveEast(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveEast(); } |
---|
| 356 | void OnMoveNorth(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveNorth(); } |
---|
| 357 | void OnMoveSouth(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveSouth(); } |
---|
| 358 | void OnMoveWest(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnMoveWest(); } |
---|
| 359 | void OnStartRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStartRotation(); } |
---|
| 360 | void OnToggleRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleRotation(); } |
---|
| 361 | void OnStopRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStopRotation(); } |
---|
| 362 | void OnReverseControls(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnReverseControls(); } |
---|
| 363 | void OnSlowDown(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnSlowDown(); } |
---|
| 364 | void OnSpeedUp(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnSpeedUp(); } |
---|
| 365 | void OnStepOnceAnticlockwise(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStepOnceAnticlockwise(); } |
---|
| 366 | void OnStepOnceClockwise(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnStepOnceClockwise(); } |
---|
| 367 | void OnHigherViewpoint(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnHigherViewpoint(); } |
---|
| 368 | void OnLowerViewpoint(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnLowerViewpoint(); } |
---|
| 369 | void OnShiftDisplayDown(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayDown(); } |
---|
| 370 | void OnShiftDisplayLeft(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayLeft(); } |
---|
| 371 | void OnShiftDisplayRight(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayRight(); } |
---|
| 372 | void OnShiftDisplayUp(wxCommandEvent& event) { if (m_Gfx) m_Gfx->OnShiftDisplayUp(); } |
---|
| 373 | void OnZoomIn(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnZoomIn(); } |
---|
| 374 | void OnZoomOut(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnZoomOut(); } |
---|
| 375 | void OnToggleScalebar(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleScalebar(); } |
---|
| 376 | void OnToggleDepthbar(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnToggleDepthbar(); } |
---|
| 377 | void OnViewCompass(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnViewCompass(); } |
---|
| 378 | void OnViewClino(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnViewClino(); } |
---|
| 379 | void OnViewGrid(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnViewGrid(); } |
---|
| 380 | void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Gfx) m_Gfx->OnReverseDirectionOfRotation(); } |
---|
[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 |
---|
| 386 | |
---|
[003d953] | 387 | Double GetXExtent() const { return m_XExt; } |
---|
| 388 | Double GetYExtent() const { return m_YExt; } |
---|
| 389 | Double GetZExtent() const { return m_ZExt; } |
---|
| 390 | Double GetXMin() const { return m_XMin; } |
---|
| 391 | Double GetYMin() const { return m_YMin; } |
---|
| 392 | Double GetYMax() const { return m_YMin + m_YExt; } |
---|
| 393 | Double GetZMin() const { return m_ZMin; } |
---|
| 394 | Double GetZMax() const { return m_ZMin + m_ZExt; } |
---|
| 395 | |
---|
| 396 | int GetTerrainXSize() const { return m_TerrainSize.x; } |
---|
| 397 | int GetTerrainYSize() const { return m_TerrainSize.y; } |
---|
| 398 | |
---|
| 399 | Double GetTerrainMinX() const { return m_TerrainExtents.xmin; } |
---|
| 400 | Double GetTerrainMaxX() const { return m_TerrainExtents.xmax; } |
---|
| 401 | Double GetTerrainMinY() const { return m_TerrainExtents.ymin; } |
---|
| 402 | Double GetTerrainMaxY() const { return m_TerrainExtents.ymax; } |
---|
| 403 | Double GetTerrainMinZ() const { return m_TerrainExtents.zmin; } |
---|
| 404 | Double GetTerrainMaxZ() const { return m_TerrainExtents.zmax; } |
---|
| 405 | |
---|
| 406 | Double GetTerrainXSquareSize() const { |
---|
| 407 | return (m_TerrainExtents.xmax - m_TerrainExtents.xmin) |
---|
| 408 | / m_TerrainSize.x; |
---|
| 409 | } |
---|
| 410 | Double GetTerrainYSquareSize() const { |
---|
| 411 | return (m_TerrainExtents.ymax - m_TerrainExtents.ymin) |
---|
| 412 | / m_TerrainSize.y; |
---|
| 413 | } |
---|
| 414 | |
---|
| 415 | Double GetTerrainHeight(int x, int y) const { |
---|
[8000d8f] | 416 | assert(x >= 0 && x < m_TerrainSize.x); |
---|
| 417 | assert(y >= 0 && y < m_TerrainSize.y); |
---|
| 418 | |
---|
| 419 | return m_TerrainGrid[x + m_TerrainSize.x * y]; |
---|
| 420 | } |
---|
[137bf99] | 421 | |
---|
[003d953] | 422 | int GetNumLegs() const { return m_NumLegs; } |
---|
| 423 | int GetNumPoints() const { return m_NumPoints; } |
---|
| 424 | int GetNumCrosses() const { return m_NumCrosses; } |
---|
[137bf99] | 425 | |
---|
[003d953] | 426 | int GetNumDepthBands() const { return NUM_DEPTH_COLOURS; } |
---|
[137bf99] | 427 | |
---|
[003d953] | 428 | wxPen GetPen(int band) const { |
---|
[137bf99] | 429 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 430 | return m_Pens[band]; |
---|
| 431 | } |
---|
| 432 | |
---|
[003d953] | 433 | wxBrush GetBrush(int band) const { |
---|
[137bf99] | 434 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 435 | return m_Brushes[band]; |
---|
| 436 | } |
---|
| 437 | |
---|
[003d953] | 438 | void GetColour(int band, Double& r, Double& g, Double& b) const; |
---|
[c6d95d8] | 439 | |
---|
[003d953] | 440 | wxPen GetSurfacePen() const { return m_Pens[NUM_DEPTH_COLOURS]; } |
---|
[137bf99] | 441 | |
---|
[003d953] | 442 | int GetNumFixedPts() const { return m_NumFixedPts; } |
---|
| 443 | int GetNumExportedPts() const { return m_NumExportedPts; } |
---|
| 444 | int GetNumEntrances() const { return m_NumEntrances; } |
---|
[a9a32f2] | 445 | |
---|
[156dc16] | 446 | void ClearCoords(); |
---|
| 447 | void SetCoords(Double x, Double y); |
---|
| 448 | |
---|
[003d953] | 449 | Double GetXOffset() const { return m_Offsets.x; } |
---|
| 450 | Double GetYOffset() const { return m_Offsets.y; } |
---|
| 451 | Double GetZOffset() const { return m_Offsets.z; } |
---|
[156dc16] | 452 | |
---|
[39e460c9] | 453 | void SetMouseOverStation(LabelInfo* label); |
---|
| 454 | |
---|
[003d953] | 455 | list<PointInfo*>::iterator GetPointsNC(int band) const { |
---|
[ee119518] | 456 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 457 | return m_Points[band].begin(); |
---|
| 458 | } |
---|
| 459 | |
---|
[003d953] | 460 | list<PointInfo*>::iterator GetPointsEndNC(int band) const { |
---|
[ee119518] | 461 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 462 | return m_Points[band].end(); |
---|
| 463 | } |
---|
| 464 | |
---|
[003d953] | 465 | list<PointInfo*>::const_iterator GetPoints(int band) const { |
---|
[137bf99] | 466 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 467 | return m_Points[band].begin(); |
---|
| 468 | } |
---|
| 469 | |
---|
[003d953] | 470 | list<LabelInfo*>::const_iterator GetLabels() const { |
---|
[137bf99] | 471 | return m_Labels.begin(); |
---|
| 472 | } |
---|
| 473 | |
---|
[003d953] | 474 | list<PointInfo*>::const_iterator GetPointsEnd(int band) const { |
---|
[137bf99] | 475 | assert(band >= 0 && band < NUM_DEPTH_COLOURS); |
---|
| 476 | return m_Points[band].end(); |
---|
| 477 | } |
---|
| 478 | |
---|
[003d953] | 479 | list<LabelInfo*>::const_iterator GetLabelsEnd() const { |
---|
[137bf99] | 480 | return m_Labels.end(); |
---|
| 481 | } |
---|
[5809313] | 482 | |
---|
[156dc16] | 483 | void DisplayTreeInfo(wxTreeItemData* data); |
---|
| 484 | void TreeItemSelected(wxTreeItemData* data); |
---|
[8bac36d6] | 485 | |
---|
[84cab34] | 486 | private: |
---|
| 487 | DECLARE_EVENT_TABLE() |
---|
[5809313] | 488 | }; |
---|
| 489 | |
---|
| 490 | #endif |
---|