-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmapperscenelayer.h
72 lines (50 loc) · 1.54 KB
/
qmapperscenelayer.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef QMAPPERSCENELAYER_H
#define QMAPPERSCENELAYER_H
#include <QGraphicsItemGroup>
#include <QGraphicsScene>
#include "customrect.h"
#include "qmapperdbmodel.h"
#define MAPPER_SCENE_CURVE 25
class QMapperSceneLayer
{
public:
QMapperSceneLayer(QGraphicsScene* parent, int offset=0);
~QMapperSceneLayer();
void setOffset(int offset = 0) {myOffset = offset;}
void updateLayer();
void redrawMapPaths();
void setMapperDbModel(QMapperDbModel* model);
void updateTempPath();
void addMap(int src_idx, int dst_idx);
void updateMapPaths();
void removeMapPaths();
void removeSigRects();
void setHovered(int rect_idx, bool is_hover);
void setAllHovered(bool is_hover);
void setTempHover(int src_idx, int dst_idx);
void setAlpha(int alpha);
void setDrawText(bool draw);
QGraphicsItemGroup* getLayerItems() {return &myGraphicsItems;}
void setRectColour(QColor col);
void setVisible(bool visible);
bool getIsVisible() {return isVisible;}
private:
QMapperDbModel *dbModel;
std::vector<CustomRect*> sigs;
QGraphicsPathItem *tempPathItem;
QPainterPath tempPath;
QPointF mapPtSrc;
QPointF mapPtDst;
std::vector<QGraphicsPathItem*> mapPathItems;
std::vector<QPointF> mapSrcs;
std::vector<QPointF> mapDsts;
std::vector<int> mapSrcIdxs;
std::vector<int> mapDstIdxs;
QGraphicsItemGroup myGraphicsItems;
QGraphicsScene* myParentScene;
QColor myRectColour;
bool isVisible;
int myAlpha;
int myOffset;
};
#endif // QMAPPERSCENELAYER_H