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 addXLine(const DL_XLineData& data) = 0;
94 
96  virtual void addRay(const DL_RayData& data) = 0;
97 
99  virtual void addArc(const DL_ArcData& data) = 0;
100 
102  virtual void addCircle(const DL_CircleData& data) = 0;
103 
105  virtual void addEllipse(const DL_EllipseData& data) = 0;
106 
108  virtual void addPolyline(const DL_PolylineData& data) = 0;
109 
111  virtual void addVertex(const DL_VertexData& data) = 0;
112 
114  virtual void addSpline(const DL_SplineData& data) = 0;
115 
117  virtual void addControlPoint(const DL_ControlPointData& data) = 0;
118 
120  virtual void addFitPoint(const DL_FitPointData& data) = 0;
121 
123  virtual void addKnot(const DL_KnotData& data) = 0;
124 
126  virtual void addInsert(const DL_InsertData& data) = 0;
127 
129  virtual void addTrace(const DL_TraceData& data) = 0;
130 
132  virtual void add3dFace(const DL_3dFaceData& data) = 0;
133 
135  virtual void addSolid(const DL_SolidData& data) = 0;
136 
137 
139  virtual void addMText(const DL_MTextData& data) = 0;
140 
146  virtual void addMTextChunk(const std::string& text) = 0;
147 
149  virtual void addText(const DL_TextData& data) = 0;
150 
154  virtual void addDimAlign(const DL_DimensionData& data,
155  const DL_DimAlignedData& edata) = 0;
159  virtual void addDimLinear(const DL_DimensionData& data,
160  const DL_DimLinearData& edata) = 0;
161 
165  virtual void addDimRadial(const DL_DimensionData& data,
166  const DL_DimRadialData& edata) = 0;
167 
171  virtual void addDimDiametric(const DL_DimensionData& data,
172  const DL_DimDiametricData& edata) = 0;
173 
177  virtual void addDimAngular(const DL_DimensionData& data,
178  const DL_DimAngularData& edata) = 0;
179 
183  virtual void addDimAngular3P(const DL_DimensionData& data,
184  const DL_DimAngular3PData& edata) = 0;
185 
189  virtual void addDimOrdinate(const DL_DimensionData& data,
190  const DL_DimOrdinateData& edata) = 0;
191 
195  virtual void addLeader(const DL_LeaderData& data) = 0;
196 
200  virtual void addLeaderVertex(const DL_LeaderVertexData& data) = 0;
201 
205  virtual void addHatch(const DL_HatchData& data) = 0;
206 
210  virtual void addImage(const DL_ImageData& data) = 0;
211 
215  virtual void linkImage(const DL_ImageDefData& data) = 0;
216 
220  virtual void addHatchLoop(const DL_HatchLoopData& data) = 0;
221 
225  virtual void addHatchEdge(const DL_HatchEdgeData& data) = 0;
226 
230  virtual void addXRecord(const std::string& handle) = 0;
231 
235  virtual void addXRecordString(int code, const std::string& value) = 0;
236 
240  virtual void addXRecordReal(int code, double value) = 0;
241 
245  virtual void addXRecordInt(int code, int value) = 0;
246 
250  virtual void addXRecordBool(int code, bool value) = 0;
251 
255  virtual void addXDataApp(const std::string& appId) = 0;
256 
260  virtual void addXDataString(int code, const std::string& value) = 0;
261 
265  virtual void addXDataReal(int code, double value) = 0;
266 
270  virtual void addXDataInt(int code, int value) = 0;
271 
275  virtual void addDictionary(const DL_DictionaryData& data) = 0;
276 
280  virtual void addDictionaryEntry(const DL_DictionaryEntryData& data) = 0;
281 
285  virtual void endEntity() = 0;
286 
290  virtual void addComment(const std::string& comment) = 0;
291 
295  virtual void setVariableVector(const std::string& key, double v1, double v2, double v3, int code) = 0;
296 
300  virtual void setVariableString(const std::string& key, const std::string& value, int code) = 0;
301 
305  virtual void setVariableInt(const std::string& key, int value, int code) = 0;
306 
310  virtual void setVariableDouble(const std::string& key, double value, int code) = 0;
311 
312 #ifdef DL_COMPAT
313  virtual void setVariableVector(const char* key, double v1, double v2, double v3, int code) = 0;
314  virtual void setVariableString(const char* key, const char* value, int code) = 0;
315  virtual void setVariableInt(const char* key, int value, int code) = 0;
316  virtual void setVariableDouble(const char* key, double value, int code) = 0;
317  virtual void processCodeValuePair(unsigned int groupCode, char* groupValue) = 0;
318  virtual void addComment(const char* comment) = 0;
319  virtual void addMTextChunk(const char* text) = 0;
320 #endif
321 
325  virtual void endSequence() = 0;
326 
328  void setAttributes(const DL_Attributes& attrib) {
329  attributes = attrib;
330  }
331 
334  return attributes;
335  }
336 
338  void setExtrusion(double dx, double dy, double dz, double elevation) {
339  extrusion->setDirection(dx, dy, dz);
340  extrusion->setElevation(elevation);
341  }
342 
345  return extrusion;
346  }
347 
348 protected:
351 };
352 
353 #endif