[5809313] | 1 | // |
---|
| 2 | // mainfrm.h |
---|
| 3 | // |
---|
| 4 | // Main frame handling for Aven. |
---|
| 5 | // |
---|
[f4c5932] | 6 | // Copyright (C) 2000-2003,2005 Mark R. Shinwell |
---|
[f10cf8f] | 7 | // Copyright (C) 2001-2003,2004,2005,2006,2010,2011,2012,2013,2014 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 |
---|
[ecbc6c18] | 21 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
[5809313] | 22 | // |
---|
| 23 | |
---|
| 24 | #ifndef mainfrm_h |
---|
| 25 | #define mainfrm_h |
---|
| 26 | |
---|
[3ddcad8] | 27 | #include "wx.h" |
---|
[0580c6a] | 28 | #include <wx/docview.h> // for m_FileHistory |
---|
[1690fa9] | 29 | #include <wx/listctrl.h> |
---|
[203d2a7] | 30 | #include <wx/notebook.h> |
---|
[ce403f1] | 31 | #include <wx/print.h> |
---|
| 32 | #include <wx/printdlg.h> |
---|
| 33 | |
---|
[156dc16] | 34 | #include "aventreectrl.h" |
---|
[db36155] | 35 | #include "gfxcore.h" |
---|
[5876fcb] | 36 | #include "guicontrol.h" |
---|
[a405bc1] | 37 | #include "img_hosted.h" |
---|
[381ae6e] | 38 | #include "labelinfo.h" |
---|
[db36155] | 39 | #include "message.h" |
---|
| 40 | #include "vector3.h" |
---|
[5627cbb] | 41 | #include "aven.h" |
---|
[9c3d91e] | 42 | //#include "prefsdlg.h" |
---|
[156dc16] | 43 | |
---|
[137bf99] | 44 | #include <list> |
---|
[3ddcad8] | 45 | #include <vector> |
---|
[5809313] | 46 | |
---|
[137bf99] | 47 | using namespace std; |
---|
[5341d94] | 48 | |
---|
[f17e6dc6] | 49 | #include <math.h> |
---|
[f10cf8f] | 50 | #include <time.h> |
---|
[f17e6dc6] | 51 | |
---|
[1690fa9] | 52 | #define MARK_FIRST 1 |
---|
| 53 | #define MARK_NEXT 2 |
---|
[128fac4] | 54 | #define MARK_PREV 3 |
---|
[1690fa9] | 55 | |
---|
[137bf99] | 56 | enum { |
---|
[42c7efe] | 57 | menu_FILE_PAGE_SETUP = 1000, |
---|
[045e2af] | 58 | menu_FILE_SCREENSHOT, |
---|
[223f1ad] | 59 | menu_FILE_EXPORT, |
---|
[1690fa9] | 60 | menu_PRES_NEW, |
---|
| 61 | menu_PRES_OPEN, |
---|
| 62 | menu_PRES_SAVE, |
---|
| 63 | menu_PRES_SAVE_AS, |
---|
| 64 | menu_PRES_MARK, |
---|
[6a4cdcb6] | 65 | menu_PRES_EXPORT_MOVIE, |
---|
[128fac4] | 66 | menu_PRES_FREWIND, |
---|
| 67 | menu_PRES_REWIND, |
---|
| 68 | menu_PRES_REVERSE, |
---|
| 69 | menu_PRES_PLAY, |
---|
| 70 | menu_PRES_FF, |
---|
| 71 | menu_PRES_FFF, |
---|
| 72 | menu_PRES_PAUSE, |
---|
[137bf99] | 73 | menu_ROTATION_START, |
---|
| 74 | menu_ROTATION_STOP, |
---|
[2d9ed8ad] | 75 | menu_ROTATION_TOGGLE, |
---|
[137bf99] | 76 | menu_ROTATION_SPEED_UP, |
---|
| 77 | menu_ROTATION_SLOW_DOWN, |
---|
| 78 | menu_ROTATION_REVERSE, |
---|
| 79 | menu_ROTATION_STEP_CCW, |
---|
| 80 | menu_ROTATION_STEP_CW, |
---|
| 81 | menu_ORIENT_MOVE_NORTH, |
---|
| 82 | menu_ORIENT_MOVE_EAST, |
---|
| 83 | menu_ORIENT_MOVE_SOUTH, |
---|
| 84 | menu_ORIENT_MOVE_WEST, |
---|
| 85 | menu_ORIENT_SHIFT_LEFT, |
---|
| 86 | menu_ORIENT_SHIFT_RIGHT, |
---|
| 87 | menu_ORIENT_SHIFT_UP, |
---|
| 88 | menu_ORIENT_SHIFT_DOWN, |
---|
| 89 | menu_ORIENT_PLAN, |
---|
| 90 | menu_ORIENT_ELEVATION, |
---|
| 91 | menu_ORIENT_HIGHER_VP, |
---|
| 92 | menu_ORIENT_LOWER_VP, |
---|
| 93 | menu_ORIENT_DEFAULTS, |
---|
| 94 | menu_VIEW_SHOW_LEGS, |
---|
[9cb97b7] | 95 | menu_VIEW_SPLAYS, |
---|
[8666fc7] | 96 | menu_SPLAYS_HIDE, |
---|
| 97 | menu_SPLAYS_SHOW_FADED, |
---|
| 98 | menu_SPLAYS_SHOW_NORMAL, |
---|
[137bf99] | 99 | menu_VIEW_SHOW_CROSSES, |
---|
| 100 | menu_VIEW_SHOW_NAMES, |
---|
| 101 | menu_VIEW_SHOW_SURFACE, |
---|
| 102 | menu_VIEW_SHOW_OVERLAPPING_NAMES, |
---|
[fe444b8] | 103 | menu_VIEW_SHOW_ENTRANCES, |
---|
| 104 | menu_VIEW_SHOW_FIXED_PTS, |
---|
| 105 | menu_VIEW_SHOW_EXPORTED_PTS, |
---|
[137bf99] | 106 | menu_VIEW_STATUS_BAR, |
---|
[c1cf79d] | 107 | menu_VIEW_GRID, |
---|
[f4c5932] | 108 | menu_VIEW_BOUNDING_BOX, |
---|
[33b2094] | 109 | menu_VIEW_SHOW_TUBES, |
---|
[6abab84] | 110 | menu_VIEW_PERSPECTIVE, |
---|
[d67450e] | 111 | menu_VIEW_SMOOTH_SHADING, |
---|
[a517825] | 112 | menu_VIEW_TEXTURED, |
---|
[c60062d] | 113 | menu_VIEW_FOG, |
---|
[db452ae] | 114 | menu_VIEW_SMOOTH_LINES, |
---|
[b13aee4] | 115 | menu_VIEW_FULLSCREEN, |
---|
[da6c802] | 116 | menu_VIEW_COLOUR_BY_DEPTH, |
---|
[d4650b3] | 117 | menu_VIEW_COLOUR_BY_DATE, |
---|
[c61aa79] | 118 | menu_VIEW_COLOUR_BY_ERROR, |
---|
[7a36b67] | 119 | menu_IND_COMPASS, |
---|
| 120 | menu_IND_CLINO, |
---|
[97ea48d] | 121 | menu_IND_COLOUR_KEY, |
---|
[7a36b67] | 122 | menu_IND_SCALE_BAR, |
---|
| 123 | menu_CTL_INDICATORS, |
---|
| 124 | menu_CTL_SIDE_PANEL, |
---|
| 125 | menu_CTL_METRIC, |
---|
| 126 | menu_CTL_DEGREES, |
---|
[d171c0c] | 127 | menu_CTL_PERCENT, |
---|
[7a36b67] | 128 | menu_CTL_REVERSE, |
---|
| 129 | menu_CTL_CANCEL_DIST_LINE, |
---|
[429465a] | 130 | textctrl_FIND, |
---|
[1690fa9] | 131 | button_HIDE, |
---|
| 132 | listctrl_PRES |
---|
[137bf99] | 133 | }; |
---|
| 134 | |
---|
[d4650b3] | 135 | class PointInfo : public Point { |
---|
[1ee204e] | 136 | int date; |
---|
[d4650b3] | 137 | |
---|
| 138 | public: |
---|
[1ee204e] | 139 | PointInfo() : Point(), date(-1) { } |
---|
| 140 | PointInfo(const img_point & pt) : Point(pt), date(-1) { } |
---|
| 141 | PointInfo(const img_point & pt, int date_) : Point(pt), date(date_) { } |
---|
| 142 | PointInfo(const Point & p, int date_) : Point(p), date(date_) { } |
---|
| 143 | int GetDate() const { return date; } |
---|
[d4650b3] | 144 | }; |
---|
| 145 | |
---|
| 146 | class XSect : public PointInfo { |
---|
[3ddcad8] | 147 | friend class MainFrm; |
---|
| 148 | Double l, r, u, d; |
---|
[fc68ad5] | 149 | Double right_bearing; |
---|
[3ddcad8] | 150 | |
---|
| 151 | public: |
---|
[fc68ad5] | 152 | XSect() : PointInfo(), l(0), r(0), u(0), d(0), right_bearing(0) { } |
---|
[1ee204e] | 153 | XSect(const Point &p, int date_, |
---|
[d4650b3] | 154 | Double l_, Double r_, Double u_, Double d_) |
---|
[fc68ad5] | 155 | : PointInfo(p, date_), l(l_), r(r_), u(u_), d(d_), right_bearing(0) { } |
---|
[3ddcad8] | 156 | Double GetL() const { return l; } |
---|
| 157 | Double GetR() const { return r; } |
---|
| 158 | Double GetU() const { return u; } |
---|
| 159 | Double GetD() const { return d; } |
---|
[fc68ad5] | 160 | Double get_right_bearing() const { return right_bearing; } |
---|
| 161 | void set_right_bearing(Double right_bearing_) { |
---|
| 162 | right_bearing = right_bearing_; |
---|
| 163 | } |
---|
[3ddcad8] | 164 | }; |
---|
| 165 | |
---|
[1c6b20d7] | 166 | class AvenPresList; |
---|
[fa42426] | 167 | |
---|
[c61aa79] | 168 | class traverse : public vector<PointInfo> { |
---|
| 169 | public: |
---|
| 170 | int n_legs; |
---|
[8666fc7] | 171 | bool isSplay; |
---|
[c61aa79] | 172 | double length; |
---|
| 173 | double E, H, V; |
---|
| 174 | |
---|
| 175 | traverse() : n_legs(0), length(0), E(-1), H(-1), V(-1) { } |
---|
| 176 | }; |
---|
| 177 | |
---|
[137bf99] | 178 | class MainFrm : public wxFrame { |
---|
[732b9b0] | 179 | wxFileHistory m_history; |
---|
[9059368] | 180 | int m_SashPosition; |
---|
[486c619] | 181 | bool was_showing_sidepanel_before_fullscreen; |
---|
[c61aa79] | 182 | list<traverse> traverses; |
---|
| 183 | list<traverse> surface_traverses; |
---|
[ee05463] | 184 | list<vector<XSect> > tubes; |
---|
[137bf99] | 185 | list<LabelInfo*> m_Labels; |
---|
[d67450e] | 186 | Vector3 m_Ext; |
---|
[78c67a6] | 187 | Double m_DepthMin, m_DepthExt; |
---|
[1ee204e] | 188 | int m_DateMin, m_DateExt; |
---|
[a74b014] | 189 | bool complete_dateinfo; |
---|
[137bf99] | 190 | GfxCore* m_Gfx; |
---|
[5876fcb] | 191 | GUIControl* m_Control; |
---|
[a9a32f2] | 192 | int m_NumEntrances; |
---|
| 193 | int m_NumFixedPts; |
---|
| 194 | int m_NumExportedPts; |
---|
[429465a] | 195 | int m_NumHighlighted; |
---|
[f433fda] | 196 | bool m_HasUndergroundLegs; |
---|
[5fe7292] | 197 | bool m_HasSplays; |
---|
[f433fda] | 198 | bool m_HasSurfaceLegs; |
---|
[c61aa79] | 199 | bool m_HasErrorInformation; |
---|
[156dc16] | 200 | wxSplitterWindow* m_Splitter; |
---|
| 201 | AvenTreeCtrl* m_Tree; |
---|
| 202 | wxTextCtrl* m_FindBox; |
---|
[f315fa7] | 203 | // wxCheckBox* m_RegexpCheckBox; |
---|
[203d2a7] | 204 | wxNotebook* m_Notebook; |
---|
[1c6b20d7] | 205 | AvenPresList* m_PresList; |
---|
[156dc16] | 206 | wxString m_File; |
---|
[6d3938b] | 207 | wxString m_Title, m_cs_proj, m_DateStamp; |
---|
[f10cf8f] | 208 | time_t m_DateStamp_numeric; |
---|
[ff9f695] | 209 | wxChar separator; // character separating survey levels (often '.') |
---|
[db36155] | 210 | Vector3 m_Offsets; |
---|
[a6f081c] | 211 | |
---|
[7c29c976] | 212 | // Strings for status bar reporting of distances. |
---|
[0633bcc] | 213 | wxString here_text, coords_text, dist_text, distfree_text; |
---|
[7c29c976] | 214 | |
---|
[eef68f9] | 215 | bool m_IsExtendedElevation; |
---|
[bc60689] | 216 | bool pending_find; |
---|
| 217 | |
---|
[b75a37d] | 218 | bool fullscreen_showing_menus; |
---|
| 219 | |
---|
[bc60689] | 220 | #ifdef PREFDLG |
---|
| 221 | PrefsDlg* m_PrefsDlg; |
---|
| 222 | #endif |
---|
[eef68f9] | 223 | |
---|
[156dc16] | 224 | void FillTree(); |
---|
[b88b171] | 225 | bool ProcessSVXFile(const wxString & file); |
---|
[e609835] | 226 | bool LoadData(const wxString& file, const wxString& prefix); |
---|
[c61aa79] | 227 | // void FixLRUD(traverse & centreline); |
---|
[d67450e] | 228 | void CentreDataset(const Vector3 & vmin); |
---|
[137bf99] | 229 | |
---|
[9d3d8cc] | 230 | void CreateMenuBar(); |
---|
[242cb07] | 231 | void MakeToolBar(); |
---|
[9d3d8cc] | 232 | void CreateSidePanel(); |
---|
| 233 | |
---|
[7c29c976] | 234 | void UpdateStatusBar(); |
---|
| 235 | |
---|
[bc73093] | 236 | void AddToFileHistory(const wxString & file); |
---|
| 237 | |
---|
[137bf99] | 238 | public: |
---|
| 239 | MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size); |
---|
[5809313] | 240 | |
---|
[fb5887c] | 241 | void InitialiseAfterLoad(const wxString & file); |
---|
| 242 | |
---|
[732b9b0] | 243 | void OnMRUFile(wxCommandEvent& event); |
---|
[5f06d2c] | 244 | void OpenFile(const wxString& file, const wxString& survey = wxString()); |
---|
[1690fa9] | 245 | |
---|
| 246 | void OnPresNewUpdate(wxUpdateUIEvent& event); |
---|
| 247 | void OnPresOpenUpdate(wxUpdateUIEvent& event); |
---|
| 248 | void OnPresSaveUpdate(wxUpdateUIEvent& event); |
---|
| 249 | void OnPresSaveAsUpdate(wxUpdateUIEvent& event); |
---|
| 250 | void OnPresMarkUpdate(wxUpdateUIEvent& event); |
---|
[128fac4] | 251 | void OnPresFRewindUpdate(wxUpdateUIEvent& event); |
---|
| 252 | void OnPresRewindUpdate(wxUpdateUIEvent& event); |
---|
| 253 | void OnPresReverseUpdate(wxUpdateUIEvent& event); |
---|
| 254 | void OnPresPlayUpdate(wxUpdateUIEvent& event); |
---|
| 255 | void OnPresFFUpdate(wxUpdateUIEvent& event); |
---|
| 256 | void OnPresFFFUpdate(wxUpdateUIEvent& event); |
---|
| 257 | void OnPresPauseUpdate(wxUpdateUIEvent& event); |
---|
| 258 | void OnPresStopUpdate(wxUpdateUIEvent& event); |
---|
[6a4cdcb6] | 259 | void OnPresExportMovieUpdate(wxUpdateUIEvent& event); |
---|
[1690fa9] | 260 | //void OnFileOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
[137bf99] | 261 | |
---|
[bc60689] | 262 | void DoFind(); |
---|
[2a02de2] | 263 | void OnFind(wxCommandEvent& event); |
---|
[bc60689] | 264 | void OnIdle(wxIdleEvent& event); |
---|
[d1628e8e] | 265 | void OnGotoFound(wxCommandEvent& event); |
---|
[2a02de2] | 266 | void OnHide(wxCommandEvent& event); |
---|
[429465a] | 267 | void OnHideUpdate(wxUpdateUIEvent& ui); |
---|
[2a02de2] | 268 | |
---|
[5809313] | 269 | void OnOpen(wxCommandEvent& event); |
---|
[045e2af] | 270 | void OnScreenshot(wxCommandEvent& event); |
---|
| 271 | void OnScreenshotUpdate(wxUpdateUIEvent& event); |
---|
[02c7c1a] | 272 | void OnFilePreferences(wxCommandEvent& event); |
---|
[8000d8f] | 273 | void OnFileOpenTerrain(wxCommandEvent& event); |
---|
[ce403f1] | 274 | void OnPrint(wxCommandEvent& event); |
---|
[4ed8154] | 275 | void PrintAndExit(); |
---|
[ce403f1] | 276 | void OnPageSetup(wxCommandEvent& event); |
---|
[1690fa9] | 277 | void OnPresNew(wxCommandEvent& event); |
---|
| 278 | void OnPresOpen(wxCommandEvent& event); |
---|
| 279 | void OnPresSave(wxCommandEvent& event); |
---|
| 280 | void OnPresSaveAs(wxCommandEvent& event); |
---|
| 281 | void OnPresMark(wxCommandEvent& event); |
---|
[128fac4] | 282 | void OnPresFRewind(wxCommandEvent& event); |
---|
| 283 | void OnPresRewind(wxCommandEvent& event); |
---|
| 284 | void OnPresReverse(wxCommandEvent& event); |
---|
| 285 | void OnPresPlay(wxCommandEvent& event); |
---|
| 286 | void OnPresFF(wxCommandEvent& event); |
---|
| 287 | void OnPresFFF(wxCommandEvent& event); |
---|
| 288 | void OnPresPause(wxCommandEvent& event); |
---|
| 289 | void OnPresStop(wxCommandEvent& event); |
---|
[6a4cdcb6] | 290 | void OnPresExportMovie(wxCommandEvent& event); |
---|
[223f1ad] | 291 | void OnExport(wxCommandEvent& event); |
---|
[5809313] | 292 | void OnQuit(wxCommandEvent& event); |
---|
[5ffa439] | 293 | |
---|
[573f4e9] | 294 | void OnAbout(wxCommandEvent& event); |
---|
[137bf99] | 295 | void OnClose(wxCloseEvent&); |
---|
| 296 | |
---|
[b4fe9fb] | 297 | void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
[4b1fc48] | 298 | |
---|
[26fac5a] | 299 | void OnKeyPress(wxKeyEvent &e) { |
---|
| 300 | if (m_Gfx) { |
---|
| 301 | m_Gfx->SetFocus(); |
---|
| 302 | m_Gfx->OnKeyPress(e); |
---|
| 303 | } |
---|
| 304 | } |
---|
| 305 | |
---|
[ce403f1] | 306 | void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[223f1ad] | 307 | void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
| 308 | |
---|
[137bf99] | 309 | // temporary bodges until event handling problem is sorted out: |
---|
[5876fcb] | 310 | void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDefaultsUpdate(event); } |
---|
| 311 | void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnPlanUpdate(event); } |
---|
| 312 | void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnElevationUpdate(event); } |
---|
| 313 | void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDisplayOverlappingNamesUpdate(event); } |
---|
[da6c802] | 314 | void OnColourByDepthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDepthUpdate(event); } |
---|
[d4650b3] | 315 | void OnColourByDateUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDateUpdate(event); } |
---|
[c61aa79] | 316 | void OnColourByErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByErrorUpdate(event); } |
---|
[5876fcb] | 317 | void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowCrossesUpdate(event); } |
---|
| 318 | void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowEntrancesUpdate(event); } |
---|
| 319 | void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowFixedPtsUpdate(event); } |
---|
| 320 | void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowExportedPtsUpdate(event); } |
---|
| 321 | void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowStationNamesUpdate(event); } |
---|
| 322 | void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurveyLegsUpdate(event); } |
---|
[9cb97b7] | 323 | void OnSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSplaysUpdate(event); } |
---|
[8666fc7] | 324 | void OnHideSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideSplaysUpdate(event); } |
---|
| 325 | void OnShowSplaysNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysNormalUpdate(event); } |
---|
| 326 | void OnShowSplaysFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysFadedUpdate(event); } |
---|
[5876fcb] | 327 | void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurfaceUpdate(event); } |
---|
| 328 | void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveEastUpdate(event); } |
---|
| 329 | void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveNorthUpdate(event); } |
---|
| 330 | void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveSouthUpdate(event); } |
---|
| 331 | void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveWestUpdate(event); } |
---|
| 332 | void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleRotationUpdate(event); } |
---|
| 333 | void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseControlsUpdate(event); } |
---|
| 334 | void OnSlowDownUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSlowDownUpdate(event); } |
---|
| 335 | void OnSpeedUpUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSpeedUpUpdate(event); } |
---|
[c3b20c5] | 336 | void OnStepOnceUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnStepOnceUpdate(event); } |
---|
[5876fcb] | 337 | void OnHigherViewpointUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHigherViewpointUpdate(event); } |
---|
| 338 | void OnLowerViewpointUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnLowerViewpointUpdate(event); } |
---|
| 339 | void OnShiftDisplayDownUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShiftDisplayDownUpdate(event); } |
---|
| 340 | void OnShiftDisplayLeftUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShiftDisplayLeftUpdate(event); } |
---|
| 341 | void OnShiftDisplayRightUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShiftDisplayRightUpdate(event); } |
---|
| 342 | void OnShiftDisplayUpUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShiftDisplayUpUpdate(event); } |
---|
| 343 | void OnZoomInUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnZoomInUpdate(event); } |
---|
| 344 | void OnZoomOutUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnZoomOutUpdate(event); } |
---|
| 345 | void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleScalebarUpdate(event); } |
---|
[97ea48d] | 346 | void OnToggleColourKeyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleColourKeyUpdate(event); } |
---|
[5876fcb] | 347 | void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewCompassUpdate(event); } |
---|
| 348 | void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewGridUpdate(event); } |
---|
[f4c5932] | 349 | void OnViewBoundingBoxUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewBoundingBoxUpdate(event); } |
---|
[5876fcb] | 350 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewClinoUpdate(event); } |
---|
[6abab84] | 351 | void OnViewPerspectiveUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewPerspectiveUpdate(event); } |
---|
[d67450e] | 352 | void OnViewSmoothShadingUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothShadingUpdate(event); } |
---|
[a517825] | 353 | void OnViewTexturedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTexturedUpdate(event); } |
---|
[c60062d] | 354 | void OnViewFogUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFogUpdate(event); } |
---|
[db452ae] | 355 | void OnViewSmoothLinesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothLinesUpdate(event); } |
---|
[b13aee4] | 356 | void OnViewFullScreenUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFullScreenUpdate(event); } |
---|
[5876fcb] | 357 | void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseDirectionOfRotationUpdate(event); } |
---|
| 358 | void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnCancelDistLineUpdate(event); } |
---|
| 359 | void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnIndicatorsUpdate(event); } |
---|
| 360 | |
---|
[b4fe9fb] | 361 | void OnDefaults(wxCommandEvent&) { if (m_Control) m_Control->OnDefaults(); } |
---|
| 362 | void OnPlan(wxCommandEvent&) { if (m_Control) m_Control->OnPlan(); } |
---|
| 363 | void OnElevation(wxCommandEvent&) { if (m_Control) m_Control->OnElevation(); } |
---|
| 364 | void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Control) m_Control->OnDisplayOverlappingNames(); } |
---|
[da6c802] | 365 | void OnColourByDepth(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDepth(); } |
---|
[d4650b3] | 366 | void OnColourByDate(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDate(); } |
---|
[c61aa79] | 367 | void OnColourByError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByError(); } |
---|
[b4fe9fb] | 368 | void OnShowCrosses(wxCommandEvent&) { if (m_Control) m_Control->OnShowCrosses(); } |
---|
| 369 | void OnShowEntrances(wxCommandEvent&) { if (m_Control) m_Control->OnShowEntrances(); } |
---|
| 370 | void OnShowFixedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowFixedPts(); } |
---|
| 371 | void OnShowExportedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowExportedPts(); } |
---|
| 372 | void OnShowStationNames(wxCommandEvent&) { if (m_Control) m_Control->OnShowStationNames(); } |
---|
| 373 | void OnShowSurveyLegs(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurveyLegs(); } |
---|
[8666fc7] | 374 | void OnHideSplays(wxCommandEvent&) { if (m_Control) m_Control->OnHideSplays(); } |
---|
| 375 | void OnShowSplaysNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysNormal(); } |
---|
| 376 | void OnShowSplaysFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysFaded(); } |
---|
[b4fe9fb] | 377 | void OnShowSurface(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurface(); } |
---|
| 378 | void OnMoveEast(wxCommandEvent&) { if (m_Control) m_Control->OnMoveEast(); } |
---|
| 379 | void OnMoveNorth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveNorth(); } |
---|
| 380 | void OnMoveSouth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveSouth(); } |
---|
| 381 | void OnMoveWest(wxCommandEvent&) { if (m_Control) m_Control->OnMoveWest(); } |
---|
| 382 | void OnToggleRotation(wxCommandEvent&) { if (m_Control) m_Control->OnToggleRotation(); } |
---|
| 383 | void OnReverseControls(wxCommandEvent&) { if (m_Control) m_Control->OnReverseControls(); } |
---|
| 384 | void OnSlowDown(wxCommandEvent&) { if (m_Control) m_Control->OnSlowDown(); } |
---|
| 385 | void OnSpeedUp(wxCommandEvent&) { if (m_Control) m_Control->OnSpeedUp(); } |
---|
| 386 | void OnStepOnceAnticlockwise(wxCommandEvent&) { if (m_Control) m_Control->OnStepOnceAnticlockwise(); } |
---|
| 387 | void OnStepOnceClockwise(wxCommandEvent&) { if (m_Control) m_Control->OnStepOnceClockwise(); } |
---|
| 388 | void OnHigherViewpoint(wxCommandEvent&) { if (m_Control) m_Control->OnHigherViewpoint(); } |
---|
| 389 | void OnLowerViewpoint(wxCommandEvent&) { if (m_Control) m_Control->OnLowerViewpoint(); } |
---|
| 390 | void OnShiftDisplayDown(wxCommandEvent&) { if (m_Control) m_Control->OnShiftDisplayDown(); } |
---|
| 391 | void OnShiftDisplayLeft(wxCommandEvent&) { if (m_Control) m_Control->OnShiftDisplayLeft(); } |
---|
| 392 | void OnShiftDisplayRight(wxCommandEvent&) { if (m_Control) m_Control->OnShiftDisplayRight(); } |
---|
| 393 | void OnShiftDisplayUp(wxCommandEvent&) { if (m_Control) m_Control->OnShiftDisplayUp(); } |
---|
| 394 | void OnZoomIn(wxCommandEvent&) { if (m_Control) m_Control->OnZoomIn(); } |
---|
| 395 | void OnZoomOut(wxCommandEvent&) { if (m_Control) m_Control->OnZoomOut(); } |
---|
| 396 | void OnToggleScalebar(wxCommandEvent&) { if (m_Control) m_Control->OnToggleScalebar(); } |
---|
[97ea48d] | 397 | void OnToggleColourKey(wxCommandEvent&) { if (m_Control) m_Control->OnToggleColourKey(); } |
---|
[b4fe9fb] | 398 | void OnViewCompass(wxCommandEvent&) { if (m_Control) m_Control->OnViewCompass(); } |
---|
| 399 | void OnViewClino(wxCommandEvent&) { if (m_Control) m_Control->OnViewClino(); } |
---|
| 400 | void OnViewGrid(wxCommandEvent&) { if (m_Control) m_Control->OnViewGrid(); } |
---|
[f4c5932] | 401 | void OnViewBoundingBox(wxCommandEvent&) { if (m_Control) m_Control->OnViewBoundingBox(); } |
---|
[6abab84] | 402 | void OnViewPerspective(wxCommandEvent&) { if (m_Control) m_Control->OnViewPerspective(); } |
---|
[d67450e] | 403 | void OnViewSmoothShading(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothShading(); } |
---|
[a517825] | 404 | void OnViewTextured(wxCommandEvent&) { if (m_Control) m_Control->OnViewTextured(); } |
---|
[c60062d] | 405 | void OnViewFog(wxCommandEvent&) { if (m_Control) m_Control->OnViewFog(); } |
---|
[db452ae] | 406 | void OnViewSmoothLines(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothLines(); } |
---|
[c60062d] | 407 | void OnViewFullScreen(wxCommandEvent&) { ViewFullScreen(); } |
---|
[fdfa926] | 408 | void ViewFullScreen(); |
---|
[b75a37d] | 409 | bool FullScreenModeShowingMenus() const; |
---|
| 410 | void FullScreenModeShowMenus(bool show); |
---|
[b4fe9fb] | 411 | void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Control) m_Control->OnReverseDirectionOfRotation(); } |
---|
| 412 | void OnCancelDistLine(wxCommandEvent&) { if (m_Control) m_Control->OnCancelDistLine(); } |
---|
[421b7d2] | 413 | |
---|
[5876fcb] | 414 | void OnToggleMetric(wxCommandEvent&) { if (m_Control) m_Control->OnToggleMetric(); } |
---|
| 415 | void OnToggleDegrees(wxCommandEvent&) { if (m_Control) m_Control->OnToggleDegrees(); } |
---|
[d171c0c] | 416 | void OnTogglePercent(wxCommandEvent&) { if (m_Control) m_Control->OnTogglePercent(); } |
---|
[33b2094] | 417 | void OnToggleTubes(wxCommandEvent&) { if (m_Control) m_Control->OnToggleTubes(); } |
---|
[5757725] | 418 | |
---|
[5876fcb] | 419 | void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleMetricUpdate(event); } |
---|
| 420 | void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleDegreesUpdate(event); } |
---|
[d171c0c] | 421 | void OnTogglePercentUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnTogglePercentUpdate(event); } |
---|
[33b2094] | 422 | void OnToggleTubesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleTubesUpdate(event); } |
---|
[5757725] | 423 | |
---|
[5876fcb] | 424 | // end of horrible bodges |
---|
[f433fda] | 425 | |
---|
[9059368] | 426 | void OnViewSidePanelUpdate(wxUpdateUIEvent& event); |
---|
| 427 | void OnViewSidePanel(wxCommandEvent& event); |
---|
[b1de3e0] | 428 | void ToggleSidePanel(); |
---|
[203d2a7] | 429 | bool ShowingSidePanel(); |
---|
[137bf99] | 430 | |
---|
[d67450e] | 431 | const Vector3 & GetExtent() const { return m_Ext; } |
---|
| 432 | Double GetXExtent() const { return m_Ext.GetX(); } |
---|
| 433 | Double GetYExtent() const { return m_Ext.GetY(); } |
---|
| 434 | Double GetZExtent() const { return m_Ext.GetZ(); } |
---|
[78c67a6] | 435 | |
---|
| 436 | Double GetDepthExtent() const { return m_DepthExt; } |
---|
| 437 | Double GetDepthMin() const { return m_DepthMin; } |
---|
[003d953] | 438 | |
---|
[a74b014] | 439 | bool HasCompleteDateInfo() const { return complete_dateinfo; } |
---|
[1ee204e] | 440 | int GetDateExtent() const { return m_DateExt; } |
---|
| 441 | int GetDateMin() const { return m_DateMin; } |
---|
[d4650b3] | 442 | |
---|
[381ae6e] | 443 | void SelectTreeItem(const LabelInfo* label) { |
---|
[6264918] | 444 | if (label->tree_id.IsOk()) |
---|
| 445 | m_Tree->SelectItem(label->tree_id); |
---|
[381ae6e] | 446 | else |
---|
| 447 | m_Tree->UnselectAll(); |
---|
[6264918] | 448 | } |
---|
[381ae6e] | 449 | |
---|
[1fd2edb] | 450 | void ClearTreeSelection(); |
---|
| 451 | |
---|
[003d953] | 452 | int GetNumFixedPts() const { return m_NumFixedPts; } |
---|
| 453 | int GetNumExportedPts() const { return m_NumExportedPts; } |
---|
| 454 | int GetNumEntrances() const { return m_NumEntrances; } |
---|
[429465a] | 455 | int GetNumHighlightedPts() const { return m_NumHighlighted; } |
---|
[a9a32f2] | 456 | |
---|
[f433fda] | 457 | bool HasUndergroundLegs() const { return m_HasUndergroundLegs; } |
---|
[5fe7292] | 458 | bool HasSplays() const { return m_HasSplays; } |
---|
[f433fda] | 459 | bool HasSurfaceLegs() const { return m_HasSurfaceLegs; } |
---|
[50e8979] | 460 | bool HasTubes() const { return !tubes.empty(); } |
---|
[c61aa79] | 461 | bool HasErrorInformation() const { return m_HasErrorInformation; } |
---|
[f433fda] | 462 | |
---|
[eef68f9] | 463 | bool IsExtendedElevation() const { return m_IsExtendedElevation; } |
---|
| 464 | |
---|
[156dc16] | 465 | void ClearCoords(); |
---|
[d67450e] | 466 | void SetCoords(const Vector3 &v); |
---|
[0633bcc] | 467 | const LabelInfo * GetTreeSelection() const; |
---|
[381ae6e] | 468 | void SetCoords(Double x, Double y, const LabelInfo * there); |
---|
| 469 | void SetAltitude(Double z, const LabelInfo * there); |
---|
[156dc16] | 470 | |
---|
[d67450e] | 471 | const Vector3 & GetOffset() const { return m_Offsets; } |
---|
[a6f081c] | 472 | |
---|
[c61aa79] | 473 | list<traverse>::const_iterator traverses_begin() const { |
---|
[3ddcad8] | 474 | return traverses.begin(); |
---|
| 475 | } |
---|
| 476 | |
---|
[c61aa79] | 477 | list<traverse>::const_iterator traverses_end() const { |
---|
[3ddcad8] | 478 | return traverses.end(); |
---|
| 479 | } |
---|
| 480 | |
---|
[c61aa79] | 481 | list<traverse>::const_iterator surface_traverses_begin() const { |
---|
[3ddcad8] | 482 | return surface_traverses.begin(); |
---|
[ee119518] | 483 | } |
---|
| 484 | |
---|
[c61aa79] | 485 | list<traverse>::const_iterator surface_traverses_end() const { |
---|
[3ddcad8] | 486 | return surface_traverses.end(); |
---|
[137bf99] | 487 | } |
---|
| 488 | |
---|
[ee05463] | 489 | list<vector<XSect> >::const_iterator tubes_begin() const { |
---|
| 490 | return tubes.begin(); |
---|
| 491 | } |
---|
| 492 | |
---|
| 493 | list<vector<XSect> >::const_iterator tubes_end() const { |
---|
| 494 | return tubes.end(); |
---|
| 495 | } |
---|
| 496 | |
---|
[fc68ad5] | 497 | list<vector<XSect> >::iterator tubes_begin() { |
---|
| 498 | return tubes.begin(); |
---|
| 499 | } |
---|
| 500 | |
---|
| 501 | list<vector<XSect> >::iterator tubes_end() { |
---|
| 502 | return tubes.end(); |
---|
| 503 | } |
---|
| 504 | |
---|
[fa42426] | 505 | list<LabelInfo*>::const_iterator GetLabels() const { |
---|
| 506 | return m_Labels.begin(); |
---|
| 507 | } |
---|
| 508 | |
---|
[003d953] | 509 | list<LabelInfo*>::const_iterator GetLabelsEnd() const { |
---|
[421b7d2] | 510 | return m_Labels.end(); |
---|
[137bf99] | 511 | } |
---|
[5809313] | 512 | |
---|
[fa42426] | 513 | list<LabelInfo*>::const_reverse_iterator GetRevLabels() const { |
---|
| 514 | return m_Labels.rbegin(); |
---|
| 515 | } |
---|
| 516 | |
---|
| 517 | list<LabelInfo*>::const_reverse_iterator GetRevLabelsEnd() const { |
---|
| 518 | return m_Labels.rend(); |
---|
| 519 | } |
---|
| 520 | |
---|
[86cdcf2] | 521 | list<LabelInfo*>::iterator GetLabelsNC() { |
---|
| 522 | return m_Labels.begin(); |
---|
| 523 | } |
---|
| 524 | |
---|
| 525 | list<LabelInfo*>::iterator GetLabelsNCEnd() { |
---|
| 526 | return m_Labels.end(); |
---|
| 527 | } |
---|
| 528 | |
---|
[381ae6e] | 529 | void ShowInfo(const LabelInfo *here = NULL, const LabelInfo *there = NULL); |
---|
| 530 | void DisplayTreeInfo(const wxTreeItemData* data = NULL); |
---|
[44ed489] | 531 | void TreeItemSelected(const wxTreeItemData* data, bool zoom); |
---|
[1690fa9] | 532 | PresentationMark GetPresMark(int which); |
---|
[8bac36d6] | 533 | |
---|
[84cab34] | 534 | private: |
---|
| 535 | DECLARE_EVENT_TABLE() |
---|
[5809313] | 536 | }; |
---|
| 537 | |
---|
[4b0bbb0] | 538 | // Older wxGTK loses pop-up dialogs under the always-on-top, maximised window. |
---|
| 539 | // Not sure when this got fixed, but wx 2.8.10 definitely works properly on |
---|
| 540 | // Debian squeeze. |
---|
| 541 | // |
---|
| 542 | // To work around this issue, create this object on the stack, and it will |
---|
| 543 | // temporarily un-fullscreen the window while the dialog as a workaround. |
---|
[1c6b20d7] | 544 | class AvenAllowOnTop { |
---|
[4b0bbb0] | 545 | #if defined __WXGTK__ && !wxCHECK_VERSION(2,8,10) |
---|
[d67450e] | 546 | MainFrm * mainfrm; |
---|
[1c6b20d7] | 547 | public: |
---|
[d67450e] | 548 | AvenAllowOnTop(MainFrm * mainfrm_) { |
---|
[c4d9257] | 549 | if (mainfrm_ && mainfrm_->IsFullScreen()) { |
---|
[1c6b20d7] | 550 | mainfrm = mainfrm_; |
---|
| 551 | mainfrm->ViewFullScreen(); |
---|
[d67450e] | 552 | } else { |
---|
| 553 | mainfrm = 0; |
---|
[1c6b20d7] | 554 | } |
---|
| 555 | } |
---|
| 556 | ~AvenAllowOnTop() { |
---|
| 557 | if (mainfrm) mainfrm->ViewFullScreen(); |
---|
| 558 | } |
---|
[d67450e] | 559 | #else |
---|
| 560 | public: |
---|
| 561 | AvenAllowOnTop(MainFrm *) { } |
---|
| 562 | #endif |
---|
[1c6b20d7] | 563 | }; |
---|
| 564 | |
---|
[5809313] | 565 | #endif |
---|