-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPolylineShape.h
More file actions
31 lines (25 loc) · 1005 Bytes
/
Copy pathPolylineShape.h
File metadata and controls
31 lines (25 loc) · 1005 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
#ifndef POLYLINESHAPE_H
#define POLYLINESHAPE_H
#include "Shape.h"
class PolylineShape : public Shape
{
public:
QString shapeType() const override { return "Polyline"; }
std::unique_ptr<Shape> clone() const override;
QVector<QPointF> vertices() const override { return m_points; }
void setLocalPoints(const QVector<QPointF> &local);
void setPointsFromScene(const QVector<QPointF> &scene);
void setPoints(const QVector<QPointF> &scene) { setPointsFromScene(scene); }
bool closed() const { return m_closed; }
void setClosed(bool c);
void translateBy(double dx, double dy) override;
void scaleLocalGeometry(const QRectF &oldBounds, const QRectF &newBounds) override;
void replaceLocalVertices(const QVector<QPointF> &local) override;
protected:
QJsonObject typeSpecificToJson() const override;
void typeSpecificFromJson(const QJsonObject &obj) override;
private:
QVector<QPointF> m_points;
bool m_closed = false;
};
#endif // POLYLINESHAPE_H