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