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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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.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_OPEN = 1000, |
---|
57 | menu_FILE_PRINT, |
---|
58 | menu_FILE_PAGE_SETUP, |
---|
59 | menu_FILE_SCREENSHOT, |
---|
60 | menu_FILE_EXPORT, |
---|
61 | menu_FILE_QUIT, |
---|
62 | menu_PRES_NEW, |
---|
63 | menu_PRES_OPEN, |
---|
64 | menu_PRES_SAVE, |
---|
65 | menu_PRES_SAVE_AS, |
---|
66 | menu_PRES_MARK, |
---|
67 | menu_PRES_EXPORT_MOVIE, |
---|
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, |
---|
76 | menu_ROTATION_START, |
---|
77 | menu_ROTATION_STOP, |
---|
78 | menu_ROTATION_TOGGLE, |
---|
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, |
---|
104 | menu_VIEW_SHOW_ENTRANCES, |
---|
105 | menu_VIEW_SHOW_FIXED_PTS, |
---|
106 | menu_VIEW_SHOW_EXPORTED_PTS, |
---|
107 | menu_VIEW_STATUS_BAR, |
---|
108 | menu_VIEW_GRID, |
---|
109 | menu_VIEW_BOUNDING_BOX, |
---|
110 | menu_VIEW_SHOW_TUBES, |
---|
111 | menu_VIEW_PERSPECTIVE, |
---|
112 | menu_VIEW_SMOOTH_SHADING, |
---|
113 | menu_VIEW_TEXTURED, |
---|
114 | menu_VIEW_FOG, |
---|
115 | menu_VIEW_SMOOTH_LINES, |
---|
116 | menu_VIEW_FULLSCREEN, |
---|
117 | menu_VIEW_PREFERENCES, |
---|
118 | menu_VIEW_COLOUR_BY_DEPTH, |
---|
119 | menu_VIEW_COLOUR_BY_DATE, |
---|
120 | menu_VIEW_COLOUR_BY_ERROR, |
---|
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, |
---|
131 | menu_HELP_ABOUT, |
---|
132 | textctrl_FIND, |
---|
133 | button_FIND, |
---|
134 | button_HIDE, |
---|
135 | listctrl_PRES |
---|
136 | }; |
---|
137 | |
---|
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 { |
---|
150 | friend class MainFrm; |
---|
151 | Double l, r, u, d; |
---|
152 | |
---|
153 | public: |
---|
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_) { } |
---|
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 | |
---|
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; |
---|
172 | class AvenPresList; |
---|
173 | |
---|
174 | class LabelInfo : public Point { |
---|
175 | wxString text; |
---|
176 | unsigned width; |
---|
177 | int flags; |
---|
178 | |
---|
179 | public: |
---|
180 | wxTreeItemId tree_id; |
---|
181 | |
---|
182 | LabelInfo(const img_point &pt, const wxString &text_, int flags_) |
---|
183 | : Point(pt), text(text_), flags(flags_) { } |
---|
184 | const wxString & GetText() const { return text; } |
---|
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_; } |
---|
190 | |
---|
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; } |
---|
197 | }; |
---|
198 | |
---|
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 | |
---|
208 | class MainFrm : public wxFrame { |
---|
209 | wxFileHistory m_history; |
---|
210 | int m_SashPosition; |
---|
211 | list<traverse> traverses; |
---|
212 | list<traverse> surface_traverses; |
---|
213 | list<vector<XSect> > tubes; |
---|
214 | list<LabelInfo*> m_Labels; |
---|
215 | Vector3 m_Ext; |
---|
216 | Double m_DepthMin, m_DepthExt; |
---|
217 | time_t m_DateMin, m_DateExt; |
---|
218 | bool complete_dateinfo; |
---|
219 | GfxCore* m_Gfx; |
---|
220 | GUIControl* m_Control; |
---|
221 | int m_NumEntrances; |
---|
222 | int m_NumFixedPts; |
---|
223 | int m_NumExportedPts; |
---|
224 | int m_NumHighlighted; |
---|
225 | bool m_HasUndergroundLegs; |
---|
226 | bool m_HasSurfaceLegs; |
---|
227 | bool m_HasErrorInformation; |
---|
228 | wxSplitterWindow* m_Splitter; |
---|
229 | AvenTreeCtrl* m_Tree; |
---|
230 | wxTextCtrl* m_FindBox; |
---|
231 | // wxCheckBox* m_RegexpCheckBox; |
---|
232 | wxNotebook* m_Notebook; |
---|
233 | AvenPresList* m_PresList; |
---|
234 | wxString m_File; |
---|
235 | wxString m_Title, m_DateStamp; |
---|
236 | int separator; // character separating survey levels (often '.') |
---|
237 | #ifdef PREFDLG |
---|
238 | PrefsDlg* m_PrefsDlg; |
---|
239 | #endif |
---|
240 | |
---|
241 | Vector3 m_Offsets; |
---|
242 | |
---|
243 | wxString icon_path; |
---|
244 | |
---|
245 | // Strings for status bar reporting of distances. |
---|
246 | wxString here_text, coords_text, dist_text, distfree_text; |
---|
247 | |
---|
248 | bool m_IsExtendedElevation; |
---|
249 | |
---|
250 | void FillTree(); |
---|
251 | bool ProcessSVXFile(const wxString & file); |
---|
252 | bool LoadData(const wxString& file, wxString prefix = wxString()); |
---|
253 | // void FixLRUD(traverse & centreline); |
---|
254 | void CentreDataset(const Vector3 & vmin); |
---|
255 | |
---|
256 | wxString GetTabMsg(int key) { |
---|
257 | wxString x(wmsg(key)); x.Replace(wxT("##"), wxT("\t")); x.Replace(wxT("@"), wxT("&")); return x; |
---|
258 | } |
---|
259 | |
---|
260 | void CreateMenuBar(); |
---|
261 | void CreateToolBar(); |
---|
262 | void CreateSidePanel(); |
---|
263 | |
---|
264 | void UpdateStatusBar(); |
---|
265 | |
---|
266 | public: |
---|
267 | MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size); |
---|
268 | ~MainFrm(); |
---|
269 | |
---|
270 | void OnMRUFile(wxCommandEvent& event); |
---|
271 | void OpenFile(const wxString& file, wxString survey = wxString()); |
---|
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); |
---|
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); |
---|
286 | void OnPresExportMovieUpdate(wxUpdateUIEvent& event); |
---|
287 | //void OnFileOpenTerrainUpdate(wxUpdateUIEvent& event); |
---|
288 | |
---|
289 | void OnFind(wxCommandEvent& event); |
---|
290 | void OnGotoFound(wxCommandEvent& event); |
---|
291 | void OnHide(wxCommandEvent& event); |
---|
292 | void OnHideUpdate(wxUpdateUIEvent& ui); |
---|
293 | |
---|
294 | void OnOpen(wxCommandEvent& event); |
---|
295 | void OnScreenshot(wxCommandEvent& event); |
---|
296 | void OnScreenshotUpdate(wxUpdateUIEvent& event); |
---|
297 | void OnFilePreferences(wxCommandEvent& event); |
---|
298 | void OnFileOpenTerrain(wxCommandEvent& event); |
---|
299 | void OnPrint(wxCommandEvent& event); |
---|
300 | void OnPageSetup(wxCommandEvent& event); |
---|
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); |
---|
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); |
---|
314 | void OnPresExportMovie(wxCommandEvent& event); |
---|
315 | void OnExport(wxCommandEvent& event); |
---|
316 | void OnQuit(wxCommandEvent& event); |
---|
317 | |
---|
318 | void OnAbout(wxCommandEvent& event); |
---|
319 | void OnClose(wxCloseEvent&); |
---|
320 | |
---|
321 | void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); } |
---|
322 | |
---|
323 | void OnKeyPress(wxKeyEvent &e) { |
---|
324 | if (m_Gfx) { |
---|
325 | m_Gfx->SetFocus(); |
---|
326 | m_Gfx->OnKeyPress(e); |
---|
327 | } |
---|
328 | } |
---|
329 | |
---|
330 | void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
331 | void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); } |
---|
332 | |
---|
333 | // temporary bodges until event handling problem is sorted out: |
---|
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); } |
---|
338 | void OnColourByDepthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDepthUpdate(event); } |
---|
339 | void OnColourByDateUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDateUpdate(event); } |
---|
340 | void OnColourByErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByErrorUpdate(event); } |
---|
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); } |
---|
370 | void OnViewBoundingBoxUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewBoundingBoxUpdate(event); } |
---|
371 | void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewClinoUpdate(event); } |
---|
372 | void OnViewPerspectiveUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewPerspectiveUpdate(event); } |
---|
373 | void OnViewSmoothShadingUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothShadingUpdate(event); } |
---|
374 | void OnViewTexturedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTexturedUpdate(event); } |
---|
375 | void OnViewFogUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFogUpdate(event); } |
---|
376 | void OnViewSmoothLinesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothLinesUpdate(event); } |
---|
377 | void OnViewFullScreenUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFullScreenUpdate(event); } |
---|
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 | |
---|
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(); } |
---|
386 | void OnColourByDepth(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDepth(); } |
---|
387 | void OnColourByDate(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDate(); } |
---|
388 | void OnColourByError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByError(); } |
---|
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(); } |
---|
419 | void OnViewBoundingBox(wxCommandEvent&) { if (m_Control) m_Control->OnViewBoundingBox(); } |
---|
420 | void OnViewPerspective(wxCommandEvent&) { if (m_Control) m_Control->OnViewPerspective(); } |
---|
421 | void OnViewSmoothShading(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothShading(); } |
---|
422 | void OnViewTextured(wxCommandEvent&) { if (m_Control) m_Control->OnViewTextured(); } |
---|
423 | void OnViewFog(wxCommandEvent&) { if (m_Control) m_Control->OnViewFog(); } |
---|
424 | void OnViewSmoothLines(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothLines(); } |
---|
425 | void OnViewFullScreen(wxCommandEvent&) { ViewFullScreen(); } |
---|
426 | void ViewFullScreen(); |
---|
427 | void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Control) m_Control->OnReverseDirectionOfRotation(); } |
---|
428 | void OnCancelDistLine(wxCommandEvent&) { if (m_Control) m_Control->OnCancelDistLine(); } |
---|
429 | |
---|
430 | void OnToggleMetric(wxCommandEvent&) { if (m_Control) m_Control->OnToggleMetric(); } |
---|
431 | void OnToggleDegrees(wxCommandEvent&) { if (m_Control) m_Control->OnToggleDegrees(); } |
---|
432 | void OnToggleTubes(wxCommandEvent&) { if (m_Control) m_Control->OnToggleTubes(); } |
---|
433 | |
---|
434 | void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleMetricUpdate(event); } |
---|
435 | void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleDegreesUpdate(event); } |
---|
436 | void OnToggleTubesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleTubesUpdate(event); } |
---|
437 | |
---|
438 | // end of horrible bodges |
---|
439 | |
---|
440 | void OnViewSidePanelUpdate(wxUpdateUIEvent& event); |
---|
441 | void OnViewSidePanel(wxCommandEvent& event); |
---|
442 | void ToggleSidePanel(); |
---|
443 | bool ShowingSidePanel(); |
---|
444 | |
---|
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(); } |
---|
449 | |
---|
450 | Double GetDepthExtent() const { return m_DepthExt; } |
---|
451 | Double GetDepthMin() const { return m_DepthMin; } |
---|
452 | |
---|
453 | bool HasCompleteDateInfo() const { return complete_dateinfo; } |
---|
454 | time_t GetDateExtent() const { return m_DateExt; } |
---|
455 | time_t GetDateMin() const { return m_DateMin; } |
---|
456 | |
---|
457 | void SelectTreeItem(LabelInfo* label); |
---|
458 | void ClearTreeSelection(); |
---|
459 | |
---|
460 | int GetNumFixedPts() const { return m_NumFixedPts; } |
---|
461 | int GetNumExportedPts() const { return m_NumExportedPts; } |
---|
462 | int GetNumEntrances() const { return m_NumEntrances; } |
---|
463 | int GetNumHighlightedPts() const { return m_NumHighlighted; } |
---|
464 | |
---|
465 | bool HasUndergroundLegs() const { return m_HasUndergroundLegs; } |
---|
466 | bool HasSurfaceLegs() const { return m_HasSurfaceLegs; } |
---|
467 | bool HasTubes() const { return !tubes.empty(); } |
---|
468 | bool HasErrorInformation() const { return m_HasErrorInformation; } |
---|
469 | |
---|
470 | bool IsExtendedElevation() const { return m_IsExtendedElevation; } |
---|
471 | |
---|
472 | void ClearCoords(); |
---|
473 | void SetCoords(const Vector3 &v); |
---|
474 | const LabelInfo * GetTreeSelection() const; |
---|
475 | void SetCoords(Double x, Double y); |
---|
476 | void SetAltitude(Double z); |
---|
477 | |
---|
478 | const Vector3 & GetOffset() const { return m_Offsets; } |
---|
479 | |
---|
480 | list<traverse>::const_iterator traverses_begin() const { |
---|
481 | return traverses.begin(); |
---|
482 | } |
---|
483 | |
---|
484 | list<traverse>::const_iterator traverses_end() const { |
---|
485 | return traverses.end(); |
---|
486 | } |
---|
487 | |
---|
488 | list<traverse>::const_iterator surface_traverses_begin() const { |
---|
489 | return surface_traverses.begin(); |
---|
490 | } |
---|
491 | |
---|
492 | list<traverse>::const_iterator surface_traverses_end() const { |
---|
493 | return surface_traverses.end(); |
---|
494 | } |
---|
495 | |
---|
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 | |
---|
504 | list<LabelInfo*>::const_iterator GetLabels() const { |
---|
505 | return m_Labels.begin(); |
---|
506 | } |
---|
507 | |
---|
508 | list<LabelInfo*>::const_iterator GetLabelsEnd() const { |
---|
509 | return m_Labels.end(); |
---|
510 | } |
---|
511 | |
---|
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 | |
---|
520 | list<LabelInfo*>::iterator GetLabelsNC() { |
---|
521 | return m_Labels.begin(); |
---|
522 | } |
---|
523 | |
---|
524 | list<LabelInfo*>::iterator GetLabelsNCEnd() { |
---|
525 | return m_Labels.end(); |
---|
526 | } |
---|
527 | |
---|
528 | void ShowInfo(const LabelInfo *label); |
---|
529 | void DisplayTreeInfo(const wxTreeItemData* data); |
---|
530 | void TreeItemSelected(const wxTreeItemData* data, bool zoom); |
---|
531 | PresentationMark GetPresMark(int which); |
---|
532 | |
---|
533 | private: |
---|
534 | DECLARE_EVENT_TABLE() |
---|
535 | }; |
---|
536 | |
---|
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 |
---|
541 | MainFrm * mainfrm; |
---|
542 | public: |
---|
543 | AvenAllowOnTop(MainFrm * mainfrm_) { |
---|
544 | if (mainfrm_ && mainfrm_->IsFullScreen()) { |
---|
545 | mainfrm = mainfrm_; |
---|
546 | mainfrm->ViewFullScreen(); |
---|
547 | } else { |
---|
548 | mainfrm = 0; |
---|
549 | } |
---|
550 | } |
---|
551 | ~AvenAllowOnTop() { |
---|
552 | if (mainfrm) mainfrm->ViewFullScreen(); |
---|
553 | } |
---|
554 | #else |
---|
555 | public: |
---|
556 | AvenAllowOnTop(MainFrm *) { } |
---|
557 | #endif |
---|
558 | }; |
---|
559 | |
---|
560 | #endif |
---|