MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
scalecontrol.h
Go to the documentation of this file.
1//=============================================================================================================
34#ifndef SCALECONTROL_H
35#define SCALECONTROL_H
36
37//=============================================================================================================
38// INCLUDES
39//=============================================================================================================
40
41#include "disp_global.h"
42
43//=============================================================================================================
44// QT INCLUDES
45//=============================================================================================================
46
47#include <QWidget>
48#include <QMenu>
49
50//=============================================================================================================
51// EIGEN INCLUDES
52//=============================================================================================================
53
54//=============================================================================================================
55// FORWARD DECLARATIONS
56//=============================================================================================================
57
58namespace Ui {
59 class ScaleControlWidget;
60}
61
62//=============================================================================================================
63// DEFINE NAMESPACE DISPLIB
64//=============================================================================================================
65
66namespace DISPLIB {
67
68//=============================================================================================================
75class DISPSHARED_EXPORT ScaleControl : public QWidget
76{
77 Q_OBJECT
78
79public:
80
81 //=========================================================================================================
87 explicit ScaleControl(const char* label);
88
89 //=========================================================================================================
97 explicit ScaleControl(const char* label,
98 QWidget* parent);
99
100 //=========================================================================================================
110 explicit ScaleControl(const char* label,
111 QWidget* parent,
112 double min,
113 double max);
114
115 //=========================================================================================================
121 Ui::ScaleControlWidget* getUI();
122
123 //=========================================================================================================
129 double value() const;
130
131 //=========================================================================================================
137 void setMaxSensitivityPoint(double s);
138
139 //=========================================================================================================
145 void setSensitivity(double s);
146
147 //=========================================================================================================
154 void setRange(double min,
155 double max);
156
157 //=========================================================================================================
163 void setDecimals(int d);
164
165 //=========================================================================================================
171 void invertSlider(bool inverted);
172
173public slots:
174
175 //=========================================================================================================
181 void setValue(double dScale);
182
183signals:
184 //=========================================================================================================
190 void valueChanged(double dScale);
191
192private:
193
194 //=========================================================================================================
200 void initLabel(const char* charTextLabel);
201
202 //=========================================================================================================
206 void initSpinBox();
207
208 //=========================================================================================================
212 void initSlider();
213
214 //=========================================================================================================
218 void initMenu();
219
220 //=========================================================================================================
226 void spinBoxChanged(double dScale);
227
228 //=========================================================================================================
234 void sliderChanged(int dScale);
235
236 //=========================================================================================================
246 void setSliderRange(int min,
247 int max);
248
249 //=========================================================================================================
257 inline int mapSpinBoxToSlider(double dIn);
258
259 //=========================================================================================================
268 inline double mapSliderToSpinBox(int iIn);
269
270 //=========================================================================================================
276 void updateNLMapConstants();
277
278 //=========================================================================================================
285 inline float weightedSensitivity(float fSensitivity);
286
287 //=========================================================================================================
291 void promptMinValueChange();
292
293 //=========================================================================================================
297 void promptMaxValueChange();
298
299 Ui::ScaleControlWidget* m_pUi;
300 bool m_bManagingSpinBoxChange;
301 bool m_bManagingSliderChange;
302 float m_fSensitivity;
303 float m_fSensitivityWeighted;
304 float m_fMaxSensitivityPoint;
305 float m_fMapYconstant;
306 float m_fMapKconstant;
307 bool m_bSliderInverted;
309 QMenu* m_pSettingsMenu;
310};
311
312}//DISPLIB NAMESPACE
313
314#endif // SCALECONTROL_H
disp library export/import macros.
#define DISPSHARED_EXPORT
Definition disp_global.h:55
The ScaleControl class packs together a QLabel, a DoubleSpinbox and a Slider with the necessary facil...
void valueChanged(double dScale)