[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__ |
---|
| 54 | // Currently on OS X, we force use of a generic toolbar, which needs to be put |
---|
| 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, |
---|
| 127 | menu_COLOUR_BY_GRADIENT, |
---|
| 128 | menu_COLOUR_BY_LENGTH, |
---|
[68fb07a] | 129 | menu_COLOUR_BY_SURVEY, |
---|
[7a36b67] | 130 | menu_IND_COMPASS, |
---|
| 131 | menu_IND_CLINO, |
---|
[97ea48d] | 132 | menu_IND_COLOUR_KEY, |
---|
[7a36b67] | 133 | menu_IND_SCALE_BAR, |
---|
| 134 | menu_CTL_INDICATORS, |
---|
| 135 | menu_CTL_SIDE_PANEL, |
---|
| 136 | menu_CTL_METRIC, |
---|
| 137 | menu_CTL_DEGREES, |
---|
[d171c0c] | 138 | menu_CTL_PERCENT, |
---|
[7a36b67] | 139 | menu_CTL_REVERSE, |
---|
| 140 | menu_CTL_CANCEL_DIST_LINE, |
---|
[5e0b9f9d] | 141 | menu_SURVEY_RESTRICT, |
---|
| 142 | menu_SURVEY_SHOW_ALL, |
---|
[672459c] | 143 | menu_SURVEY_HIDE, |
---|
| 144 | menu_SURVEY_SHOW, |
---|
| 145 | menu_SURVEY_HIDE_SIBLINGS, |
---|
[429465a] | 146 | textctrl_FIND, |
---|
[1690fa9] | 147 | button_HIDE, |
---|
| 148 | listctrl_PRES |
---|
[137bf99] | 149 | }; |
---|
| 150 | |
---|
[1c6b20d7] | 151 | class AvenPresList; |
---|
[fa42426] | 152 | |
---|
[373b738] | 153 | class MainFrm : public wxFrame, public Model { |
---|
| 154 | wxFileHistory m_history; |
---|
| 155 | int m_SashPosition; |
---|
| 156 | bool was_showing_sidepanel_before_fullscreen; |
---|
[137bf99] | 157 | GfxCore* m_Gfx; |
---|
[d7b53e3] | 158 | wxWindow* m_Log; |
---|
[5876fcb] | 159 | GUIControl* m_Control; |
---|
[156dc16] | 160 | wxSplitterWindow* m_Splitter; |
---|
| 161 | AvenTreeCtrl* m_Tree; |
---|
| 162 | wxTextCtrl* m_FindBox; |
---|
[f315fa7] | 163 | // wxCheckBox* m_RegexpCheckBox; |
---|
[203d2a7] | 164 | wxNotebook* m_Notebook; |
---|
[1c6b20d7] | 165 | AvenPresList* m_PresList; |
---|
[156dc16] | 166 | wxString m_File; |
---|
[549eb37] | 167 | // Processed version of data - same as m_File if m_File is processed data. |
---|
| 168 | wxString m_FileProcessed; |
---|
[5e0b9f9d] | 169 | wxString m_Survey; |
---|
[a6f081c] | 170 | |
---|
[7c29c976] | 171 | // Strings for status bar reporting of distances. |
---|
[0633bcc] | 172 | wxString here_text, coords_text, dist_text, distfree_text; |
---|
[7c29c976] | 173 | |
---|
[373b738] | 174 | int m_NumHighlighted = 0; |
---|
[bc60689] | 175 | bool pending_find; |
---|
| 176 | |
---|
[b75a37d] | 177 | bool fullscreen_showing_menus; |
---|
| 178 | |
---|
[bc60689] | 179 | #ifdef PREFDLG |
---|
| 180 | PrefsDlg* m_PrefsDlg; |
---|
| 181 | #endif |
---|
[eef68f9] | 182 | |
---|
[b88b171] | 183 | bool ProcessSVXFile(const wxString & file); |
---|
[c61aa79] | 184 | // void FixLRUD(traverse & centreline); |
---|
[137bf99] | 185 | |
---|
[9d3d8cc] | 186 | void CreateMenuBar(); |
---|
[242cb07] | 187 | void MakeToolBar(); |
---|
[9d3d8cc] | 188 | void CreateSidePanel(); |
---|
| 189 | |
---|
[7c29c976] | 190 | void UpdateStatusBar(); |
---|
| 191 | |
---|
[562ca6a] | 192 | #ifdef USING_GENERIC_TOOLBAR |
---|
| 193 | wxToolBar * GetToolBar() const { |
---|
| 194 | wxSizer * sizer = GetSizer(); |
---|
| 195 | if (!sizer) return NULL; |
---|
| 196 | return (wxToolBar*)sizer->GetItem(size_t(0))->GetWindow(); |
---|
| 197 | } |
---|
| 198 | #endif |
---|
| 199 | |
---|
[137bf99] | 200 | public: |
---|
| 201 | MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size); |
---|
[5809313] | 202 | |
---|
[d7b53e3] | 203 | // public for CavernLog. |
---|
| 204 | bool LoadData(const wxString& file, const wxString& prefix); |
---|
| 205 | void AddToFileHistory(const wxString & file); |
---|
| 206 | |
---|
[5e0b9f9d] | 207 | void InitialiseAfterLoad(const wxString & file, const wxString & prefix); |
---|
[d7b53e3] | 208 | void OnShowLog(wxCommandEvent& event); |
---|
[fb5887c] | 209 | |
---|
[732b9b0] | 210 | void OnMRUFile(wxCommandEvent& event); |
---|
[5f06d2c] | 211 | void OpenFile(const wxString& file, const wxString& survey = wxString()); |
---|
[1690fa9] | 212 | |
---|
| 213 | void OnPresNewUpdate(wxUpdateUIEvent& event); |
---|
| 214 | void OnPresOpenUpdate(wxUpdateUIEvent& event); |
---|
| 215 | void OnPresSaveUpdate(wxUpdateUIEvent& event); |
---|
| 216 | void OnPresSaveAsUpdate(wxUpdateUIEvent& event); |
---|
| 217 | void OnPresMarkUpdate(wxUpdateUIEvent& event); |
---|
[128fac4] | 218 | void OnPresFRewindUpdate(wxUpdateUIEvent& event); |
---|
| 219 | void OnPresRewindUpdate(wxUpdateUIEvent& event); |
---|
| 220 | void OnPresReverseUpdate(wxUpdateUIEvent& event); |
---|
| 221 | void OnPresPlayUpdate(wxUpdateUIEvent& event); |
---|
| 222 | void OnPresFFUpdate(wxUpdateUIEvent& event); |
---|
| 223 | void OnPresFFFUpdate(wxUpdateUIEvent& event); |
---|
| 224 | void OnPresPauseUpdate(wxUpdateUIEvent& event); |
---|
| 225 | void OnPresStopUpdate(wxUpdateUIEvent& event); |
---|
[6a4cdcb6] | 226 | void OnPresExportMovieUpdate(wxUpdateUIEvent& event); |
---|
[622460e] | 227 | void OnOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
[137bf99] | 228 | |
---|
[bc60689] | 229 | void DoFind(); |
---|
[2a02de2] | 230 | void OnFind(wxCommandEvent& event); |
---|
[bc60689] | 231 | void OnIdle(wxIdleEvent& event); |
---|
[d1628e8e] | 232 | void OnGotoFound(wxCommandEvent& event); |
---|
[2a02de2] | 233 | void OnHide(wxCommandEvent& event); |
---|
[429465a] | 234 | void OnHideUpdate(wxUpdateUIEvent& ui); |
---|
[2a02de2] | 235 | |
---|
[5809313] | 236 | void OnOpen(wxCommandEvent& event); |
---|
[622460e] | 237 | void OnOpenTerrain(wxCommandEvent&); |
---|
[d7b53e3] | 238 | void HideLog(wxWindow * log_window); |
---|
[045e2af] | 239 | void OnScreenshot(wxCommandEvent& event); |
---|
| 240 | void OnScreenshotUpdate(wxUpdateUIEvent& event); |
---|
[02c7c1a] | 241 | void OnFilePreferences(wxCommandEvent& event); |
---|
[ce403f1] | 242 | void OnPrint(wxCommandEvent& event); |
---|
[4ed8154] | 243 | void PrintAndExit(); |
---|
[ce403f1] | 244 | void OnPageSetup(wxCommandEvent& event); |
---|
[1690fa9] | 245 | void OnPresNew(wxCommandEvent& event); |
---|
| 246 | void OnPresOpen(wxCommandEvent& event); |
---|
| 247 | void OnPresSave(wxCommandEvent& event); |
---|
| 248 | void OnPresSaveAs(wxCommandEvent& event); |
---|
| 249 | void OnPresMark(wxCommandEvent& event); |
---|
[128fac4] | 250 | void OnPresFRewind(wxCommandEvent& event); |
---|
| 251 | void OnPresRewind(wxCommandEvent& event); |
---|
| 252 | void OnPresReverse(wxCommandEvent& event); |
---|
| 253 | void OnPresPlay(wxCommandEvent& event); |
---|
| 254 | void OnPresFF(wxCommandEvent& event); |
---|
| 255 | void OnPresFFF(wxCommandEvent& event); |
---|
| 256 | void OnPresPause(wxCommandEvent& event); |
---|
| 257 | void OnPresStop(wxCommandEvent& event); |
---|
[6a4cdcb6] | 258 | void OnPresExportMovie(wxCommandEvent& event); |
---|
[223f1ad] | 259 | void OnExport(wxCommandEvent& event); |
---|
[549eb37] | 260 | void OnExtend(wxCommandEvent& event); |
---|
[5809313] | 261 | void OnQuit(wxCommandEvent& event); |
---|
[5ffa439] | 262 | |
---|
[573f4e9] | 263 | void OnAbout(wxCommandEvent& event); |
---|
[137bf99] | 264 | void OnClose(wxCloseEvent&); |
---|
| 265 | |
---|
[b4fe9fb] | 266 | void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
[4b1fc48] | 267 | |
---|
[26fac5a] | 268 | void OnKeyPress(wxKeyEvent &e) { |
---|
| 269 | if (m_Gfx) { |
---|
| 270 | m_Gfx->SetFocus(); |
---|
| 271 | m_Gfx->OnKeyPress(e); |
---|
| 272 | } |
---|
| 273 | } |
---|
| 274 | |
---|
[4b2d207] | 275 | void OnShowLogUpdate(wxUpdateUIEvent &ui) { |
---|
| 276 | ui.Enable(m_Log != NULL || (m_Splitter->GetWindow1() != m_Gfx && m_Splitter->GetWindow2() != m_Gfx)); |
---|
| 277 | ui.Check(m_Log == NULL); |
---|
| 278 | } |
---|
[ce403f1] | 279 | void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[223f1ad] | 280 | void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
[373b738] | 281 | void OnExtendUpdate(wxUpdateUIEvent &ui) { |
---|
| 282 | ui.Enable(!IsExtendedElevation()); |
---|
| 283 | } |
---|
[223f1ad] | 284 | |
---|
[137bf99] | 285 | // temporary bodges until event handling problem is sorted out: |
---|
[5876fcb] | 286 | void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDefaultsUpdate(event); } |
---|
| 287 | void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnPlanUpdate(event); } |
---|
| 288 | void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnElevationUpdate(event); } |
---|
| 289 | void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDisplayOverlappingNamesUpdate(event); } |
---|
[46beda0] | 290 | void OnColourByUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByUpdate(event); } |
---|
[da6c802] | 291 | void OnColourByDepthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDepthUpdate(event); } |
---|
[d4650b3] | 292 | void OnColourByDateUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDateUpdate(event); } |
---|
[c61aa79] | 293 | void OnColourByErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByErrorUpdate(event); } |
---|
[cc9e2c65] | 294 | void OnColourByGradientUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByGradientUpdate(event); } |
---|
[af50685] | 295 | void OnColourByLengthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByLengthUpdate(event); } |
---|
[68fb07a] | 296 | void OnColourBySurveyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourBySurveyUpdate(event); } |
---|
[5876fcb] | 297 | void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowCrossesUpdate(event); } |
---|
| 298 | void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowEntrancesUpdate(event); } |
---|
| 299 | void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowFixedPtsUpdate(event); } |
---|
| 300 | void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowExportedPtsUpdate(event); } |
---|
| 301 | void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowStationNamesUpdate(event); } |
---|
| 302 | void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurveyLegsUpdate(event); } |
---|
[9cb97b7] | 303 | void OnSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSplaysUpdate(event); } |
---|
[8666fc7] | 304 | void OnHideSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideSplaysUpdate(event); } |
---|
[b96edeb] | 305 | void OnShowSplaysDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysDashedUpdate(event); } |
---|
[8666fc7] | 306 | void OnShowSplaysFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysFadedUpdate(event); } |
---|
[b96edeb] | 307 | void OnShowSplaysNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysNormalUpdate(event); } |
---|
[e5c5f3c] | 308 | void OnDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDupesUpdate(event); } |
---|
| 309 | void OnHideDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideDupesUpdate(event); } |
---|
| 310 | void OnShowDupesDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesDashedUpdate(event); } |
---|
[b96edeb] | 311 | void OnShowDupesFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesFadedUpdate(event); } |
---|
| 312 | void OnShowDupesNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesNormalUpdate(event); } |
---|
[5876fcb] | 313 | void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurfaceUpdate(event); } |
---|
| 314 | void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveEastUpdate(event); } |
---|
| 315 | void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveNorthUpdate(event); } |
---|
| 316 | void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveSouthUpdate(event); } |
---|
| 317 | void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveWestUpdate(event); } |
---|
| 318 | void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleRotationUpdate(event); } |
---|
| 319 | void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseControlsUpdate(event); } |
---|
| 320 | void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleScalebarUpdate(event); } |
---|
[97ea48d] | 321 | void OnToggleColourKeyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleColourKeyUpdate(event); } |
---|
[5876fcb] | 322 | void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewCompassUpdate(event); } |
---|
| 323 | void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewGridUpdate(event); } |
---|
[f4c5932] | 324 | void OnViewBoundingBoxUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewBoundingBoxUpdate(event); } |
---|
[4938bcd] | 325 | void OnViewTerrainUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTerrainUpdate(event); } |
---|
[5876fcb] | 326 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewClinoUpdate(event); } |
---|
[6abab84] | 327 | void OnViewPerspectiveUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewPerspectiveUpdate(event); } |
---|
[d67450e] | 328 | void OnViewSmoothShadingUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothShadingUpdate(event); } |
---|
[a517825] | 329 | void OnViewTexturedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTexturedUpdate(event); } |
---|
[c60062d] | 330 | void OnViewFogUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFogUpdate(event); } |
---|
[db452ae] | 331 | void OnViewSmoothLinesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothLinesUpdate(event); } |
---|
[b13aee4] | 332 | void OnViewFullScreenUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFullScreenUpdate(event); } |
---|
[5876fcb] | 333 | void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseDirectionOfRotationUpdate(event); } |
---|
| 334 | void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnCancelDistLineUpdate(event); } |
---|
| 335 | void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnIndicatorsUpdate(event); } |
---|
| 336 | |
---|
[b4fe9fb] | 337 | void OnDefaults(wxCommandEvent&) { if (m_Control) m_Control->OnDefaults(); } |
---|
| 338 | void OnPlan(wxCommandEvent&) { if (m_Control) m_Control->OnPlan(); } |
---|
| 339 | void OnElevation(wxCommandEvent&) { if (m_Control) m_Control->OnElevation(); } |
---|
| 340 | void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Control) m_Control->OnDisplayOverlappingNames(); } |
---|
[da6c802] | 341 | void OnColourByDepth(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDepth(); } |
---|
[d4650b3] | 342 | void OnColourByDate(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDate(); } |
---|
[c61aa79] | 343 | void OnColourByError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByError(); } |
---|
[cc9e2c65] | 344 | void OnColourByGradient(wxCommandEvent&) { if (m_Control) m_Control->OnColourByGradient(); } |
---|
[af50685] | 345 | void OnColourByLength(wxCommandEvent&) { if (m_Control) m_Control->OnColourByLength(); } |
---|
[68fb07a] | 346 | void OnColourBySurvey(wxCommandEvent&) { if (m_Control) m_Control->OnColourBySurvey(); } |
---|
[b4fe9fb] | 347 | void OnShowCrosses(wxCommandEvent&) { if (m_Control) m_Control->OnShowCrosses(); } |
---|
| 348 | void OnShowEntrances(wxCommandEvent&) { if (m_Control) m_Control->OnShowEntrances(); } |
---|
| 349 | void OnShowFixedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowFixedPts(); } |
---|
| 350 | void OnShowExportedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowExportedPts(); } |
---|
| 351 | void OnShowStationNames(wxCommandEvent&) { if (m_Control) m_Control->OnShowStationNames(); } |
---|
| 352 | void OnShowSurveyLegs(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurveyLegs(); } |
---|
[8666fc7] | 353 | void OnHideSplays(wxCommandEvent&) { if (m_Control) m_Control->OnHideSplays(); } |
---|
[b96edeb] | 354 | void OnShowSplaysDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysDashed(); } |
---|
[8666fc7] | 355 | void OnShowSplaysFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysFaded(); } |
---|
[b96edeb] | 356 | void OnShowSplaysNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysNormal(); } |
---|
[e5c5f3c] | 357 | void OnHideDupes(wxCommandEvent&) { if (m_Control) m_Control->OnHideDupes(); } |
---|
| 358 | void OnShowDupesDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesDashed(); } |
---|
[b96edeb] | 359 | void OnShowDupesFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesFaded(); } |
---|
| 360 | void OnShowDupesNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesNormal(); } |
---|
[b4fe9fb] | 361 | void OnShowSurface(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurface(); } |
---|
| 362 | void OnMoveEast(wxCommandEvent&) { if (m_Control) m_Control->OnMoveEast(); } |
---|
| 363 | void OnMoveNorth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveNorth(); } |
---|
| 364 | void OnMoveSouth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveSouth(); } |
---|
| 365 | void OnMoveWest(wxCommandEvent&) { if (m_Control) m_Control->OnMoveWest(); } |
---|
| 366 | void OnToggleRotation(wxCommandEvent&) { if (m_Control) m_Control->OnToggleRotation(); } |
---|
| 367 | void OnReverseControls(wxCommandEvent&) { if (m_Control) m_Control->OnReverseControls(); } |
---|
| 368 | void OnToggleScalebar(wxCommandEvent&) { if (m_Control) m_Control->OnToggleScalebar(); } |
---|
[97ea48d] | 369 | void OnToggleColourKey(wxCommandEvent&) { if (m_Control) m_Control->OnToggleColourKey(); } |
---|
[b4fe9fb] | 370 | void OnViewCompass(wxCommandEvent&) { if (m_Control) m_Control->OnViewCompass(); } |
---|
| 371 | void OnViewClino(wxCommandEvent&) { if (m_Control) m_Control->OnViewClino(); } |
---|
| 372 | void OnViewGrid(wxCommandEvent&) { if (m_Control) m_Control->OnViewGrid(); } |
---|
[f4c5932] | 373 | void OnViewBoundingBox(wxCommandEvent&) { if (m_Control) m_Control->OnViewBoundingBox(); } |
---|
[4938bcd] | 374 | void OnViewTerrain(wxCommandEvent&) { if (m_Control) m_Control->OnViewTerrain(); } |
---|
[6abab84] | 375 | void OnViewPerspective(wxCommandEvent&) { if (m_Control) m_Control->OnViewPerspective(); } |
---|
[d67450e] | 376 | void OnViewSmoothShading(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothShading(); } |
---|
[a517825] | 377 | void OnViewTextured(wxCommandEvent&) { if (m_Control) m_Control->OnViewTextured(); } |
---|
[c60062d] | 378 | void OnViewFog(wxCommandEvent&) { if (m_Control) m_Control->OnViewFog(); } |
---|
[db452ae] | 379 | void OnViewSmoothLines(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothLines(); } |
---|
[c60062d] | 380 | void OnViewFullScreen(wxCommandEvent&) { ViewFullScreen(); } |
---|
[fdfa926] | 381 | void ViewFullScreen(); |
---|
[b75a37d] | 382 | bool FullScreenModeShowingMenus() const; |
---|
| 383 | void FullScreenModeShowMenus(bool show); |
---|
[b4fe9fb] | 384 | void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Control) m_Control->OnReverseDirectionOfRotation(); } |
---|
| 385 | void OnCancelDistLine(wxCommandEvent&) { if (m_Control) m_Control->OnCancelDistLine(); } |
---|
[421b7d2] | 386 | |
---|
[5876fcb] | 387 | void OnToggleMetric(wxCommandEvent&) { if (m_Control) m_Control->OnToggleMetric(); } |
---|
| 388 | void OnToggleDegrees(wxCommandEvent&) { if (m_Control) m_Control->OnToggleDegrees(); } |
---|
[d171c0c] | 389 | void OnTogglePercent(wxCommandEvent&) { if (m_Control) m_Control->OnTogglePercent(); } |
---|
[33b2094] | 390 | void OnToggleTubes(wxCommandEvent&) { if (m_Control) m_Control->OnToggleTubes(); } |
---|
[5757725] | 391 | |
---|
[5876fcb] | 392 | void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleMetricUpdate(event); } |
---|
| 393 | void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleDegreesUpdate(event); } |
---|
[d171c0c] | 394 | void OnTogglePercentUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnTogglePercentUpdate(event); } |
---|
[33b2094] | 395 | void OnToggleTubesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleTubesUpdate(event); } |
---|
[5757725] | 396 | |
---|
[5876fcb] | 397 | // end of horrible bodges |
---|
[f433fda] | 398 | |
---|
[9059368] | 399 | void OnViewSidePanelUpdate(wxUpdateUIEvent& event); |
---|
| 400 | void OnViewSidePanel(wxCommandEvent& event); |
---|
[b1de3e0] | 401 | void ToggleSidePanel(); |
---|
[203d2a7] | 402 | bool ShowingSidePanel(); |
---|
[137bf99] | 403 | |
---|
[381ae6e] | 404 | void SelectTreeItem(const LabelInfo* label) { |
---|
[6264918] | 405 | if (label->tree_id.IsOk()) |
---|
| 406 | m_Tree->SelectItem(label->tree_id); |
---|
[381ae6e] | 407 | else |
---|
| 408 | m_Tree->UnselectAll(); |
---|
[6264918] | 409 | } |
---|
[381ae6e] | 410 | |
---|
[1fd2edb] | 411 | void ClearTreeSelection(); |
---|
| 412 | |
---|
[156dc16] | 413 | void ClearCoords(); |
---|
[d67450e] | 414 | void SetCoords(const Vector3 &v); |
---|
[0633bcc] | 415 | const LabelInfo * GetTreeSelection() const; |
---|
[381ae6e] | 416 | void SetCoords(Double x, Double y, const LabelInfo * there); |
---|
| 417 | void SetAltitude(Double z, const LabelInfo * there); |
---|
[156dc16] | 418 | |
---|
[381ae6e] | 419 | void ShowInfo(const LabelInfo *here = NULL, const LabelInfo *there = NULL); |
---|
| 420 | void DisplayTreeInfo(const wxTreeItemData* data = NULL); |
---|
[672459c] | 421 | void TreeItemSelected(const wxTreeItemData* data); |
---|
[1690fa9] | 422 | PresentationMark GetPresMark(int which); |
---|
[724cd64] | 423 | bool Animating() const { return m_Gfx && m_Gfx->Animating(); } |
---|
[8bac36d6] | 424 | |
---|
[d5fd4f4] | 425 | // Restrict to subsurvey `survey` (or show all if `survey` empty). |
---|
[86895ec] | 426 | void RestrictTo(const wxString & survey); |
---|
[5e0b9f9d] | 427 | |
---|
[d5fd4f4] | 428 | wxString GetSurvey() const { return m_Survey; } |
---|
| 429 | |
---|
[373b738] | 430 | int GetNumHighlightedPts() const { return m_NumHighlighted; } |
---|
| 431 | |
---|
[1a46879] | 432 | const SurveyFilter* GetTreeFilter() const { return m_Tree->GetFilter(); } |
---|
[672459c] | 433 | |
---|
| 434 | // Used when the tree filters change. FIXME: Overkill? |
---|
| 435 | void ForceFullRedraw() { |
---|
| 436 | m_Gfx->InvalidateAllLists(); |
---|
| 437 | m_Gfx->ForceRefresh(); |
---|
| 438 | } |
---|
| 439 | |
---|
[84cab34] | 440 | private: |
---|
| 441 | DECLARE_EVENT_TABLE() |
---|
[5809313] | 442 | }; |
---|
| 443 | |
---|
| 444 | #endif |
---|