-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdx_data.h
69 lines (58 loc) · 2.65 KB
/
dx_data.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
/******************************************************************************
** dwg2dxf - Program to convert dwg/dxf to dxf(ascii & binary) **
** **
** Copyright (C) 2015 José F. Soriano, rallazz@gmail.com **
** **
** This library is free software, licensed under the terms of the GNU **
** General Public License as published by the Free Software Foundation, **
** either version 2 of the License, or (at your option) any later version. **
** You should have received a copy of the GNU General Public License **
** along with this program. If not, see <http://www.gnu.org/licenses/>. **
******************************************************************************/
#ifndef DX_DATA_H
#define DX_DATA_H
#include <libdxfrw.h>
#include <list>
//class to store image data and path from DRW_ImageDef
class dx_ifaceImg : public DRW_Image {
public:
dx_ifaceImg(){}
dx_ifaceImg(const DRW_Image& p):DRW_Image(p){}
~dx_ifaceImg(){}
std::string path; //stores the image path
};
//container class to store entites.
class dx_ifaceBlock : public DRW_Block {
public:
dx_ifaceBlock(){}
dx_ifaceBlock(const DRW_Block& p):DRW_Block(p){}
~dx_ifaceBlock(){
for (std::list<DRW_Entity*>::const_iterator it=ent.begin(); it!=ent.end(); ++it)
delete *it;
}
std::list<DRW_Entity*>ent; //stores the entities list
};
//container class to store full dwg/dxf data.
class dx_data {
public:
dx_data(){
mBlock = new dx_ifaceBlock();
}
~dx_data(){
//cleanup,
for (std::list<dx_ifaceBlock*>::const_iterator it=blocks.begin(); it!=blocks.end(); ++it)
delete *it;
delete mBlock;
}
DRW_Header headerC; //stores a copy of the header vars
std::list<DRW_LType>lineTypes; //stores a copy of all line types
std::list<DRW_Layer>layers; //stores a copy of all layers
std::list<DRW_Dimstyle>dimStyles; //stores a copy of all dimension styles
std::list<DRW_Vport>VPorts; //stores a copy of all vports
std::list<DRW_Textstyle>textStyles; //stores a copy of all text styles
std::list<DRW_AppId>appIds; //stores a copy of all line types
std::list<dx_ifaceBlock*>blocks; //stores a copy of all blocks and the entities in it
std::list<dx_ifaceImg*>images; //temporary list to find images for link with DRW_ImageDef. Do not delete it!!
dx_ifaceBlock* mBlock; //container to store model entities
};
#endif // DX_DATA_H