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