-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointdata.cpp
More file actions
47 lines (37 loc) · 959 Bytes
/
Copy pathpointdata.cpp
File metadata and controls
47 lines (37 loc) · 959 Bytes
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
#include "pointdata.h"
PointData::PointData(QObject *parent) : QObject(parent) {
}
QList<QPointF> PointData::allPoints() const {
return _points;
}
int PointData::pointCount() const {
return _points.count();
}
QPointF PointData::pointAt(const qint64 idx) const {
return _points[idx];
}
void PointData::addPoint(const QPointF &point) {
_points.push_back(point);
emit pointsChanged();
}
void PointData::addPoints(const QList<QPointF> &points) {
_points.append(points);
emit pointsChanged();
}
void PointData::removePoint(const qint64 idx) {
_points.removeAt(idx);
emit pointsChanged();
}
void PointData::setPoint(const qint64 idx, const QPointF &point) {
_points[idx] = point;
emit pointsChanged();
}
void PointData::setAllPoints(const QList<QPointF> &points) {
_points.clear();
_points = points;
emit pointsChanged();
}
void PointData::clear() {
_points.clear();
emit pointsChanged();
}