v2.0.0
Loading...
Searching...
No Matches
scalecontrol.h
Go to the documentation of this file.
1//=============================================================================================================
21#ifndef SCALECONTROL_H
22#define SCALECONTROL_H
23
24//=============================================================================================================
25// INCLUDES
26//=============================================================================================================
27
28#include "disp_global.h"
29
30//=============================================================================================================
31// QT INCLUDES
32//=============================================================================================================
33
34#include <QWidget>
35#include <QMenu>
36
37//=============================================================================================================
38// EIGEN INCLUDES
39//=============================================================================================================
40
41//=============================================================================================================
42// FORWARD DECLARATIONS
43//=============================================================================================================
44
45namespace Ui
46{
47class ScaleControlWidget;
48}
49
50//=============================================================================================================
51// DEFINE NAMESPACE DISPLIB
52//=============================================================================================================
53
54namespace DISPLIB
55{
56
57//=============================================================================================================
65class DISPSHARED_EXPORT ScaleControl : public QWidget
66{
67 Q_OBJECT
68
69public:
70 //=========================================================================================================
76 explicit ScaleControl(const char* label);
77
78 //=========================================================================================================
86 explicit ScaleControl(const char* label,
87 QWidget* parent);
88
89 //=========================================================================================================
99 explicit ScaleControl(const char* label,
100 QWidget* parent,
101 double min,
102 double max);
103
104 //=========================================================================================================
110 Ui::ScaleControlWidget* getUI();
111
112 //=========================================================================================================
118 double value() const;
119
120 //=========================================================================================================
126 void setMaxSensitivityPoint(double s);
127
128 //=========================================================================================================
134 void setSensitivity(double s);
135
136 //=========================================================================================================
143 void setRange(double min,
144 double max);
145
146 //=========================================================================================================
152 void setDecimals(int d);
153
154 //=========================================================================================================
160 void invertSlider(bool inverted);
161
162public slots:
163
164 //=========================================================================================================
170 void setValue(double dScale);
171
172signals:
173 //=========================================================================================================
179 void valueChanged(double dScale);
180
181private:
182 //=========================================================================================================
188 void initLabel(const char* charTextLabel);
189
190 //=========================================================================================================
194 void initSpinBox();
195
196 //=========================================================================================================
200 void initSlider();
201
202 //=========================================================================================================
206 void initMenu();
207
208 //=========================================================================================================
214 void spinBoxChanged(double dScale);
215
216 //=========================================================================================================
222 void sliderChanged(int dScale);
223
224 //=========================================================================================================
234 void setSliderRange(int min,
235 int max);
236
237 //=========================================================================================================
245 inline int mapSpinBoxToSlider(double dIn);
246
247 //=========================================================================================================
256 inline double mapSliderToSpinBox(int iIn);
257
258 //=========================================================================================================
264 void updateNLMapConstants();
265
266 //=========================================================================================================
273 inline float weightedSensitivity(float fSensitivity);
274
275 //=========================================================================================================
279 void promptMinValueChange();
280
281 //=========================================================================================================
285 void promptMaxValueChange();
286
287 Ui::ScaleControlWidget* m_pUi;
288 bool m_bManagingSpinBoxChange;
289 bool m_bManagingSliderChange;
290 float m_fSensitivity;
291 float m_fSensitivityWeighted;
292 float m_fMaxSensitivityPoint;
293 float m_fMapYconstant;
294 float m_fMapKconstant;
295 bool m_bSliderInverted;
296
297 QMenu* m_pSettingsMenu;
298};
299
300} //DISPLIB NAMESPACE
301
302#endif // SCALECONTROL_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
2-D display widgets and visualisation helpers (charts, topography, colour maps).
Ui::ScaleControlWidget * getUI()
void invertSlider(bool inverted)
void setSensitivity(double s)
void setRange(double min, double max)
void setMaxSensitivityPoint(double s)
ScaleControl(const char *label)
void valueChanged(double dScale)
void setValue(double dScale)