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