-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolarwidget.h
39 lines (31 loc) · 853 Bytes
/
polarwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef POLARWIDGET_H
#define POLARWIDGET_H
#include <QWidget>
#include <QtCharts/QChartView>
#include <QtCharts/QPolarChart>
#include <QtCharts/QValueAxis>
#include <QtCharts/QScatterSeries>
class PolarWidget : public QChartView
{
Q_OBJECT
public:
explicit PolarWidget(QWidget *parent = nullptr);
private:
const qreal angularMin = 0;
const qreal angularMax = 360;
const qreal radialMin = 0;
const qreal radialMax = 90;
bool rotationLock = true;
QPolarChart *chart;
QValueAxis *angularAxis;
QValueAxis *radialAxis;
QScatterSeries *crosshair;
QScatterSeries *circle;
signals:
public slots:
void setCrosshairPoint(float yaw, float pitch);
void setCirclePoint(float yaw, float pitch);
void setRotationUnlock(bool rotationUnlock);
void resetRotationAngle();
};
#endif // POLARWIDGET_H