QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dl_creationinterface.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved.
3 **
4 ** This file is part of the dxflib project.
5 **
6 ** This file is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
10 **
11 ** Licensees holding valid dxflib Professional Edition licenses may use
12 ** this file in accordance with the dxflib Commercial License
13 ** Agreement provided with the Software.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** See http://www.ribbonsoft.com for further details.
19 **
20 ** Contact info@ribbonsoft.com if any conditions of this licensing are
21 ** not clear to you.
22 **
23 **********************************************************************/
24 
25 #ifndef DL_CREATIONINTERFACE_H
26 #define DL_CREATIONINTERFACE_H
27 
28 #include "dl_global.h"
29 
30 #include <string.h>
31 
32 #include "dl_attributes.h"
33 #include "dl_codes.h"
34 #include "dl_entities.h"
35 #include "dl_extrusion.h"
36 
48 public:
50  extrusion = new DL_Extrusion;
51  }
53  delete extrusion;
54  }
55 
60  virtual void processCodeValuePair(unsigned int groupCode, const std::string& groupValue) = 0;
61 
65  virtual void endSection() = 0;
66 
70  virtual void addLayer(const DL_LayerData& data) = 0;
71 
75  virtual void addLinetype(const DL_LinetypeData& data) = 0;
76 
80  virtual void addLinetypeDash(double length) = 0;
81 
88  virtual void addBlock(const DL_BlockData& data) = 0;
89 
91  virtual void endBlock() = 0;
92 
94  virtual void addTextStyle(const DL_StyleData& data) = 0;
95 
97  virtual void addPoint(const DL_PointData& data) = 0;
98 
100  virtual void addLine(const DL_LineData& data) = 0;
101 
103  virtual void addXLine(const DL_XLineData& data) = 0;
104 
106  virtual void addRay(const DL_RayData& data) = 0;
107 
109  virtual void addArc(const DL_ArcData& data) = 0;
110 
112  virtual void addCircle(const DL_CircleData& data) = 0;
113 
115  virtual void addEllipse(const DL_EllipseData& data) = 0;
116 
118  virtual void addPolyline(const DL_PolylineData& data) = 0;
119 
121  virtual void addVertex(const DL_VertexData& data) = 0;
122 
124  virtual void addSpline(const DL_SplineData& data) = 0;
125 
127  virtual void addControlPoint(const DL_ControlPointData& data) = 0;
128 
130  virtual void addFitPoint(const DL_FitPointData& data) = 0;
131 
133  virtual void addKnot(const DL_KnotData& data) = 0;
134 
136  virtual void addInsert(const DL_InsertData& data) = 0;
137 
139  virtual void addTrace(const DL_TraceData& data) = 0;
140 
142  virtual void add3dFace(const DL_3dFaceData& data) = 0;
143 
145  virtual void addSolid(const DL_SolidData& data) = 0;
146 
147 
149  virtual void addMText(const DL_MTextData& data) = 0;
150 
156  virtual void addMTextChunk(const std::string& text) = 0;
157 
159  virtual void addText(const DL_TextData& data) = 0;
160 
162  virtual void addAttribute(const DL_AttributeData& data) = 0;
163 
167  virtual void addDimAlign(const DL_DimensionData& data,
168  const DL_DimAlignedData& edata) = 0;
172  virtual void addDimLinear(const DL_DimensionData& data,
173  const DL_DimLinearData& edata) = 0;
174 
178  virtual void addDimRadial(const DL_DimensionData& data,
179  const DL_DimRadialData& edata) = 0;
180 
184  virtual void addDimDiametric(const DL_DimensionData& data,
185  const DL_DimDiametricData& edata) = 0;
186 
190  virtual void addDimAngular(const DL_DimensionData& data,
191  const DL_DimAngularData& edata) = 0;
192 
196  virtual void addDimAngular3P(const DL_DimensionData& data,
197  const DL_DimAngular3PData& edata) = 0;
198 
202  virtual void addDimOrdinate(const DL_DimensionData& data,
203  const DL_DimOrdinateData& edata) = 0;
204 
208  virtual void addLeader(const DL_LeaderData& data) = 0;
209 
213  virtual void addLeaderVertex(const DL_LeaderVertexData& data) = 0;
214 
218  virtual void addHatch(const DL_HatchData& data) = 0;
219 
223  virtual void addImage(const DL_ImageData& data) = 0;
224 
228  virtual void linkImage(const DL_ImageDefData& data) = 0;
229 
233  virtual void addHatchLoop(const DL_HatchLoopData& data) = 0;
234 
238  virtual void addHatchEdge(const DL_HatchEdgeData& data) = 0;
239 
243  virtual void addXRecord(const std::string& handle) = 0;
244 
248  virtual void addXRecordString(int code, const std::string& value) = 0;
249 
253  virtual void addXRecordReal(int code, double value) = 0;
254 
258  virtual void addXRecordInt(int code, int value) = 0;
259 
263  virtual void addXRecordBool(int code, bool value) = 0;
264 
268  virtual void addXDataApp(const std::string& appId) = 0;
269 
273  virtual void addXDataString(int code, const std::string& value) = 0;
274 
278  virtual void addXDataReal(int code, double value) = 0;
279 
283  virtual void addXDataInt(int code, int value) = 0;
284 
288  virtual void addDictionary(const DL_DictionaryData& data) = 0;
289 
293  virtual void addDictionaryEntry(const DL_DictionaryEntryData& data) = 0;
294 
298  virtual void endEntity() = 0;
299 
303  virtual void addComment(const std::string& comment) = 0;
304 
308  virtual void setVariableVector(const std::string& key, double v1, double v2, double v3, int code) = 0;
309 
313  virtual void setVariableString(const std::string& key, const std::string& value, int code) = 0;
314 
318  virtual void setVariableInt(const std::string& key, int value, int code) = 0;
319 
323  virtual void setVariableDouble(const std::string& key, double value, int code) = 0;
324 
325 #ifdef DL_COMPAT
326  virtual void setVariableVector(const char* key, double v1, double v2, double v3, int code) = 0;
327  virtual void setVariableString(const char* key, const char* value, int code) = 0;
328  virtual void setVariableInt(const char* key, int value, int code) = 0;
329  virtual void setVariableDouble(const char* key, double value, int code) = 0;
330  virtual void processCodeValuePair(unsigned int groupCode, char* groupValue) = 0;
331  virtual void addComment(const char* comment) = 0;
332  virtual void addMTextChunk(const char* text) = 0;
333 #endif
334 
338  virtual void endSequence() = 0;
339 
341  void setAttributes(const DL_Attributes& attrib) {
342  attributes = attrib;
343  }
344 
347  return attributes;
348  }
349 
351  void setExtrusion(double dx, double dy, double dz, double elevation) {
352  extrusion->setDirection(dx, dy, dz);
353  extrusion->setElevation(elevation);
354  }
355 
358  return extrusion;
359  }
360 
361 protected:
364 };
365 
366 #endif