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 
78  virtual void addBlock(const DL_BlockData& data) = 0;
79 
81  virtual void endBlock() = 0;
82 
84  virtual void addTextStyle(const DL_StyleData& data) = 0;
85 
87  virtual void addPoint(const DL_PointData& data) = 0;
88 
90  virtual void addLine(const DL_LineData& data) = 0;
91 
93  virtual void addArc(const DL_ArcData& data) = 0;
94 
96  virtual void addCircle(const DL_CircleData& data) = 0;
97 
99  virtual void addEllipse(const DL_EllipseData& data) = 0;
100 
102  virtual void addPolyline(const DL_PolylineData& data) = 0;
103 
105  virtual void addVertex(const DL_VertexData& data) = 0;
106 
108  virtual void addSpline(const DL_SplineData& data) = 0;
109 
111  virtual void addControlPoint(const DL_ControlPointData& data) = 0;
112 
114  virtual void addFitPoint(const DL_FitPointData& data) = 0;
115 
117  virtual void addKnot(const DL_KnotData& data) = 0;
118 
120  virtual void addInsert(const DL_InsertData& data) = 0;
121 
123  virtual void addTrace(const DL_TraceData& data) = 0;
124 
126  virtual void add3dFace(const DL_3dFaceData& data) = 0;
127 
129  virtual void addSolid(const DL_SolidData& data) = 0;
130 
131 
133  virtual void addMText(const DL_MTextData& data) = 0;
134 
140  virtual void addMTextChunk(const std::string& text) = 0;
141 
143  virtual void addText(const DL_TextData& data) = 0;
144 
148  virtual void addDimAlign(const DL_DimensionData& data,
149  const DL_DimAlignedData& edata) = 0;
153  virtual void addDimLinear(const DL_DimensionData& data,
154  const DL_DimLinearData& edata) = 0;
155 
159  virtual void addDimRadial(const DL_DimensionData& data,
160  const DL_DimRadialData& edata) = 0;
161 
165  virtual void addDimDiametric(const DL_DimensionData& data,
166  const DL_DimDiametricData& edata) = 0;
167 
171  virtual void addDimAngular(const DL_DimensionData& data,
172  const DL_DimAngularData& edata) = 0;
173 
177  virtual void addDimAngular3P(const DL_DimensionData& data,
178  const DL_DimAngular3PData& edata) = 0;
179 
183  virtual void addDimOrdinate(const DL_DimensionData& data,
184  const DL_DimOrdinateData& edata) = 0;
185 
189  virtual void addLeader(const DL_LeaderData& data) = 0;
190 
194  virtual void addLeaderVertex(const DL_LeaderVertexData& data) = 0;
195 
199  virtual void addHatch(const DL_HatchData& data) = 0;
200 
204  virtual void addImage(const DL_ImageData& data) = 0;
205 
209  virtual void linkImage(const DL_ImageDefData& data) = 0;
210 
214  virtual void addHatchLoop(const DL_HatchLoopData& data) = 0;
215 
219  virtual void addHatchEdge(const DL_HatchEdgeData& data) = 0;
220 
224  virtual void addXRecord(const std::string& handle) = 0;
225 
229  virtual void addXRecordString(int code, const std::string& value) = 0;
230 
234  virtual void addXRecordReal(int code, double value) = 0;
235 
239  virtual void addXRecordInt(int code, int value) = 0;
240 
244  virtual void addXRecordBool(int code, bool value) = 0;
245 
249  virtual void addXDataApp(const std::string& appId) = 0;
250 
254  virtual void addXDataString(int code, const std::string& value) = 0;
255 
259  virtual void addXDataReal(int code, double value) = 0;
260 
264  virtual void addXDataInt(int code, int value) = 0;
265 
269  virtual void addDictionary(const DL_DictionaryData& data) = 0;
270 
274  virtual void addDictionaryEntry(const DL_DictionaryEntryData& data) = 0;
275 
279  virtual void endEntity() = 0;
280 
284  virtual void addComment(const std::string& comment) = 0;
285 
289  virtual void setVariableVector(const std::string& key, double v1, double v2, double v3, int code) = 0;
290 
294  virtual void setVariableString(const std::string& key, const std::string& value, int code) = 0;
295 
299  virtual void setVariableInt(const std::string& key, int value, int code) = 0;
300 
304  virtual void setVariableDouble(const std::string& key, double value, int code) = 0;
305 
306 #ifdef DL_COMPAT
307  virtual void setVariableVector(const char* key, double v1, double v2, double v3, int code) = 0;
308  virtual void setVariableString(const char* key, const char* value, int code) = 0;
309  virtual void setVariableInt(const char* key, int value, int code) = 0;
310  virtual void setVariableDouble(const char* key, double value, int code) = 0;
311  virtual void processCodeValuePair(unsigned int groupCode, char* groupValue) = 0;
312  virtual void addComment(const char* comment) = 0;
313  virtual void addMTextChunk(const char* text) = 0;
314 #endif
315 
319  virtual void endSequence() = 0;
320 
322  void setAttributes(const DL_Attributes& attrib) {
323  attributes = attrib;
324  }
325 
328  return attributes;
329  }
330 
332  void setExtrusion(double dx, double dy, double dz, double elevation) {
333  extrusion->setDirection(dx, dy, dz);
334  extrusion->setElevation(elevation);
335  }
336 
339  return extrusion;
340  }
341 
342 protected:
345 };
346 
347 #endif