forked from OlivierDelbeke/MapGraphics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLineObject.h
More file actions
53 lines (40 loc) · 1.25 KB
/
Copy pathLineObject.h
File metadata and controls
53 lines (40 loc) · 1.25 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef LINEOBJECT_H
#define LINEOBJECT_H
#include "MapGraphics_global.h"
#include "Position.h"
#include "MapGraphicsObject.h"
#include <QColor>
class MAPGRAPHICSSHARED_EXPORT LineObject : public MapGraphicsObject
{
Q_OBJECT
public:
explicit LineObject(const Position& endA,
const Position& endB,
qreal thickness = 0.0,
bool thicknessIsZoomInvariant = false,
MapGraphicsObject *parent = 0);
virtual ~LineObject();
//pure-virtual from MapGraphicsObject
QRectF boundingRect() const;
//pure-virtual from MapGraphicsObject
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
qreal thickness() const;
void setThickness(qreal nThick);
QColor color() const;
void setColor(const QColor& color);
signals:
public slots:
void setEndPointA(const Position& pos);
void setEndPointB(const Position& pos);
void setEndPoints(const Position& a,
const Position& b);
private slots:
void updatePositionFromEndPoints();
private:
Position _a;
Position _b;
qreal _thickness;
bool _thicknessIsZoomInvariant;
QColor _color;
};
#endif // LINEOBJECT_H