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