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