-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathvector2d.sip
48 lines (42 loc) · 1.25 KB
/
vector2d.sip
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
/** PyQt5 binding for QCustomPlot v2.0.0
*
* Authors: Dmitry Voronin, Giuseppe Corbelli
* License: MIT
*
* QCustomPlot author: Emanuel Eichhammer
* QCustomPlot Website/Contact: http://www.qcustomplot.com
*/
class QCPVector2D
{
%TypeHeaderCode
#include <QCustomPlot/src/vector2d.h>
%End
public:
QCPVector2D();
QCPVector2D(double x, double y);
QCPVector2D(const QPoint &point);
QCPVector2D(const QPointF &point);
// getters:
double x() const;
double y() const;
// setters:
void setX(double x);
void setY(double y);
// non-virtual methods:
double length() const;
double lengthSquared() const;
QPoint toPoint() const;
QPointF toPointF() const;
bool isNull() const;
void normalize();
QCPVector2D normalized() const;
QCPVector2D perpendicular() const;
double dot(const QCPVector2D &vec) const;
double distanceSquaredToLine(const QCPVector2D &start, const QCPVector2D &end) const;
double distanceSquaredToLine(const QLineF &line) const;
double distanceToStraightLine(const QCPVector2D &base, const QCPVector2D &direction) const;
QCPVector2D &operator*=(double factor);
QCPVector2D &operator/=(double divisor);
QCPVector2D &operator+=(const QCPVector2D &vector);
QCPVector2D &operator-=(const QCPVector2D &vector);
};