44 #define M_PI 3.14159265358979323846
45 #pragma warning(disable : 4800)
49 #define M_PI 3.1415926535897932384626433832795
53 #define DL_NANDOUBLE std::numeric_limits<double>::quiet_NaN()
59 #define DL_VERSION "3.17.0.0"
61 #define DL_VERSION_MAJOR 3
62 #define DL_VERSION_MINOR 17
63 #define DL_VERSION_REV 0
64 #define DL_VERSION_BUILD 0
70 #define DL_LINETYPE 13
73 #define DL_ENTITY_POINT 100
74 #define DL_ENTITY_LINE 101
75 #define DL_ENTITY_POLYLINE 102
76 #define DL_ENTITY_LWPOLYLINE 103
77 #define DL_ENTITY_VERTEX 104
78 #define DL_ENTITY_SPLINE 105
79 #define DL_ENTITY_KNOT 106
80 #define DL_ENTITY_CONTROLPOINT 107
81 #define DL_ENTITY_ARC 108
82 #define DL_ENTITY_CIRCLE 109
83 #define DL_ENTITY_ELLIPSE 110
84 #define DL_ENTITY_INSERT 111
85 #define DL_ENTITY_TEXT 112
86 #define DL_ENTITY_MTEXT 113
87 #define DL_ENTITY_DIMENSION 114
88 #define DL_ENTITY_LEADER 115
89 #define DL_ENTITY_HATCH 116
90 #define DL_ENTITY_ATTRIB 117
91 #define DL_ENTITY_IMAGE 118
92 #define DL_ENTITY_IMAGEDEF 119
93 #define DL_ENTITY_TRACE 120
94 #define DL_ENTITY_SOLID 121
95 #define DL_ENTITY_3DFACE 122
96 #define DL_ENTITY_XLINE 123
97 #define DL_ENTITY_RAY 124
98 #define DL_ENTITY_ARCALIGNEDTEXT 125
99 #define DL_ENTITY_SEQEND 126
100 #define DL_XRECORD 200
101 #define DL_DICTIONARY 210
127 static bool getStrippedLine(std::string& s,
130 bool stripSpace =
true);
132 bool readDxfGroups(std::stringstream& stream,
135 static bool getStrippedLine(std::string& s,
137 std::stringstream& stream,
138 bool stripSpace =
true);
140 static bool stripWhiteSpace(
char** s,
bool stripSpaces =
true);
144 const std::string& groupValue);
197 const std::string& comment);
349 const std::string& appDictionaryName =
"");
351 int writeDictionaryEntry(
DL_WriterA& dw,
const std::string&
name);
352 void writeXRecord(
DL_WriterA& dw,
int handle,
int value);
353 void writeXRecord(
DL_WriterA& dw,
int handle,
double value);
354 void writeXRecord(
DL_WriterA& dw,
int handle,
bool value);
355 void writeXRecord(
DL_WriterA& dw,
int handle,
const std::string& value);
358 void writeComment(
DL_WriterA& dw,
const std::string& comment);
394 int getLibVersion(
const std::string& str);
398 bool hasValue(
int code) {
return values.count(code) == 1; }
401 if (!hasValue(code)) {
404 return toInt(values[code]);
409 return strtol(str.c_str(), &p, 10);
413 if (!hasValue(code)) {
416 return toInt16(values[code]);
421 return strtol(str.c_str(), &p, 16);
426 return (
bool)strtol(str.c_str(), &p, 10);
430 if (!hasValue(code)) {
437 if (!hasValue(code)) {
440 return toReal(values[code]);
446 std::string str2 = str;
447 std::replace(str2.begin(), str2.end(),
',',
'.');
449 std::istringstream istr(str2);
458 std::string polylineLayer;
470 double* controlPoints;
471 int maxControlPoints;
472 int controlPointIndex;
478 double* leaderVertices;
479 int maxLeaderVertices;
480 int leaderVertexIndex;
484 std::vector<std::vector<DL_HatchEdgeData>> hatchEdges;
486 std::string xRecordHandle;
490 std::string groupCodeTmp;
492 unsigned int groupCode;
494 std::string groupValue;
496 int currentObjectType;
500 std::string settingKey;
502 std::map<int, std::string> values;
511 unsigned long appDictionaryHandle;
513 unsigned long styleHandleStd;
double toReal(const std::string &str)
DL_Codes::version getVersion()
int toInt(const std::string &str)
int getInt16Value(int code, int def)
int toInt16(const std::string &str)
int getIntValue(int code, int def)
double getRealValue(int code, double def)
bool toBool(const std::string &str)
std::string getStringValue(int code, const std::string &def)