-
Notifications
You must be signed in to change notification settings - Fork 1
/
svglayer.h
84 lines (63 loc) · 1.36 KB
/
svglayer.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
73
74
75
76
77
78
79
80
81
82
83
84
/************************************************************************/
/*
DESC: 定义SVG图层.
DATE: 2016-03-31
AUTHOR: YUANLS
*/
/************************************************************************/
#ifndef __SVGLAYER_H__
#define __SVGLAYER_H__
#include "textsvg.h"
#include "basedev.h"
class SvgLayer
{
public:
SvgLayer()
{
m_id = "";
m_x = 0;
m_y = 0;
}
~SvgLayer()
{
for (int i = 0;i<m_devList.size();i++)
{
BaseDevice* pdev = m_devList.at(i);
delete pdev;
pdev = NULL;
}
}
QString getId(){return m_id;}
void setId(QString id){m_id = id;}
QString getFill(){return m_fill;}
void setFill(QString fill){m_fill = fill;}
int getHeight(){return m_height;}
void setHeight(int h){m_height = h;}
int getWidth(){return m_width;}
void setWidth(int w){m_width = w;}
int getX(){return m_x;}
void setX(int x){m_x = x;}
int getY(){return m_y;}
void setY(int y){m_y = y;}
// 获取设备列表的引用
QList<BaseDevice*> & getDevList(){return m_devList;}
QList<TextSvg*>& getTextList(){return m_textList;}
private:
// 图层ID
QString m_id;
// x
int m_x;
// y
int m_y;
// 宽
int m_width;
// 高
int m_height;
// 背景
QString m_fill;
// 设备列表
QList<BaseDevice*> m_devList;
// 文本图元列表
QList<TextSvg*> m_textList;
};
#endif