-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineShape.h
More file actions
29 lines (22 loc) · 879 Bytes
/
Copy pathLineShape.h
File metadata and controls
29 lines (22 loc) · 879 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
#ifndef LINESHAPE_H
#define LINESHAPE_H
#include "Shape.h"
/// Single segment line (two endpoints, local coordinates).
class LineShape : public Shape
{
public:
QString shapeType() const override { return "Line"; }
std::unique_ptr<Shape> clone() const override;
QVector<QPointF> vertices() const override { return m_points; }
void setEndpointsFromScene(const QPointF &start, const QPointF &end);
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:
void setLocalPoints(const QVector<QPointF> &local);
QVector<QPointF> m_points;
};
#endif // LINESHAPE_H