-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmline.h
45 lines (32 loc) · 862 Bytes
/
tmline.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
36
37
38
39
40
41
42
43
44
45
#ifndef TMLINE_H
#define TMLINE_H
#include "tmshape.h"
#include <QListWidget>
#include <QJsonValue>
class TMLine : public TMShape
{
public:
TMLine();
void draw(QPainter *painter, QListWidget* dsList) override;
bool hasPoint(QPoint point) override;
bool isSelected() override;
void setSelection(bool value) override;
void moveShapeBy(int dx, int dy) override;
int getShapeCode() override;
QJsonValue toJson() override;
void fromJSON(QJsonObject) override;
QPoint getStart() const;
void setStart(const QPoint &value);
QPoint getEnd() const;
void setEnd(const QPoint &value);
QPen getPen() const;
void setPen(const QPen &value);
private:
QPoint start;
QPoint end;
QPen pen;
bool select = false;
int LINE = 1;
double distance(QPoint a, QPoint b);
};
#endif // TMLINE_H