-
Notifications
You must be signed in to change notification settings - Fork 8
/
drw_interface.h
191 lines (151 loc) · 5.59 KB
/
drw_interface.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/******************************************************************************
** libDXFrw - Library to read/write DXF files (ascii & binary) **
** **
** Copyright (C) 2011-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 DRW_INTERFACE_H
#define DRW_INTERFACE_H
#include <cstring>
#include "drw_entities.h"
#include "drw_objects.h"
#include "drw_header.h"
/**
* Abstract class (interface) for comunicate dxfReader with the application.
* Inherit your class which takes care of the entities in the
* processed DXF file from this interface.
*
* @author Rallaz
*/
class DRW_Interface {
public:
DRW_Interface() {
}
virtual ~DRW_Interface() {
}
/** Called when header is parsed. */
virtual void addHeader(const DRW_Header *) { }
/** Called for every line Type. */
virtual void addLType(const DRW_LType &) { }
/** Called for every layer. */
virtual void addLayer(const DRW_Layer &) { }
/** Called for every dim style. */
virtual void addDimStyle(const DRW_Dimstyle &) { }
/** Called for every VPORT table. */
virtual void addVport(const DRW_Vport &) { }
/** Called for every text style. */
virtual void addTextStyle(const DRW_Textstyle &) { }
/** Called for every AppId entry. */
virtual void addAppId(const DRW_AppId &) { }
/**
* Called for every block. Note: all entities added after this
* command go into this block until endBlock() is called.
*
* @see endBlock()
*/
virtual void addBlock(const DRW_Block &) { }
/** Called to end the current block */
virtual void endBlock() { }
/** Called for every point */
virtual void addPoint(const DRW_Point &) { }
/** Called for every line */
virtual void addLine(const DRW_Line &) { }
/** Called for every ray */
virtual void addRay(const DRW_Ray &) { }
/** Called for every xline */
virtual void addXline(const DRW_Xline &) { }
/** Called for every arc */
virtual void addArc(const DRW_Arc &) { }
/** Called for every circle */
virtual void addCircle(const DRW_Circle &) { }
/** Called for every ellipse */
virtual void addEllipse(const DRW_Ellipse &) { }
/** Called for every lwpolyline */
virtual void addLWPolyline(const DRW_LWPolyline &) { }
/** Called for every polyline start */
virtual void addPolyline(const DRW_Polyline &) { }
/** Called for every spline */
virtual void addSpline(const DRW_Spline *) { }
/** Called for every spline knot value */
virtual void addKnot(const DRW_Entity &) { }
/** Called for every insert. */
virtual void addInsert(const DRW_Insert &) { }
/** Called for every trace start */
virtual void addTrace(const DRW_Trace &) { }
/** Called for every 3dface start */
virtual void add3dFace(const DRW_3Dface &) { }
/** Called for every solid start */
virtual void addSolid(const DRW_Solid &) { }
/** Called for every Multi Text entity. */
virtual void addMText(const DRW_MText &) { }
/** Called for every Text entity. */
virtual void addText(const DRW_Text &) { }
/**
* Called for every aligned dimension entity.
*/
virtual void addDimAlign(const DRW_DimAligned *) { }
/**
* Called for every linear or rotated dimension entity.
*/
virtual void addDimLinear(const DRW_DimLinear *) { }
/**
* Called for every radial dimension entity.
*/
virtual void addDimRadial(const DRW_DimRadial *) { }
/**
* Called for every diametric dimension entity.
*/
virtual void addDimDiametric(const DRW_DimDiametric *) { }
/**
* Called for every angular dimension (2 lines version) entity.
*/
virtual void addDimAngular(const DRW_DimAngular *) { }
/**
* Called for every angular dimension (3 points version) entity.
*/
virtual void addDimAngular3P(const DRW_DimAngular3p *) { }
/**
* Called for every ordinate dimension entity.
*/
virtual void addDimOrdinate(const DRW_DimOrdinate *) { }
/**
* Called for every leader start.
*/
virtual void addLeader(const DRW_Leader *) { }
/**
* Called for every hatch entity.
*/
virtual void addHatch(const DRW_Hatch *) { }
/**
* Called for every viewport entity.
*/
virtual void addViewport(const DRW_Viewport &) { }
/**
* Called for every image entity.
*/
virtual void addImage(const DRW_Image *) { }
/**
* Called for every image definition.
*/
virtual void linkImage(const DRW_ImageDef *) { }
/**
* Called for every comment in the DXF file (code 999).
*/
virtual void addComment(const char *) { }
virtual void writeHeader(DRW_Header &) { }
virtual void writeBlocks() { }
virtual void writeBlockRecords() { }
virtual void writeEntities() { }
virtual void writeLTypes() { }
virtual void writeLayers() { }
virtual void writeTextstyles() { }
virtual void writeVports() { }
virtual void writeDimstyles() { }
virtual void writeAppId() { }
};
#endif