source: git/src/guicontrol.h @ fc43dda

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

Allow colouring by horizontal or vertical error

  • Property mode set to 100644
File size: 6.8 KB
Line 
1//
2//  guicontrol.h
3//
4//  Handlers for events relating to the display of a survey.
5//
6//  Copyright (C) 2000-2002,2005 Mark R. Shinwell
7//  Copyright (C) 2001-2004,2006,2014,2015 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 guicontrol_h
25#define guicontrol_h
26
27#include "wx.h"
28
29class GfxCore;
30
31class GUIControl {
32    GfxCore* m_View;
33
34    enum { NO_DRAG = 0, LEFT_DRAG, MIDDLE_DRAG, RIGHT_DRAG } dragging;
35
36    wxPoint m_DragStart;
37    wxPoint m_DragRealStart;
38    wxPoint m_DragLast;
39
40    enum {
41        drag_NONE,
42        drag_MAIN,
43        drag_COMPASS,
44        drag_ELEV,
45        drag_SCALE,
46        drag_ZOOM
47    } m_LastDrag;
48
49    enum { lock_NONE, lock_ROTATE, lock_SCALE } m_ScaleRotateLock;
50
51    bool m_ReverseControls;
52
53    void HandleRotate(wxPoint);
54    void HandleTilt(wxPoint);
55    void HandleTranslate(wxPoint);
56    void HandleScaleRotate(wxPoint);
57    void HandleTiltRotate(wxPoint);
58
59    void HandCursor();
60    void RestoreCursor();
61
62    void HandleNonDrag(const wxPoint & point);
63
64public:
65    GUIControl();
66
67    void SetView(GfxCore* view);
68
69    bool MouseDown() const;
70
71    void OnDefaults();
72    void OnPlan();
73    void OnElevation();
74    void OnDisplayOverlappingNames();
75    void OnColourByDepth();
76    void OnColourByDate();
77    void OnColourByError();
78    void OnColourByHError();
79    void OnColourByVError();
80    void OnColourByGradient();
81    void OnColourByLength();
82    void OnColourBySurvey();
83    void OnShowCrosses();
84    void OnShowStationNames();
85    void OnShowSurveyLegs();
86    void OnHideSplays();
87    void OnShowSplaysDashed();
88    void OnShowSplaysFaded();
89    void OnShowSplaysNormal();
90    void OnHideDupes();
91    void OnShowDupesDashed();
92    void OnShowDupesFaded();
93    void OnShowDupesNormal();
94    void OnShowSurface();
95    void OnMoveEast();
96    void OnMoveNorth();
97    void OnMoveSouth();
98    void OnMoveWest();
99    void OnToggleRotation();
100    void OnReverseControls();
101    void OnSlowDown(bool accel = false);
102    void OnSpeedUp(bool accel = false);
103    void OnStepOnceAnticlockwise(bool accel = false);
104    void OnStepOnceClockwise(bool accel = false);
105    void OnHigherViewpoint(bool accel = false);
106    void OnLowerViewpoint(bool accel = false);
107    void OnShiftDisplayDown(bool accel = false);
108    void OnShiftDisplayLeft(bool accel = false);
109    void OnShiftDisplayRight(bool accel = false);
110    void OnShiftDisplayUp(bool accel = false);
111    void OnZoomIn(bool accel = false);
112    void OnZoomOut(bool accel = false);
113    void OnToggleScalebar();
114    void OnToggleColourKey();
115    void OnViewCompass();
116    void OnViewClino();
117    void OnViewGrid();
118    void OnReverseDirectionOfRotation();
119    void OnShowEntrances();
120    void OnShowFixedPts();
121    void OnShowExportedPts();
122    void OnCancelDistLine();
123    void OnMouseMove(wxMouseEvent& event);
124    void OnLButtonDown(wxMouseEvent& event);
125    void OnLButtonUp(wxMouseEvent& event);
126    void OnMButtonDown(wxMouseEvent& event);
127    void OnMButtonUp(wxMouseEvent& event);
128    void OnRButtonDown(wxMouseEvent& event);
129    void OnRButtonUp(wxMouseEvent& event);
130    void OnMouseWheel(wxMouseEvent& event);
131    void OnKeyPress(wxKeyEvent &e);
132
133    void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent&);
134    void OnColourByUpdate(wxUpdateUIEvent&);
135    void OnColourByDepthUpdate(wxUpdateUIEvent&);
136    void OnColourByDateUpdate(wxUpdateUIEvent&);
137    void OnColourByErrorUpdate(wxUpdateUIEvent&);
138    void OnColourByHErrorUpdate(wxUpdateUIEvent&);
139    void OnColourByVErrorUpdate(wxUpdateUIEvent&);
140    void OnColourByGradientUpdate(wxUpdateUIEvent&);
141    void OnColourByLengthUpdate(wxUpdateUIEvent&);
142    void OnColourBySurveyUpdate(wxUpdateUIEvent&);
143    void OnShowCrossesUpdate(wxUpdateUIEvent&);
144    void OnShowStationNamesUpdate(wxUpdateUIEvent&);
145    void OnShowSurveyLegsUpdate(wxUpdateUIEvent&);
146    void OnSplaysUpdate(wxUpdateUIEvent&);
147    void OnHideSplaysUpdate(wxUpdateUIEvent&);
148    void OnShowSplaysDashedUpdate(wxUpdateUIEvent&);
149    void OnShowSplaysFadedUpdate(wxUpdateUIEvent&);
150    void OnShowSplaysNormalUpdate(wxUpdateUIEvent&);
151    void OnDupesUpdate(wxUpdateUIEvent&);
152    void OnHideDupesUpdate(wxUpdateUIEvent&);
153    void OnShowDupesDashedUpdate(wxUpdateUIEvent&);
154    void OnShowDupesFadedUpdate(wxUpdateUIEvent&);
155    void OnShowDupesNormalUpdate(wxUpdateUIEvent&);
156    void OnShowSurfaceUpdate(wxUpdateUIEvent&);
157    void OnMoveEastUpdate(wxUpdateUIEvent&);
158    void OnMoveNorthUpdate(wxUpdateUIEvent&);
159    void OnMoveSouthUpdate(wxUpdateUIEvent&);
160    void OnMoveWestUpdate(wxUpdateUIEvent&);
161    void OnToggleRotationUpdate(wxUpdateUIEvent&);
162    void OnReverseControlsUpdate(wxUpdateUIEvent&);
163    void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent&);
164    void OnDefaultsUpdate(wxUpdateUIEvent&);
165    void OnElevationUpdate(wxUpdateUIEvent&);
166    void OnPlanUpdate(wxUpdateUIEvent&);
167    void OnToggleScalebarUpdate(wxUpdateUIEvent&);
168    void OnToggleColourKeyUpdate(wxUpdateUIEvent&);
169    void OnViewCompassUpdate(wxUpdateUIEvent&);
170    void OnViewClinoUpdate(wxUpdateUIEvent&);
171    void OnViewGridUpdate(wxUpdateUIEvent&);
172    void OnShowEntrancesUpdate(wxUpdateUIEvent&);
173    void OnShowExportedPtsUpdate(wxUpdateUIEvent&);
174    void OnShowFixedPtsUpdate(wxUpdateUIEvent&);
175
176    void OnIndicatorsUpdate(wxUpdateUIEvent&);
177    void OnCancelDistLineUpdate(wxUpdateUIEvent&);
178
179    void OnViewPerspective();
180    void OnViewPerspectiveUpdate(wxUpdateUIEvent& cmd);
181
182    void OnViewSmoothShading();
183    void OnViewSmoothShadingUpdate(wxUpdateUIEvent& cmd);
184
185    void OnViewTextured();
186    void OnViewTexturedUpdate(wxUpdateUIEvent& cmd);
187
188    void OnViewFog();
189    void OnViewFogUpdate(wxUpdateUIEvent& cmd);
190
191    void OnViewSmoothLines();
192    void OnViewSmoothLinesUpdate(wxUpdateUIEvent& cmd);
193
194    void OnToggleMetric();
195    void OnToggleMetricUpdate(wxUpdateUIEvent& cmd);
196
197    void OnToggleDegrees();
198    void OnToggleDegreesUpdate(wxUpdateUIEvent& cmd);
199
200    void OnTogglePercent();
201    void OnTogglePercentUpdate(wxUpdateUIEvent& cmd);
202
203    void OnToggleTubes();
204    void OnToggleTubesUpdate(wxUpdateUIEvent& cmd);
205
206    void OnViewFullScreenUpdate(wxUpdateUIEvent&);
207    void OnViewFullScreen();
208
209    void OnViewBoundingBoxUpdate(wxUpdateUIEvent&);
210    void OnViewBoundingBox();
211
212    void OnViewTerrainUpdate(wxUpdateUIEvent&);
213    void OnViewTerrain();
214};
215
216#endif
Note: See TracBrowser for help on using the repository browser.