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