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