-
Notifications
You must be signed in to change notification settings - Fork 3
/
qcline.h
60 lines (38 loc) · 1.19 KB
/
qcline.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef QCLINE_H
#define QCLINE_H
#include <QObject>
#include <QPointF>
#include <QLineF>
#include <QVariantMap>
#include <QJSValue>
/* QuickCross Project
* License: APACHE-2.0
* Author: Ben Lau
* Project Site: https://github.com/benlau/quickcross
*
*/
class QCLine : public QObject
{
Q_OBJECT
public:
explicit QCLine(QObject *parent = 0);
signals:
public slots:
QVariantMap create(const QPointF& p1, const QPointF& p2) const;
QVariantMap create(qreal x1, qreal y1, qreal x2, qreal y2) const;
QVariantMap create(const QPointF& p2) const;
QVariantMap create(const QVariantMap& line) const;
bool equals(const QJSValue& line1, const QJSValue& line2) const;
qreal length(QJSValue line) const;
void setLength(QJSValue line, qreal length) const;
QVariantMap unitVector(QJSValue line) const;
qreal angle(QJSValue line) const;
void setAngle(QJSValue line,qreal angle) const;
void translate(QJSValue line, qreal dx, qreal dy) const;
void translateToOrigin(QJSValue line) const;
qreal dx(QJSValue line) const;
qreal dy(QJSValue line) const;
QPointF p1(QJSValue line) const;
QPointF p2(QJSValue line) const;
};
#endif // QCLINE_H