4423
|
1 |
#ifndef DRAWMAPSCENE_H
|
|
2 |
#define DRAWMAPSCENE_H
|
|
3 |
|
|
4 |
#include <QGraphicsScene>
|
|
5 |
|
4426
|
6 |
class QGraphicsPathItem;
|
|
7 |
|
4427
|
8 |
typedef QList<QList<QPoint> > Paths;
|
|
9 |
|
4423
|
10 |
class DrawMapScene : public QGraphicsScene
|
|
11 |
{
|
|
12 |
Q_OBJECT
|
|
13 |
public:
|
|
14 |
explicit DrawMapScene(QObject *parent = 0);
|
|
15 |
|
4427
|
16 |
QByteArray encode();
|
|
17 |
|
4423
|
18 |
signals:
|
4427
|
19 |
void pathChanged();
|
4423
|
20 |
|
|
21 |
public slots:
|
4426
|
22 |
void undo();
|
4434
|
23 |
void simplify();
|
4423
|
24 |
|
|
25 |
private:
|
4424
|
26 |
QPen m_pen;
|
|
27 |
QBrush m_brush;
|
4426
|
28 |
QGraphicsPathItem * m_currPath;
|
4427
|
29 |
Paths paths;
|
4424
|
30 |
|
4423
|
31 |
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
|
|
32 |
virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
|
|
33 |
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
|
|
34 |
};
|
|
35 |
|
|
36 |
#endif // DRAWMAPSCENE_H
|