-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmfreehand.h
35 lines (30 loc) · 846 Bytes
/
tmfreehand.h
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
#ifndef TMFREEHAND_H
#define TMFREEHAND_H
#include "tmshape.h"
#include <QVector>
#include <QListWidget>
class TMFreeHand : public TMShape
{
public:
TMFreeHand();
void draw(QPainter *painter, QListWidget *dsList) override;
bool hasPoint(QPoint point) override;
bool isSelected() override;
void setSelection(bool) override;
void moveShapeBy(int dx, int dy) override;
int getShapeCode() override;
QJsonValue toJson() override;
void fromJSON(QJsonObject) override;
QVector<QPoint> getPoints() const;
void setPoints(const QVector<QPoint> &value);
void addPoint(QPoint);
QPen getPen() const;
void setPen(const QPen &value);
private:
QVector<QPoint> points;
QPen pen;
bool select = false;
int FREE_HAND = 0;
double distance(QPoint a, QPoint b);
};
#endif // TMFREEHAND_H