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 class ScaleControlWidget;
47}
48
49//=============================================================================================================
50// DEFINE NAMESPACE DISPLIB
51//=============================================================================================================
52
53namespace DISPLIB {
54
55//=============================================================================================================
63class DISPSHARED_EXPORT ScaleControl : public QWidget
64{
65 Q_OBJECT
66
67public:
68
69 //=========================================================================================================
75 explicit ScaleControl(const char* label);
76
77 //=========================================================================================================
85 explicit ScaleControl(const char* label,
86 QWidget* parent);
87
88 //=========================================================================================================
98 explicit ScaleControl(const char* label,
99 QWidget* parent,
100 double min,
101 double max);
102
103 //=========================================================================================================
109 Ui::ScaleControlWidget* getUI();
110
111 //=========================================================================================================
117 double value() const;
118
119 //=========================================================================================================
125 void setMaxSensitivityPoint(double s);
126
127 //=========================================================================================================
133 void setSensitivity(double s);
134
135 //=========================================================================================================
142 void setRange(double min,
143 double max);
144
145 //=========================================================================================================
151 void setDecimals(int d);
152
153 //=========================================================================================================
159 void invertSlider(bool inverted);
160
161public slots:
162
163 //=========================================================================================================
169 void setValue(double dScale);
170
171signals:
172 //=========================================================================================================
178 void valueChanged(double dScale);
179
180private:
181
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)