source: git/src/mainfrm.h @ 559cd60

Last change on this file since 559cd60 was 559cd60, checked in by Olly Betts <olly@…>, 6 weeks ago

Consistently refer to macOS not OS X, etc

Apple renamed it yet again.

  • Property mode set to 100644
File size: 20.6 KB
Line 
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,2015,2016,2018 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 "labelinfo.h"
39#include "message.h"
40#include "model.h"
41#include "vector3.h"
42#include "aven.h"
43//#include "prefsdlg.h"
44
45#include <list>
46#include <vector>
47
48using namespace std;
49
50#include <math.h>
51#include <time.h>
52
53#ifdef __WXMAC__
54// Currently on macOS, we force use of a generic toolbar, which needs to be put
55// in a sizer.
56# define USING_GENERIC_TOOLBAR
57#endif
58
59#define MARK_FIRST 1
60#define MARK_NEXT 2
61#define MARK_PREV 3
62
63enum {
64    menu_FILE_LOG = 1000,
65    menu_FILE_OPEN_TERRAIN,
66    menu_FILE_PAGE_SETUP,
67    menu_FILE_SCREENSHOT,
68    menu_FILE_EXPORT,
69    menu_FILE_EXTEND,
70    menu_PRES_NEW,
71    menu_PRES_OPEN,
72    menu_PRES_SAVE,
73    menu_PRES_SAVE_AS,
74    menu_PRES_MARK,
75    menu_PRES_EXPORT_MOVIE,
76    menu_PRES_FREWIND,
77    menu_PRES_REWIND,
78    menu_PRES_REVERSE,
79    menu_PRES_PLAY,
80    menu_PRES_FF,
81    menu_PRES_FFF,
82    menu_PRES_PAUSE,
83    menu_ROTATION_START,
84    menu_ROTATION_STOP,
85    menu_ROTATION_TOGGLE,
86    menu_ROTATION_REVERSE,
87    menu_ORIENT_MOVE_NORTH,
88    menu_ORIENT_MOVE_EAST,
89    menu_ORIENT_MOVE_SOUTH,
90    menu_ORIENT_MOVE_WEST,
91    menu_ORIENT_PLAN,
92    menu_ORIENT_ELEVATION,
93    menu_ORIENT_DEFAULTS,
94    menu_VIEW_SHOW_LEGS,
95    menu_VIEW_SPLAYS,
96    menu_SPLAYS_HIDE,
97    menu_SPLAYS_SHOW_DASHED,
98    menu_SPLAYS_SHOW_FADED,
99    menu_SPLAYS_SHOW_NORMAL,
100    menu_VIEW_DUPES,
101    menu_DUPES_HIDE,
102    menu_DUPES_SHOW_DASHED,
103    menu_DUPES_SHOW_FADED,
104    menu_DUPES_SHOW_NORMAL,
105    menu_VIEW_SHOW_CROSSES,
106    menu_VIEW_SHOW_NAMES,
107    menu_VIEW_SHOW_SURFACE,
108    menu_VIEW_SHOW_OVERLAPPING_NAMES,
109    menu_VIEW_SHOW_ENTRANCES,
110    menu_VIEW_SHOW_FIXED_PTS,
111    menu_VIEW_SHOW_EXPORTED_PTS,
112    menu_VIEW_STATUS_BAR,
113    menu_VIEW_GRID,
114    menu_VIEW_BOUNDING_BOX,
115    menu_VIEW_TERRAIN,
116    menu_VIEW_SHOW_TUBES,
117    menu_VIEW_PERSPECTIVE,
118    menu_VIEW_SMOOTH_SHADING,
119    menu_VIEW_TEXTURED,
120    menu_VIEW_FOG,
121    menu_VIEW_SMOOTH_LINES,
122    menu_VIEW_FULLSCREEN,
123    menu_VIEW_COLOUR_BY,
124    menu_COLOUR_BY_DEPTH,
125    menu_COLOUR_BY_DATE,
126    menu_COLOUR_BY_ERROR,
127    menu_COLOUR_BY_H_ERROR,
128    menu_COLOUR_BY_V_ERROR,
129    menu_COLOUR_BY_GRADIENT,
130    menu_COLOUR_BY_LENGTH,
131    menu_COLOUR_BY_SURVEY,
132    menu_IND_COMPASS,
133    menu_IND_CLINO,
134    menu_IND_COLOUR_KEY,
135    menu_IND_SCALE_BAR,
136    menu_CTL_INDICATORS,
137    menu_CTL_SIDE_PANEL,
138    menu_CTL_METRIC,
139    menu_CTL_DEGREES,
140    menu_CTL_PERCENT,
141    menu_CTL_REVERSE,
142    menu_CTL_CANCEL_DIST_LINE,
143    menu_SURVEY_RESTRICT,
144    menu_SURVEY_SHOW_ALL,
145    menu_SURVEY_HIDE,
146    menu_SURVEY_SHOW,
147    menu_SURVEY_HIDE_SIBLINGS,
148    textctrl_FIND,
149    button_HIDE,
150    listctrl_PRES
151};
152
153class AvenPresList;
154
155class MainFrm : public wxFrame, public Model {
156    wxFileHistory m_history;
157    int m_SashPosition;
158    bool was_showing_sidepanel_before_fullscreen;
159    GfxCore* m_Gfx;
160    wxWindow* m_Log;
161    GUIControl* m_Control;
162    wxSplitterWindow* m_Splitter;
163    AvenTreeCtrl* m_Tree;
164    wxTextCtrl* m_FindBox;
165    // wxCheckBox* m_RegexpCheckBox;
166    wxNotebook* m_Notebook;
167    AvenPresList* m_PresList;
168    wxString m_File;
169    // Processed version of data - same as m_File if m_File is processed data.
170    wxString m_FileProcessed;
171    wxString m_Survey;
172
173    // Strings for status bar reporting of distances.
174    wxString here_text, coords_text, dist_text, distfree_text;
175
176    int m_NumHighlighted = 0;
177    bool pending_find;
178
179    bool fullscreen_showing_menus;
180
181#ifdef PREFDLG
182    PrefsDlg* m_PrefsDlg;
183#endif
184
185    bool ProcessSVXFile(const wxString & file);
186//    void FixLRUD(traverse & centreline);
187
188    void CreateMenuBar();
189    void MakeToolBar();
190    void CreateSidePanel();
191
192    void UpdateStatusBar();
193
194#ifdef USING_GENERIC_TOOLBAR
195    wxToolBar * GetToolBar() const {
196        wxSizer * sizer = GetSizer();
197        if (!sizer) return NULL;
198        return (wxToolBar*)sizer->GetItem(size_t(0))->GetWindow();
199    }
200#endif
201
202public:
203    MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size);
204
205    // public for CavernLog.
206    bool LoadData(const wxString& file, const wxString& prefix);
207    void AddToFileHistory(const wxString & file);
208
209    void InitialiseAfterLoad(const wxString & file, const wxString & prefix);
210    void OnShowLog(wxCommandEvent& event);
211
212    void OnMRUFile(wxCommandEvent& event);
213    void OpenFile(const wxString& file, const wxString& survey = wxString());
214
215    void OnPresNewUpdate(wxUpdateUIEvent& event);
216    void OnPresOpenUpdate(wxUpdateUIEvent& event);
217    void OnPresSaveUpdate(wxUpdateUIEvent& event);
218    void OnPresSaveAsUpdate(wxUpdateUIEvent& event);
219    void OnPresMarkUpdate(wxUpdateUIEvent& event);
220    void OnPresFRewindUpdate(wxUpdateUIEvent& event);
221    void OnPresRewindUpdate(wxUpdateUIEvent& event);
222    void OnPresReverseUpdate(wxUpdateUIEvent& event);
223    void OnPresPlayUpdate(wxUpdateUIEvent& event);
224    void OnPresFFUpdate(wxUpdateUIEvent& event);
225    void OnPresFFFUpdate(wxUpdateUIEvent& event);
226    void OnPresPauseUpdate(wxUpdateUIEvent& event);
227    void OnPresStopUpdate(wxUpdateUIEvent& event);
228    void OnPresExportMovieUpdate(wxUpdateUIEvent& event);
229    void OnOpenTerrainUpdate(wxUpdateUIEvent& event);
230
231    void DoFind();
232    void OnFind(wxCommandEvent& event);
233    void OnIdle(wxIdleEvent& event);
234    void OnGotoFound(wxCommandEvent& event);
235    void OnHide(wxCommandEvent& event);
236    void OnHideUpdate(wxUpdateUIEvent& ui);
237
238    void OnOpen(wxCommandEvent& event);
239    void OnOpenTerrain(wxCommandEvent&);
240    void HideLog(wxWindow * log_window);
241    void OnScreenshot(wxCommandEvent& event);
242    void OnScreenshotUpdate(wxUpdateUIEvent& event);
243    void OnFilePreferences(wxCommandEvent& event);
244    void OnPrint(wxCommandEvent& event);
245    void PrintAndExit();
246    void OnPageSetup(wxCommandEvent& event);
247    void OnPresNew(wxCommandEvent& event);
248    void OnPresOpen(wxCommandEvent& event);
249    void OnPresSave(wxCommandEvent& event);
250    void OnPresSaveAs(wxCommandEvent& event);
251    void OnPresMark(wxCommandEvent& event);
252    void OnPresFRewind(wxCommandEvent& event);
253    void OnPresRewind(wxCommandEvent& event);
254    void OnPresReverse(wxCommandEvent& event);
255    void OnPresPlay(wxCommandEvent& event);
256    void OnPresFF(wxCommandEvent& event);
257    void OnPresFFF(wxCommandEvent& event);
258    void OnPresPause(wxCommandEvent& event);
259    void OnPresStop(wxCommandEvent& event);
260    void OnPresExportMovie(wxCommandEvent& event);
261    void OnExport(wxCommandEvent& event);
262    void OnExtend(wxCommandEvent& event);
263    void OnQuit(wxCommandEvent& event);
264
265    void OnAbout(wxCommandEvent& event);
266    void OnClose(wxCloseEvent&);
267
268    void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); }
269
270    void OnKeyPress(wxKeyEvent &e) {
271        if (m_Gfx) {
272            m_Gfx->SetFocus();
273            m_Gfx->OnKeyPress(e);
274        }
275    }
276
277    void OnShowLogUpdate(wxUpdateUIEvent &ui) {
278        ui.Enable(m_Log != NULL || (m_Splitter->GetWindow1() != m_Gfx && m_Splitter->GetWindow2() != m_Gfx));
279        ui.Check(m_Log == NULL);
280    }
281    void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); }
282    void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); }
283    void OnExtendUpdate(wxUpdateUIEvent &ui) {
284        ui.Enable(!IsExtendedElevation());
285    }
286
287    // temporary bodges until event handling problem is sorted out:
288    void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDefaultsUpdate(event); }
289    void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnPlanUpdate(event); }
290    void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnElevationUpdate(event); }
291    void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDisplayOverlappingNamesUpdate(event); }
292    void OnColourByUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByUpdate(event); }
293    void OnColourByDepthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDepthUpdate(event); }
294    void OnColourByDateUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDateUpdate(event); }
295    void OnColourByErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByErrorUpdate(event); }
296    void OnColourByHErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByHErrorUpdate(event); }
297    void OnColourByVErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByVErrorUpdate(event); }
298    void OnColourByGradientUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByGradientUpdate(event); }
299    void OnColourByLengthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByLengthUpdate(event); }
300    void OnColourBySurveyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourBySurveyUpdate(event); }
301    void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowCrossesUpdate(event); }
302    void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowEntrancesUpdate(event); }
303    void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowFixedPtsUpdate(event); }
304    void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowExportedPtsUpdate(event); }
305    void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowStationNamesUpdate(event); }
306    void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurveyLegsUpdate(event); }
307    void OnSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSplaysUpdate(event); }
308    void OnHideSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideSplaysUpdate(event); }
309    void OnShowSplaysDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysDashedUpdate(event); }
310    void OnShowSplaysFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysFadedUpdate(event); }
311    void OnShowSplaysNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysNormalUpdate(event); }
312    void OnDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDupesUpdate(event); }
313    void OnHideDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideDupesUpdate(event); }
314    void OnShowDupesDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesDashedUpdate(event); }
315    void OnShowDupesFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesFadedUpdate(event); }
316    void OnShowDupesNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesNormalUpdate(event); }
317    void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurfaceUpdate(event); }
318    void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveEastUpdate(event); }
319    void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveNorthUpdate(event); }
320    void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveSouthUpdate(event); }
321    void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveWestUpdate(event); }
322    void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleRotationUpdate(event); }
323    void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseControlsUpdate(event); }
324    void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleScalebarUpdate(event); }
325    void OnToggleColourKeyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleColourKeyUpdate(event); }
326    void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewCompassUpdate(event); }
327    void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewGridUpdate(event); }
328    void OnViewBoundingBoxUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewBoundingBoxUpdate(event); }
329    void OnViewTerrainUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTerrainUpdate(event); }
330    void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewClinoUpdate(event); }
331    void OnViewPerspectiveUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewPerspectiveUpdate(event); }
332    void OnViewSmoothShadingUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothShadingUpdate(event); }
333    void OnViewTexturedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTexturedUpdate(event); }
334    void OnViewFogUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFogUpdate(event); }
335    void OnViewSmoothLinesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothLinesUpdate(event); }
336    void OnViewFullScreenUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFullScreenUpdate(event); }
337    void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseDirectionOfRotationUpdate(event); }
338    void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnCancelDistLineUpdate(event); }
339    void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnIndicatorsUpdate(event); }
340
341    void OnDefaults(wxCommandEvent&) { if (m_Control) m_Control->OnDefaults(); }
342    void OnPlan(wxCommandEvent&) { if (m_Control) m_Control->OnPlan(); }
343    void OnElevation(wxCommandEvent&) { if (m_Control) m_Control->OnElevation(); }
344    void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Control) m_Control->OnDisplayOverlappingNames(); }
345    void OnColourByDepth(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDepth(); }
346    void OnColourByDate(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDate(); }
347    void OnColourByError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByError(); }
348    void OnColourByHError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByHError(); }
349    void OnColourByVError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByVError(); }
350    void OnColourByGradient(wxCommandEvent&) { if (m_Control) m_Control->OnColourByGradient(); }
351    void OnColourByLength(wxCommandEvent&) { if (m_Control) m_Control->OnColourByLength(); }
352    void OnColourBySurvey(wxCommandEvent&) { if (m_Control) m_Control->OnColourBySurvey(); }
353    void OnShowCrosses(wxCommandEvent&) { if (m_Control) m_Control->OnShowCrosses(); }
354    void OnShowEntrances(wxCommandEvent&) { if (m_Control) m_Control->OnShowEntrances(); }
355    void OnShowFixedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowFixedPts(); }
356    void OnShowExportedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowExportedPts(); }
357    void OnShowStationNames(wxCommandEvent&) { if (m_Control) m_Control->OnShowStationNames(); }
358    void OnShowSurveyLegs(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurveyLegs(); }
359    void OnHideSplays(wxCommandEvent&) { if (m_Control) m_Control->OnHideSplays(); }
360    void OnShowSplaysDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysDashed(); }
361    void OnShowSplaysFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysFaded(); }
362    void OnShowSplaysNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysNormal(); }
363    void OnHideDupes(wxCommandEvent&) { if (m_Control) m_Control->OnHideDupes(); }
364    void OnShowDupesDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesDashed(); }
365    void OnShowDupesFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesFaded(); }
366    void OnShowDupesNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesNormal(); }
367    void OnShowSurface(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurface(); }
368    void OnMoveEast(wxCommandEvent&) { if (m_Control) m_Control->OnMoveEast(); }
369    void OnMoveNorth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveNorth(); }
370    void OnMoveSouth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveSouth(); }
371    void OnMoveWest(wxCommandEvent&) { if (m_Control) m_Control->OnMoveWest(); }
372    void OnToggleRotation(wxCommandEvent&) { if (m_Control) m_Control->OnToggleRotation(); }
373    void OnReverseControls(wxCommandEvent&) { if (m_Control) m_Control->OnReverseControls(); }
374    void OnToggleScalebar(wxCommandEvent&) { if (m_Control) m_Control->OnToggleScalebar(); }
375    void OnToggleColourKey(wxCommandEvent&) { if (m_Control) m_Control->OnToggleColourKey(); }
376    void OnViewCompass(wxCommandEvent&) { if (m_Control) m_Control->OnViewCompass(); }
377    void OnViewClino(wxCommandEvent&) { if (m_Control) m_Control->OnViewClino(); }
378    void OnViewGrid(wxCommandEvent&) { if (m_Control) m_Control->OnViewGrid(); }
379    void OnViewBoundingBox(wxCommandEvent&) { if (m_Control) m_Control->OnViewBoundingBox(); }
380    void OnViewTerrain(wxCommandEvent&) { if (m_Control) m_Control->OnViewTerrain(); }
381    void OnViewPerspective(wxCommandEvent&) { if (m_Control) m_Control->OnViewPerspective(); }
382    void OnViewSmoothShading(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothShading(); }
383    void OnViewTextured(wxCommandEvent&) { if (m_Control) m_Control->OnViewTextured(); }
384    void OnViewFog(wxCommandEvent&) { if (m_Control) m_Control->OnViewFog(); }
385    void OnViewSmoothLines(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothLines(); }
386    void OnViewFullScreen(wxCommandEvent&) { ViewFullScreen(); }
387    void ViewFullScreen();
388    bool FullScreenModeShowingMenus() const;
389    void FullScreenModeShowMenus(bool show);
390    void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Control) m_Control->OnReverseDirectionOfRotation(); }
391    void OnCancelDistLine(wxCommandEvent&) { if (m_Control) m_Control->OnCancelDistLine(); }
392
393    void OnToggleMetric(wxCommandEvent&) { if (m_Control) m_Control->OnToggleMetric(); }
394    void OnToggleDegrees(wxCommandEvent&) { if (m_Control) m_Control->OnToggleDegrees(); }
395    void OnTogglePercent(wxCommandEvent&) { if (m_Control) m_Control->OnTogglePercent(); }
396    void OnToggleTubes(wxCommandEvent&) { if (m_Control) m_Control->OnToggleTubes(); }
397
398    void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleMetricUpdate(event); }
399    void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleDegreesUpdate(event); }
400    void OnTogglePercentUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnTogglePercentUpdate(event); }
401    void OnToggleTubesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleTubesUpdate(event); }
402
403    // end of horrible bodges
404
405    void OnViewSidePanelUpdate(wxUpdateUIEvent& event);
406    void OnViewSidePanel(wxCommandEvent& event);
407    void ToggleSidePanel();
408    bool ShowingSidePanel();
409
410    void SelectTreeItem(const LabelInfo* label) {
411        if (label->tree_id.IsOk())
412            m_Tree->SelectItem(label->tree_id);
413        else
414            m_Tree->UnselectAll();
415    }
416
417    void ClearTreeSelection();
418
419    void ClearCoords();
420    void SetCoords(const Vector3 &v);
421    const LabelInfo * GetTreeSelection() const;
422    void SetCoords(Double x, Double y, const LabelInfo * there);
423    void SetAltitude(Double z, const LabelInfo * there);
424
425    void ShowInfo(const LabelInfo *here = NULL, const LabelInfo *there = NULL);
426    void DisplayTreeInfo(const wxTreeItemData* data = NULL);
427    void TreeItemSelected(const wxTreeItemData* data);
428    PresentationMark GetPresMark(int which);
429    bool Animating() const { return m_Gfx && m_Gfx->Animating(); }
430
431    // Restrict to subsurvey `survey` (or show all if `survey` empty).
432    void RestrictTo(const wxString & survey);
433
434    wxString GetSurvey() const { return m_Survey; }
435
436    int GetNumHighlightedPts() const { return m_NumHighlighted; }
437
438    const SurveyFilter* GetTreeFilter() const { return m_Tree->GetFilter(); }
439
440    // Used when the tree filters change.  FIXME: Overkill?
441    void ForceFullRedraw() {
442        m_Gfx->InvalidateAllLists();
443        m_Gfx->ForceRefresh();
444    }
445
446private:
447    DECLARE_EVENT_TABLE()
448};
449
450#endif
Note: See TracBrowser for help on using the repository browser.