-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrowShape.h
More file actions
34 lines (27 loc) · 1.02 KB
/
Copy pathArrowShape.h
File metadata and controls
34 lines (27 loc) · 1.02 KB
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
#ifndef ARROWSHAPE_H
#define ARROWSHAPE_H
#include "Shape.h"
class ArrowShape : public Shape
{
public:
QString shapeType() const override { return "Arrow"; }
std::unique_ptr<Shape> clone() const override;
QVector<QPointF> vertices() const override { return m_vertices; }
double headWidth() const { return m_headWidth; }
double headLength() const { return m_headLength; }
void setParameters(double headW, double headL);
void setStartEnd(const QPointF &start, const QPointF &end);
QPointF startPoint() const;
QPointF endPoint() const;
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:
double m_headWidth = 15.0;
double m_headLength = 20.0;
QVector<QPointF> m_vertices;
};
#endif // ARROWSHAPE_H