[5809313] | 1 | // |
---|
| 2 | // mainfrm.h |
---|
| 3 | // |
---|
| 4 | // Main frame handling for Aven. |
---|
| 5 | // |
---|
[f4c5932] | 6 | // Copyright (C) 2000-2003,2005 Mark R. Shinwell |
---|
[672459c] | 7 | // Copyright (C) 2001-2003,2004,2005,2006,2010,2011,2012,2013,2014,2015,2016,2018 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" |
---|
[bec42b2] | 40 | #include "model.h" |
---|
[db36155] | 41 | #include "vector3.h" |
---|
[5627cbb] | 42 | #include "aven.h" |
---|
[9c3d91e] | 43 | //#include "prefsdlg.h" |
---|
[156dc16] | 44 | |
---|
[137bf99] | 45 | #include <list> |
---|
[3ddcad8] | 46 | #include <vector> |
---|
[5809313] | 47 | |
---|
[137bf99] | 48 | using namespace std; |
---|
[5341d94] | 49 | |
---|
[f17e6dc6] | 50 | #include <math.h> |
---|
[f10cf8f] | 51 | #include <time.h> |
---|
[f17e6dc6] | 52 | |
---|
[562ca6a] | 53 | #ifdef __WXMAC__ |
---|
[559cd60] | 54 | // Currently on macOS, we force use of a generic toolbar, which needs to be put |
---|
[562ca6a] | 55 | // in a sizer. |
---|
| 56 | # define USING_GENERIC_TOOLBAR |
---|
| 57 | #endif |
---|
| 58 | |
---|
[1690fa9] | 59 | #define MARK_FIRST 1 |
---|
| 60 | #define MARK_NEXT 2 |
---|
[128fac4] | 61 | #define MARK_PREV 3 |
---|
[1690fa9] | 62 | |
---|
[137bf99] | 63 | enum { |
---|
[d7b53e3] | 64 | menu_FILE_LOG = 1000, |
---|
[622460e] | 65 | menu_FILE_OPEN_TERRAIN, |
---|
[d7b53e3] | 66 | menu_FILE_PAGE_SETUP, |
---|
[045e2af] | 67 | menu_FILE_SCREENSHOT, |
---|
[223f1ad] | 68 | menu_FILE_EXPORT, |
---|
[549eb37] | 69 | menu_FILE_EXTEND, |
---|
[1690fa9] | 70 | menu_PRES_NEW, |
---|
| 71 | menu_PRES_OPEN, |
---|
| 72 | menu_PRES_SAVE, |
---|
| 73 | menu_PRES_SAVE_AS, |
---|
| 74 | menu_PRES_MARK, |
---|
[6a4cdcb6] | 75 | menu_PRES_EXPORT_MOVIE, |
---|
[128fac4] | 76 | menu_PRES_FREWIND, |
---|
| 77 | menu_PRES_REWIND, |
---|
| 78 | menu_PRES_REVERSE, |
---|
| 79 | menu_PRES_PLAY, |
---|
| 80 | menu_PRES_FF, |
---|
| 81 | menu_PRES_FFF, |
---|
| 82 | menu_PRES_PAUSE, |
---|
[137bf99] | 83 | menu_ROTATION_START, |
---|
| 84 | menu_ROTATION_STOP, |
---|
[2d9ed8ad] | 85 | menu_ROTATION_TOGGLE, |
---|
[137bf99] | 86 | menu_ROTATION_REVERSE, |
---|
| 87 | menu_ORIENT_MOVE_NORTH, |
---|
| 88 | menu_ORIENT_MOVE_EAST, |
---|
| 89 | menu_ORIENT_MOVE_SOUTH, |
---|
| 90 | menu_ORIENT_MOVE_WEST, |
---|
| 91 | menu_ORIENT_PLAN, |
---|
| 92 | menu_ORIENT_ELEVATION, |
---|
| 93 | menu_ORIENT_DEFAULTS, |
---|
| 94 | menu_VIEW_SHOW_LEGS, |
---|
[9cb97b7] | 95 | menu_VIEW_SPLAYS, |
---|
[8666fc7] | 96 | menu_SPLAYS_HIDE, |
---|
[b96edeb] | 97 | menu_SPLAYS_SHOW_DASHED, |
---|
[8666fc7] | 98 | menu_SPLAYS_SHOW_FADED, |
---|
[b49ac56] | 99 | menu_SPLAYS_SHOW_NORMAL, |
---|
[e5c5f3c] | 100 | menu_VIEW_DUPES, |
---|
| 101 | menu_DUPES_HIDE, |
---|
| 102 | menu_DUPES_SHOW_DASHED, |
---|
[b96edeb] | 103 | menu_DUPES_SHOW_FADED, |
---|
[e5c5f3c] | 104 | menu_DUPES_SHOW_NORMAL, |
---|
[137bf99] | 105 | menu_VIEW_SHOW_CROSSES, |
---|
| 106 | menu_VIEW_SHOW_NAMES, |
---|
| 107 | menu_VIEW_SHOW_SURFACE, |
---|
| 108 | menu_VIEW_SHOW_OVERLAPPING_NAMES, |
---|
[fe444b8] | 109 | menu_VIEW_SHOW_ENTRANCES, |
---|
| 110 | menu_VIEW_SHOW_FIXED_PTS, |
---|
| 111 | menu_VIEW_SHOW_EXPORTED_PTS, |
---|
[137bf99] | 112 | menu_VIEW_STATUS_BAR, |
---|
[c1cf79d] | 113 | menu_VIEW_GRID, |
---|
[f4c5932] | 114 | menu_VIEW_BOUNDING_BOX, |
---|
[4938bcd] | 115 | menu_VIEW_TERRAIN, |
---|
[33b2094] | 116 | menu_VIEW_SHOW_TUBES, |
---|
[6abab84] | 117 | menu_VIEW_PERSPECTIVE, |
---|
[d67450e] | 118 | menu_VIEW_SMOOTH_SHADING, |
---|
[a517825] | 119 | menu_VIEW_TEXTURED, |
---|
[c60062d] | 120 | menu_VIEW_FOG, |
---|
[db452ae] | 121 | menu_VIEW_SMOOTH_LINES, |
---|
[b13aee4] | 122 | menu_VIEW_FULLSCREEN, |
---|
[46beda0] | 123 | menu_VIEW_COLOUR_BY, |
---|
| 124 | menu_COLOUR_BY_DEPTH, |
---|
| 125 | menu_COLOUR_BY_DATE, |
---|
| 126 | menu_COLOUR_BY_ERROR, |
---|
[fc43dda] | 127 | menu_COLOUR_BY_H_ERROR, |
---|
| 128 | menu_COLOUR_BY_V_ERROR, |
---|
[46beda0] | 129 | menu_COLOUR_BY_GRADIENT, |
---|
| 130 | menu_COLOUR_BY_LENGTH, |
---|
[68fb07a] | 131 | menu_COLOUR_BY_SURVEY, |
---|
[7a36b67] | 132 | menu_IND_COMPASS, |
---|
| 133 | menu_IND_CLINO, |
---|
[97ea48d] | 134 | menu_IND_COLOUR_KEY, |
---|
[7a36b67] | 135 | menu_IND_SCALE_BAR, |
---|
| 136 | menu_CTL_INDICATORS, |
---|
| 137 | menu_CTL_SIDE_PANEL, |
---|
| 138 | menu_CTL_METRIC, |
---|
| 139 | menu_CTL_DEGREES, |
---|
[d171c0c] | 140 | menu_CTL_PERCENT, |
---|
[7a36b67] | 141 | menu_CTL_REVERSE, |
---|
| 142 | menu_CTL_CANCEL_DIST_LINE, |
---|
[5e0b9f9d] | 143 | menu_SURVEY_RESTRICT, |
---|
| 144 | menu_SURVEY_SHOW_ALL, |
---|
[672459c] | 145 | menu_SURVEY_HIDE, |
---|
| 146 | menu_SURVEY_SHOW, |
---|
| 147 | menu_SURVEY_HIDE_SIBLINGS, |
---|
[429465a] | 148 | textctrl_FIND, |
---|
[1690fa9] | 149 | button_HIDE, |
---|
| 150 | listctrl_PRES |
---|
[137bf99] | 151 | }; |
---|
| 152 | |
---|
[1c6b20d7] | 153 | class AvenPresList; |
---|
[fa42426] | 154 | |
---|
[373b738] | 155 | class MainFrm : public wxFrame, public Model { |
---|
| 156 | wxFileHistory m_history; |
---|
| 157 | int m_SashPosition; |
---|
| 158 | bool was_showing_sidepanel_before_fullscreen; |
---|
[137bf99] | 159 | GfxCore* m_Gfx; |
---|
[d7b53e3] | 160 | wxWindow* m_Log; |
---|
[5876fcb] | 161 | GUIControl* m_Control; |
---|
[156dc16] | 162 | wxSplitterWindow* m_Splitter; |
---|
| 163 | AvenTreeCtrl* m_Tree; |
---|
| 164 | wxTextCtrl* m_FindBox; |
---|
[f315fa7] | 165 | // wxCheckBox* m_RegexpCheckBox; |
---|
[203d2a7] | 166 | wxNotebook* m_Notebook; |
---|
[1c6b20d7] | 167 | AvenPresList* m_PresList; |
---|
[156dc16] | 168 | wxString m_File; |
---|
[549eb37] | 169 | // Processed version of data - same as m_File if m_File is processed data. |
---|
| 170 | wxString m_FileProcessed; |
---|
[5e0b9f9d] | 171 | wxString m_Survey; |
---|
[a6f081c] | 172 | |
---|
[7c29c976] | 173 | // Strings for status bar reporting of distances. |
---|
[0633bcc] | 174 | wxString here_text, coords_text, dist_text, distfree_text; |
---|
[7c29c976] | 175 | |
---|
[373b738] | 176 | int m_NumHighlighted = 0; |
---|
[bc60689] | 177 | bool pending_find; |
---|
| 178 | |
---|
[b75a37d] | 179 | bool fullscreen_showing_menus; |
---|
| 180 | |
---|
[bc60689] | 181 | #ifdef PREFDLG |
---|
| 182 | PrefsDlg* m_PrefsDlg; |
---|
| 183 | #endif |
---|
[eef68f9] | 184 | |
---|
[b88b171] | 185 | bool ProcessSVXFile(const wxString & file); |
---|
[c61aa79] | 186 | // void FixLRUD(traverse & centreline); |
---|
[137bf99] | 187 | |
---|
[9d3d8cc] | 188 | void CreateMenuBar(); |
---|
[242cb07] | 189 | void MakeToolBar(); |
---|
[9d3d8cc] | 190 | void CreateSidePanel(); |
---|
| 191 | |
---|
[7c29c976] | 192 | void UpdateStatusBar(); |
---|
| 193 | |
---|
[562ca6a] | 194 | #ifdef USING_GENERIC_TOOLBAR |
---|
| 195 | wxToolBar * GetToolBar() const { |
---|
| 196 | wxSizer * sizer = GetSizer(); |
---|
| 197 | if (!sizer) return NULL; |
---|
| 198 | return (wxToolBar*)sizer->GetItem(size_t(0))->GetWindow(); |
---|
| 199 | } |
---|
| 200 | #endif |
---|
| 201 | |
---|
[137bf99] | 202 | public: |
---|
| 203 | MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size); |
---|
[5809313] | 204 | |
---|
[d7b53e3] | 205 | // public for CavernLog. |
---|
| 206 | bool LoadData(const wxString& file, const wxString& prefix); |
---|
| 207 | void AddToFileHistory(const wxString & file); |
---|
| 208 | |
---|
[5e0b9f9d] | 209 | void InitialiseAfterLoad(const wxString & file, const wxString & prefix); |
---|
[d7b53e3] | 210 | void OnShowLog(wxCommandEvent& event); |
---|
[fb5887c] | 211 | |
---|
[732b9b0] | 212 | void OnMRUFile(wxCommandEvent& event); |
---|
[5f06d2c] | 213 | void OpenFile(const wxString& file, const wxString& survey = wxString()); |
---|
[1690fa9] | 214 | |
---|
| 215 | void OnPresNewUpdate(wxUpdateUIEvent& event); |
---|
| 216 | void OnPresOpenUpdate(wxUpdateUIEvent& event); |
---|
| 217 | void OnPresSaveUpdate(wxUpdateUIEvent& event); |
---|
| 218 | void OnPresSaveAsUpdate(wxUpdateUIEvent& event); |
---|
| 219 | void OnPresMarkUpdate(wxUpdateUIEvent& event); |
---|
[128fac4] | 220 | void OnPresFRewindUpdate(wxUpdateUIEvent& event); |
---|
| 221 | void OnPresRewindUpdate(wxUpdateUIEvent& event); |
---|
| 222 | void OnPresReverseUpdate(wxUpdateUIEvent& event); |
---|
| 223 | void OnPresPlayUpdate(wxUpdateUIEvent& event); |
---|
| 224 | void OnPresFFUpdate(wxUpdateUIEvent& event); |
---|
| 225 | void OnPresFFFUpdate(wxUpdateUIEvent& event); |
---|
| 226 | void OnPresPauseUpdate(wxUpdateUIEvent& event); |
---|
| 227 | void OnPresStopUpdate(wxUpdateUIEvent& event); |
---|
[6a4cdcb6] | 228 | void OnPresExportMovieUpdate(wxUpdateUIEvent& event); |
---|
[622460e] | 229 | void OnOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
[137bf99] | 230 | |
---|
[bc60689] | 231 | void DoFind(); |
---|
[2a02de2] | 232 | void OnFind(wxCommandEvent& event); |
---|
[bc60689] | 233 | void OnIdle(wxIdleEvent& event); |
---|
[d1628e8e] | 234 | void OnGotoFound(wxCommandEvent& event); |
---|
[2a02de2] | 235 | void OnHide(wxCommandEvent& event); |
---|
[429465a] | 236 | void OnHideUpdate(wxUpdateUIEvent& ui); |
---|
[2a02de2] | 237 | |
---|
[5809313] | 238 | void OnOpen(wxCommandEvent& event); |
---|
[622460e] | 239 | void OnOpenTerrain(wxCommandEvent&); |
---|
[d7b53e3] | 240 | void HideLog(wxWindow * log_window); |
---|
[045e2af] | 241 | void OnScreenshot(wxCommandEvent& event); |
---|
| 242 | void OnScreenshotUpdate(wxUpdateUIEvent& event); |
---|
[02c7c1a] | 243 | void OnFilePreferences(wxCommandEvent& event); |
---|
[ce403f1] | 244 | void OnPrint(wxCommandEvent& event); |
---|
[4ed8154] | 245 | void PrintAndExit(); |
---|
[ce403f1] | 246 | void OnPageSetup(wxCommandEvent& event); |
---|
[1690fa9] | 247 | void OnPresNew(wxCommandEvent& event); |
---|
| 248 | void OnPresOpen(wxCommandEvent& event); |
---|
| 249 | void OnPresSave(wxCommandEvent& event); |
---|
| 250 | void OnPresSaveAs(wxCommandEvent& event); |
---|
| 251 | void OnPresMark(wxCommandEvent& event); |
---|
[128fac4] | 252 | void OnPresFRewind(wxCommandEvent& event); |
---|
| 253 | void OnPresRewind(wxCommandEvent& event); |
---|
| 254 | void OnPresReverse(wxCommandEvent& event); |
---|
| 255 | void OnPresPlay(wxCommandEvent& event); |
---|
| 256 | void OnPresFF(wxCommandEvent& event); |
---|
| 257 | void OnPresFFF(wxCommandEvent& event); |
---|
| 258 | void OnPresPause(wxCommandEvent& event); |
---|
| 259 | void OnPresStop(wxCommandEvent& event); |
---|
[6a4cdcb6] | 260 | void OnPresExportMovie(wxCommandEvent& event); |
---|
[223f1ad] | 261 | void OnExport(wxCommandEvent& event); |
---|
[549eb37] | 262 | void OnExtend(wxCommandEvent& event); |
---|
[5809313] | 263 | void OnQuit(wxCommandEvent& event); |
---|
[5ffa439] | 264 | |
---|
[573f4e9] | 265 | void OnAbout(wxCommandEvent& event); |
---|
[137bf99] | 266 | void OnClose(wxCloseEvent&); |
---|
| 267 | |
---|
[b4fe9fb] | 268 | void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
[4b1fc48] | 269 | |
---|
[26fac5a] | 270 | void OnKeyPress(wxKeyEvent &e) { |
---|
| 271 | if (m_Gfx) { |
---|
| 272 | m_Gfx->SetFocus(); |
---|
| 273 | m_Gfx->OnKeyPress(e); |
---|
| 274 | } |
---|
| 275 | } |
---|
| 276 | |
---|
[4b2d207] | 277 | void OnShowLogUpdate(wxUpdateUIEvent &ui) { |
---|
| 278 | ui.Enable(m_Log != NULL || (m_Splitter->GetWindow1() != m_Gfx && m_Splitter->GetWindow2() != m_Gfx)); |
---|
| 279 | ui.Check(m_Log == NULL); |
---|
| 280 | } |
---|
[ce403f1] | 281 | void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[223f1ad] | 282 | void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[373b738] | 283 | void OnExtendUpdate(wxUpdateUIEvent &ui) { |
---|
| 284 | ui.Enable(!IsExtendedElevation()); |
---|
| 285 | } |
---|
[223f1ad] | 286 | |
---|
[137bf99] | 287 | // temporary bodges until event handling problem is sorted out: |
---|
[5876fcb] | 288 | void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDefaultsUpdate(event); } |
---|
| 289 | void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnPlanUpdate(event); } |
---|
| 290 | void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnElevationUpdate(event); } |
---|
| 291 | void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDisplayOverlappingNamesUpdate(event); } |
---|
[46beda0] | 292 | void OnColourByUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByUpdate(event); } |
---|
[da6c802] | 293 | void OnColourByDepthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDepthUpdate(event); } |
---|
[d4650b3] | 294 | void OnColourByDateUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDateUpdate(event); } |
---|
[c61aa79] | 295 | void OnColourByErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByErrorUpdate(event); } |
---|
[fc43dda] | 296 | void OnColourByHErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByHErrorUpdate(event); } |
---|
| 297 | void OnColourByVErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByVErrorUpdate(event); } |
---|
[cc9e2c65] | 298 | void OnColourByGradientUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByGradientUpdate(event); } |
---|
[af50685] | 299 | void OnColourByLengthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByLengthUpdate(event); } |
---|
[68fb07a] | 300 | void OnColourBySurveyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourBySurveyUpdate(event); } |
---|
[5876fcb] | 301 | void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowCrossesUpdate(event); } |
---|
| 302 | void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowEntrancesUpdate(event); } |
---|
| 303 | void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowFixedPtsUpdate(event); } |
---|
| 304 | void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowExportedPtsUpdate(event); } |
---|
| 305 | void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowStationNamesUpdate(event); } |
---|
| 306 | void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurveyLegsUpdate(event); } |
---|
[9cb97b7] | 307 | void OnSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSplaysUpdate(event); } |
---|
[8666fc7] | 308 | void OnHideSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideSplaysUpdate(event); } |
---|
[b96edeb] | 309 | void OnShowSplaysDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysDashedUpdate(event); } |
---|
[8666fc7] | 310 | void OnShowSplaysFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysFadedUpdate(event); } |
---|
[b96edeb] | 311 | void OnShowSplaysNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysNormalUpdate(event); } |
---|
[e5c5f3c] | 312 | void OnDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDupesUpdate(event); } |
---|
| 313 | void OnHideDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideDupesUpdate(event); } |
---|
| 314 | void OnShowDupesDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesDashedUpdate(event); } |
---|
[b96edeb] | 315 | void OnShowDupesFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesFadedUpdate(event); } |
---|
| 316 | void OnShowDupesNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesNormalUpdate(event); } |
---|
[5876fcb] | 317 | void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurfaceUpdate(event); } |
---|
| 318 | void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveEastUpdate(event); } |
---|
| 319 | void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveNorthUpdate(event); } |
---|
| 320 | void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveSouthUpdate(event); } |
---|
| 321 | void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveWestUpdate(event); } |
---|
| 322 | void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleRotationUpdate(event); } |
---|
| 323 | void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseControlsUpdate(event); } |
---|
| 324 | void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleScalebarUpdate(event); } |
---|
[97ea48d] | 325 | void OnToggleColourKeyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleColourKeyUpdate(event); } |
---|
[5876fcb] | 326 | void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewCompassUpdate(event); } |
---|
| 327 | void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewGridUpdate(event); } |
---|
[f4c5932] | 328 | void OnViewBoundingBoxUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewBoundingBoxUpdate(event); } |
---|
[4938bcd] | 329 | void OnViewTerrainUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTerrainUpdate(event); } |
---|
[5876fcb] | 330 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewClinoUpdate(event); } |
---|
[6abab84] | 331 | void OnViewPerspectiveUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewPerspectiveUpdate(event); } |
---|
[d67450e] | 332 | void OnViewSmoothShadingUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothShadingUpdate(event); } |
---|
[a517825] | 333 | void OnViewTexturedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTexturedUpdate(event); } |
---|
[c60062d] | 334 | void OnViewFogUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFogUpdate(event); } |
---|
[db452ae] | 335 | void OnViewSmoothLinesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothLinesUpdate(event); } |
---|
[b13aee4] | 336 | void OnViewFullScreenUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFullScreenUpdate(event); } |
---|
[5876fcb] | 337 | void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseDirectionOfRotationUpdate(event); } |
---|
| 338 | void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnCancelDistLineUpdate(event); } |
---|
| 339 | void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnIndicatorsUpdate(event); } |
---|
| 340 | |
---|
[b4fe9fb] | 341 | void OnDefaults(wxCommandEvent&) { if (m_Control) m_Control->OnDefaults(); } |
---|
| 342 | void OnPlan(wxCommandEvent&) { if (m_Control) m_Control->OnPlan(); } |
---|
| 343 | void OnElevation(wxCommandEvent&) { if (m_Control) m_Control->OnElevation(); } |
---|
| 344 | void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Control) m_Control->OnDisplayOverlappingNames(); } |
---|
[da6c802] | 345 | void OnColourByDepth(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDepth(); } |
---|
[d4650b3] | 346 | void OnColourByDate(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDate(); } |
---|
[c61aa79] | 347 | void OnColourByError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByError(); } |
---|
[fc43dda] | 348 | void OnColourByHError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByHError(); } |
---|
| 349 | void OnColourByVError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByVError(); } |
---|
[cc9e2c65] | 350 | void OnColourByGradient(wxCommandEvent&) { if (m_Control) m_Control->OnColourByGradient(); } |
---|
[af50685] | 351 | void OnColourByLength(wxCommandEvent&) { if (m_Control) m_Control->OnColourByLength(); } |
---|
[68fb07a] | 352 | void OnColourBySurvey(wxCommandEvent&) { if (m_Control) m_Control->OnColourBySurvey(); } |
---|
[b4fe9fb] | 353 | void OnShowCrosses(wxCommandEvent&) { if (m_Control) m_Control->OnShowCrosses(); } |
---|
| 354 | void OnShowEntrances(wxCommandEvent&) { if (m_Control) m_Control->OnShowEntrances(); } |
---|
| 355 | void OnShowFixedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowFixedPts(); } |
---|
| 356 | void OnShowExportedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowExportedPts(); } |
---|
| 357 | void OnShowStationNames(wxCommandEvent&) { if (m_Control) m_Control->OnShowStationNames(); } |
---|
| 358 | void OnShowSurveyLegs(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurveyLegs(); } |
---|
[8666fc7] | 359 | void OnHideSplays(wxCommandEvent&) { if (m_Control) m_Control->OnHideSplays(); } |
---|
[b96edeb] | 360 | void OnShowSplaysDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysDashed(); } |
---|
[8666fc7] | 361 | void OnShowSplaysFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysFaded(); } |
---|
[b96edeb] | 362 | void OnShowSplaysNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysNormal(); } |
---|
[e5c5f3c] | 363 | void OnHideDupes(wxCommandEvent&) { if (m_Control) m_Control->OnHideDupes(); } |
---|
| 364 | void OnShowDupesDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesDashed(); } |
---|
[b96edeb] | 365 | void OnShowDupesFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesFaded(); } |
---|
| 366 | void OnShowDupesNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesNormal(); } |
---|
[b4fe9fb] | 367 | void OnShowSurface(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurface(); } |
---|
| 368 | void OnMoveEast(wxCommandEvent&) { if (m_Control) m_Control->OnMoveEast(); } |
---|
| 369 | void OnMoveNorth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveNorth(); } |
---|
| 370 | void OnMoveSouth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveSouth(); } |
---|
| 371 | void OnMoveWest(wxCommandEvent&) { if (m_Control) m_Control->OnMoveWest(); } |
---|
| 372 | void OnToggleRotation(wxCommandEvent&) { if (m_Control) m_Control->OnToggleRotation(); } |
---|
| 373 | void OnReverseControls(wxCommandEvent&) { if (m_Control) m_Control->OnReverseControls(); } |
---|
| 374 | void OnToggleScalebar(wxCommandEvent&) { if (m_Control) m_Control->OnToggleScalebar(); } |
---|
[97ea48d] | 375 | void OnToggleColourKey(wxCommandEvent&) { if (m_Control) m_Control->OnToggleColourKey(); } |
---|
[b4fe9fb] | 376 | void OnViewCompass(wxCommandEvent&) { if (m_Control) m_Control->OnViewCompass(); } |
---|
| 377 | void OnViewClino(wxCommandEvent&) { if (m_Control) m_Control->OnViewClino(); } |
---|
| 378 | void OnViewGrid(wxCommandEvent&) { if (m_Control) m_Control->OnViewGrid(); } |
---|
[f4c5932] | 379 | void OnViewBoundingBox(wxCommandEvent&) { if (m_Control) m_Control->OnViewBoundingBox(); } |
---|
[4938bcd] | 380 | void OnViewTerrain(wxCommandEvent&) { if (m_Control) m_Control->OnViewTerrain(); } |
---|
[6abab84] | 381 | void OnViewPerspective(wxCommandEvent&) { if (m_Control) m_Control->OnViewPerspective(); } |
---|
[d67450e] | 382 | void OnViewSmoothShading(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothShading(); } |
---|
[a517825] | 383 | void OnViewTextured(wxCommandEvent&) { if (m_Control) m_Control->OnViewTextured(); } |
---|
[c60062d] | 384 | void OnViewFog(wxCommandEvent&) { if (m_Control) m_Control->OnViewFog(); } |
---|
[db452ae] | 385 | void OnViewSmoothLines(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothLines(); } |
---|
[c60062d] | 386 | void OnViewFullScreen(wxCommandEvent&) { ViewFullScreen(); } |
---|
[fdfa926] | 387 | void ViewFullScreen(); |
---|
[b75a37d] | 388 | bool FullScreenModeShowingMenus() const; |
---|
| 389 | void FullScreenModeShowMenus(bool show); |
---|
[b4fe9fb] | 390 | void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Control) m_Control->OnReverseDirectionOfRotation(); } |
---|
| 391 | void OnCancelDistLine(wxCommandEvent&) { if (m_Control) m_Control->OnCancelDistLine(); } |
---|
[421b7d2] | 392 | |
---|
[5876fcb] | 393 | void OnToggleMetric(wxCommandEvent&) { if (m_Control) m_Control->OnToggleMetric(); } |
---|
| 394 | void OnToggleDegrees(wxCommandEvent&) { if (m_Control) m_Control->OnToggleDegrees(); } |
---|
[d171c0c] | 395 | void OnTogglePercent(wxCommandEvent&) { if (m_Control) m_Control->OnTogglePercent(); } |
---|
[33b2094] | 396 | void OnToggleTubes(wxCommandEvent&) { if (m_Control) m_Control->OnToggleTubes(); } |
---|
[5757725] | 397 | |
---|
[5876fcb] | 398 | void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleMetricUpdate(event); } |
---|
| 399 | void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleDegreesUpdate(event); } |
---|
[d171c0c] | 400 | void OnTogglePercentUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnTogglePercentUpdate(event); } |
---|
[33b2094] | 401 | void OnToggleTubesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleTubesUpdate(event); } |
---|
[5757725] | 402 | |
---|
[5876fcb] | 403 | // end of horrible bodges |
---|
[f433fda] | 404 | |
---|
[9059368] | 405 | void OnViewSidePanelUpdate(wxUpdateUIEvent& event); |
---|
| 406 | void OnViewSidePanel(wxCommandEvent& event); |
---|
[b1de3e0] | 407 | void ToggleSidePanel(); |
---|
[203d2a7] | 408 | bool ShowingSidePanel(); |
---|
[137bf99] | 409 | |
---|
[381ae6e] | 410 | void SelectTreeItem(const LabelInfo* label) { |
---|
[6264918] | 411 | if (label->tree_id.IsOk()) |
---|
| 412 | m_Tree->SelectItem(label->tree_id); |
---|
[381ae6e] | 413 | else |
---|
| 414 | m_Tree->UnselectAll(); |
---|
[6264918] | 415 | } |
---|
[381ae6e] | 416 | |
---|
[1fd2edb] | 417 | void ClearTreeSelection(); |
---|
| 418 | |
---|
[156dc16] | 419 | void ClearCoords(); |
---|
[d67450e] | 420 | void SetCoords(const Vector3 &v); |
---|
[0633bcc] | 421 | const LabelInfo * GetTreeSelection() const; |
---|
[381ae6e] | 422 | void SetCoords(Double x, Double y, const LabelInfo * there); |
---|
| 423 | void SetAltitude(Double z, const LabelInfo * there); |
---|
[156dc16] | 424 | |
---|
[381ae6e] | 425 | void ShowInfo(const LabelInfo *here = NULL, const LabelInfo *there = NULL); |
---|
| 426 | void DisplayTreeInfo(const wxTreeItemData* data = NULL); |
---|
[672459c] | 427 | void TreeItemSelected(const wxTreeItemData* data); |
---|
[1690fa9] | 428 | PresentationMark GetPresMark(int which); |
---|
[724cd64] | 429 | bool Animating() const { return m_Gfx && m_Gfx->Animating(); } |
---|
[8bac36d6] | 430 | |
---|
[d5fd4f4] | 431 | // Restrict to subsurvey `survey` (or show all if `survey` empty). |
---|
[86895ec] | 432 | void RestrictTo(const wxString & survey); |
---|
[5e0b9f9d] | 433 | |
---|
[d5fd4f4] | 434 | wxString GetSurvey() const { return m_Survey; } |
---|
| 435 | |
---|
[373b738] | 436 | int GetNumHighlightedPts() const { return m_NumHighlighted; } |
---|
| 437 | |
---|
[1a46879] | 438 | const SurveyFilter* GetTreeFilter() const { return m_Tree->GetFilter(); } |
---|
[672459c] | 439 | |
---|
| 440 | // Used when the tree filters change. FIXME: Overkill? |
---|
| 441 | void ForceFullRedraw() { |
---|
| 442 | m_Gfx->InvalidateAllLists(); |
---|
| 443 | m_Gfx->ForceRefresh(); |
---|
| 444 | } |
---|
| 445 | |
---|
[84cab34] | 446 | private: |
---|
| 447 | DECLARE_EVENT_TABLE() |
---|
[5809313] | 448 | }; |
---|
| 449 | |
---|
| 450 | #endif |
---|