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#include <memory>
38
39//=============================================================================================================
40// EIGEN INCLUDES
41//=============================================================================================================
42
43//=============================================================================================================
44// FORWARD DECLARATIONS
45//=============================================================================================================
46
47namespace Ui
48{
49class ScaleControlWidget;
50}
51
52//=============================================================================================================
53// DEFINE NAMESPACE DISPLIB
54//=============================================================================================================
55
56namespace DISPLIB
57{
58
59//=============================================================================================================
67class DISPSHARED_EXPORT ScaleControl : public QWidget
68{
69 Q_OBJECT
70
71public:
72 //=========================================================================================================
78 explicit ScaleControl(const char* label);
79
80 //=========================================================================================================
88 explicit ScaleControl(const char* label,
89 QWidget* parent);
90
91 //=========================================================================================================
101 explicit ScaleControl(const char* label,
102 QWidget* parent,
103 double min,
104 double max);
105
106 ~ScaleControl() override;
107
108 //=========================================================================================================
114 Ui::ScaleControlWidget* getUI();
115
116 //=========================================================================================================
122 double value() const;
123
124 //=========================================================================================================
130 void setMaxSensitivityPoint(double s);
131
132 //=========================================================================================================
138 void setSensitivity(double s);
139
140 //=========================================================================================================
147 void setRange(double min,
148 double max);
149
150 //=========================================================================================================
156 void setDecimals(int d);
157
158 //=========================================================================================================
164 void invertSlider(bool inverted);
165
166public slots:
167
168 //=========================================================================================================
174 void setValue(double dScale);
175
176signals:
177 //=========================================================================================================
183 void valueChanged(double dScale);
184
185private:
186 //=========================================================================================================
192 void initLabel(const char* charTextLabel);
193
194 //=========================================================================================================
198 void initSpinBox();
199
200 //=========================================================================================================
204 void initSlider();
205
206 //=========================================================================================================
210 void initMenu();
211
212 //=========================================================================================================
218 void spinBoxChanged(double dScale);
219
220 //=========================================================================================================
226 void sliderChanged(int dScale);
227
228 //=========================================================================================================
238 void setSliderRange(int min,
239 int max);
240
241 //=========================================================================================================
249 inline int mapSpinBoxToSlider(double dIn);
250
251 //=========================================================================================================
260 inline double mapSliderToSpinBox(int iIn);
261
262 //=========================================================================================================
268 void updateNLMapConstants();
269
270 //=========================================================================================================
277 inline float weightedSensitivity(float fSensitivity);
278
279 //=========================================================================================================
283 void promptMinValueChange();
284
285 //=========================================================================================================
289 void promptMaxValueChange();
290
291 std::unique_ptr<Ui::ScaleControlWidget> m_pUi;
292 bool m_bManagingSpinBoxChange;
293 bool m_bManagingSliderChange;
294 float m_fSensitivity;
295 float m_fSensitivityWeighted;
296 float m_fMaxSensitivityPoint;
297 float m_fMapYconstant;
298 float m_fMapKconstant;
299 bool m_bSliderInverted;
300
301 QMenu* m_pSettingsMenu;
302};
303
304} //DISPLIB NAMESPACE
305
306#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()
~ScaleControl() override
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)