Commit 3e3869ed authored by jean-pierre charras's avatar jean-pierre charras

dxf import: minor enhancements in dialog. Update libdfxw from git, and...

dxf import: minor enhancements in dialog. Update libdfxw from git, and uncrustify it. add a test dfx file
parent f0b2565f
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <string> #include <string>
#include <cmath> #include <cmath>
using std::string;
#define UTF8STRING std::string #define UTF8STRING std::string
#define DRW_UNUSED( x ) (void) x #define DRW_UNUSED( x ) (void) x
...@@ -203,7 +201,7 @@ public: ...@@ -203,7 +201,7 @@ public:
// string codepage; // string codepage;
private: private:
// DRW_VarContent content; // DRW_VarContent content;
string data; std::string data;
}; };
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
class dxfReader; class dxfReader;
class DRW_Polyline; class DRW_Polyline;
using std::string;
namespace DRW { namespace DRW {
// ! Entity's type. // ! Entity's type.
enum ETYPE { enum ETYPE {
...@@ -123,7 +121,7 @@ public: ...@@ -123,7 +121,7 @@ public:
double ltypeScale; /*!< linetype scale, code 48 */ double ltypeScale; /*!< linetype scale, code 48 */
bool visible; /*!< entity visibility, code 60 */ bool visible; /*!< entity visibility, code 60 */
int color24; /*!< 24-bit color, code 420 */ int color24; /*!< 24-bit color, code 420 */
string colorName; /*!< color name, code 430 */ std::string colorName; /*!< color name, code 430 */
int space; /*!< space indicator 0 = model, 1 paper, code 67*/ int space; /*!< space indicator 0 = model, 1 paper, code 67*/
bool haveExtrusion; /*!< set to true if the entity have extrusion*/ bool haveExtrusion; /*!< set to true if the entity have extrusion*/
private: private:
...@@ -891,7 +889,7 @@ public: ...@@ -891,7 +889,7 @@ public:
void parseCode( int code, dxfReader* reader ); void parseCode( int code, dxfReader* reader );
public: public:
string ref; /*!< Hard reference to imagedef object, code 340 */ std::string ref; /*!< Hard reference to imagedef object, code 340 */
double vx; /*!< V-vector of single pixel, x coordinate, code 12 */ double vx; /*!< V-vector of single pixel, x coordinate, code 12 */
double vy; /*!< V-vector of single pixel, y coordinate, code 22 */ double vy; /*!< V-vector of single pixel, y coordinate, code 22 */
double vz; /*!< V-vector of single pixel, z coordinate, code 32 */ double vz; /*!< V-vector of single pixel, z coordinate, code 32 */
...@@ -960,14 +958,14 @@ public: ...@@ -960,14 +958,14 @@ public:
void setDefPoint( const DRW_Coord p ) { defPoint = p; } void setDefPoint( const DRW_Coord p ) { defPoint = p; }
DRW_Coord getTextPoint() const { return textPoint; } /*!< Middle point of text, code 11, 21 & 31 */ DRW_Coord getTextPoint() const { return textPoint; } /*!< Middle point of text, code 11, 21 & 31 */
void setTextPoint( const DRW_Coord p ) { textPoint = p; } void setTextPoint( const DRW_Coord p ) { textPoint = p; }
string getStyle() const { return style; } /*!< Dimension style, code 3 */ std::string getStyle() const { return style; } /*!< Dimension style, code 3 */
void setStyle( const string s ) { style = s; } void setStyle( const std::string s ) { style = s; }
int getAlign() const { return align; } /*!< attachment point, code 71 */ int getAlign() const { return align; } /*!< attachment point, code 71 */
void setAlign( const int a ) { align = a; } void setAlign( const int a ) { align = a; }
int getTextLineStyle() const { return linesty; } /*!< Dimension text line spacing style, code 72, default 1 */ int getTextLineStyle() const { return linesty; } /*!< Dimension text line spacing style, code 72, default 1 */
void setTextLineStyle( const int l ) { linesty = l; } void setTextLineStyle( const int l ) { linesty = l; }
string getText() const { return text; } /*!< Dimension text explicitly entered by the user, code 1 */ std::string getText() const { return text; } /*!< Dimension text explicitly entered by the user, code 1 */
void setText( const string t ) { text = t; } void setText( const std::string t ) { text = t; }
double getTextLineFactor() const { return linefactor; } /*!< Dimension text line spacing factor, code 41, default 1? */ double getTextLineFactor() const { return linefactor; } /*!< Dimension text line spacing factor, code 41, default 1? */
void setTextLineFactor( const double l ) { linefactor = l; } void setTextLineFactor( const double l ) { linefactor = l; }
double getDir() const { return rot; } /*!< rotation angle of the dimension text, code 53 (optional) default 0 */ double getDir() const { return rot; } /*!< rotation angle of the dimension text, code 53 (optional) default 0 */
...@@ -975,8 +973,8 @@ public: ...@@ -975,8 +973,8 @@ public:
DRW_Coord getExtrusion() { return extPoint; } /*!< extrusion, code 210, 220 & 230 */ DRW_Coord getExtrusion() { return extPoint; } /*!< extrusion, code 210, 220 & 230 */
void setExtrusion( const DRW_Coord p ) { extPoint = p; } void setExtrusion( const DRW_Coord p ) { extPoint = p; }
string getName() { return name; } /*!< Name of the block that contains the entities, code 2 */ std::string getName() { return name; } /*!< Name of the block that contains the entities, code 2 */
void setName( const string s ) { name = s; } void setName( const std::string s ) { name = s; }
// int getType(){ return type;} /*!< Dimension type, code 70 */ // int getType(){ return type;} /*!< Dimension type, code 70 */
protected: protected:
DRW_Coord getPt2() const { return clonePoint; } DRW_Coord getPt2() const { return clonePoint; }
...@@ -998,7 +996,7 @@ protected: ...@@ -998,7 +996,7 @@ protected:
public: public:
int type; /*!< Dimension type, code 70 */ int type; /*!< Dimension type, code 70 */
private: private:
string name; /*!< Name of the block that contains the entities, code 2 */ std::string name; /*!< Name of the block that contains the entities, code 2 */
DRW_Coord defPoint; /*!< definition point, code 10, 20 & 30 (WCS) */ DRW_Coord defPoint; /*!< definition point, code 10, 20 & 30 (WCS) */
DRW_Coord textPoint; /*!< Middle point of text, code 11, 21 & 31 (OCS) */ DRW_Coord textPoint; /*!< Middle point of text, code 11, 21 & 31 (OCS) */
UTF8STRING text; /*!< Dimension text explicitly entered by the user, code 1 */ UTF8STRING text; /*!< Dimension text explicitly entered by the user, code 1 */
...@@ -1253,7 +1251,7 @@ public: ...@@ -1253,7 +1251,7 @@ public:
double textwidth; /*!< Text annotation width, code 41 */ double textwidth; /*!< Text annotation width, code 41 */
int vertnum; /*!< Number of vertices, code 76 */ int vertnum; /*!< Number of vertices, code 76 */
int coloruse; /*!< Color to use if leader's DIMCLRD = BYBLOCK, code 77 */ int coloruse; /*!< Color to use if leader's DIMCLRD = BYBLOCK, code 77 */
string handle; /*!< Hard reference to associated annotation, code 340 */ std::string handle; /*!< Hard reference to associated annotation, code 340 */
DRW_Coord extrusionPoint; /*!< Normal vector, code 210, 220 & 230 */ DRW_Coord extrusionPoint; /*!< Normal vector, code 210, 220 & 230 */
DRW_Coord horizdir; /*!< "Horizontal" direction for leader, code 211, 221 & 231 */ DRW_Coord horizdir; /*!< "Horizontal" direction for leader, code 211, 221 & 231 */
DRW_Coord offsetblock; /*!< Offset of last leader vertex from block, code 212, 222 & 232 */ DRW_Coord offsetblock; /*!< Offset of last leader vertex from block, code 212, 222 & 232 */
......
...@@ -679,7 +679,7 @@ void DRW_ImageDef::parseCode( int code, dxfReader* reader ) ...@@ -679,7 +679,7 @@ void DRW_ImageDef::parseCode( int code, dxfReader* reader )
} }
void DRW_Header::addComment( string c ) void DRW_Header::addComment( std::string c )
{ {
if( !comments.empty() ) if( !comments.empty() )
comments += '\n'; comments += '\n';
...@@ -858,6 +858,9 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver ) ...@@ -858,6 +858,9 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver )
writer->writeString( 1, varStr ); writer->writeString( 1, varStr );
writer->setVersion( &varStr ); writer->setVersion( &varStr );
getStr( "$ACADVER", &varStr );
getStr( "$ACADMAINTVER", &varStr );
if( ver > DRW::AC1012 ) if( ver > DRW::AC1012 )
{ {
writer->writeString( 9, "$HANDSEED" ); writer->writeString( 9, "$HANDSEED" );
...@@ -970,6 +973,18 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver ) ...@@ -970,6 +973,18 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver )
else else
writer->writeString( 7, "STANDARD" ); writer->writeString( 7, "STANDARD" );
writer->writeString( 9, "$CLAYER" );
if( getStr( "$CLAYER", &varStr ) )
if( ver == DRW::AC1009 )
writer->writeUtf8Caps( 8, varStr );
else
writer->writeUtf8String( 8, varStr );
else
writer->writeString( 8, "0" );
writer->writeString( 9, "$DIMASZ" ); writer->writeString( 9, "$DIMASZ" );
if( getDouble( "$DIMASZ", &varDouble ) ) if( getDouble( "$DIMASZ", &varDouble ) )
...@@ -977,6 +992,13 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver ) ...@@ -977,6 +992,13 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver )
else else
writer->writeDouble( 40, 2.5 ); writer->writeDouble( 40, 2.5 );
writer->writeString( 9, "$DIMLFAC" );
if( getDouble( "$DIMLFAC", &varDouble ) )
writer->writeDouble( 40, varDouble );
else
writer->writeDouble( 40, 1.0 );
writer->writeString( 9, "$DIMSCALE" ); writer->writeString( 9, "$DIMSCALE" );
if( getDouble( "$DIMSCALE", &varDouble ) ) if( getDouble( "$DIMSCALE", &varDouble ) )
...@@ -1210,16 +1232,20 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver ) ...@@ -1210,16 +1232,20 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver )
writer->writeDouble( 40, 0.0 ); writer->writeDouble( 40, 0.0 );
} }
#ifdef DRW_DBG
std::map<std::string, DRW_Variant*>::const_iterator it; std::map<std::string, DRW_Variant*>::const_iterator it;
for( it = vars.begin(); it != vars.end(); it++ ) for( it = vars.begin(); it != vars.end(); it++ )
{ {
// QString key = QString::fromStdString((*it).first);
std::cerr << (*it).first << std::endl; std::cerr << (*it).first << std::endl;
} }
#endif
} }
bool DRW_Header::getDouble( string key, double* varDouble ) bool DRW_Header::getDouble( std::string key, double* varDouble )
{ {
bool result = false; bool result = false;
std::map<std::string, DRW_Variant*>::iterator it; std::map<std::string, DRW_Variant*>::iterator it;
...@@ -1243,7 +1269,7 @@ bool DRW_Header::getDouble( string key, double* varDouble ) ...@@ -1243,7 +1269,7 @@ bool DRW_Header::getDouble( string key, double* varDouble )
} }
bool DRW_Header::getInt( string key, int* varInt ) bool DRW_Header::getInt( std::string key, int* varInt )
{ {
bool result = false; bool result = false;
std::map<std::string, DRW_Variant*>::iterator it; std::map<std::string, DRW_Variant*>::iterator it;
...@@ -1267,7 +1293,7 @@ bool DRW_Header::getInt( string key, int* varInt ) ...@@ -1267,7 +1293,7 @@ bool DRW_Header::getInt( string key, int* varInt )
} }
bool DRW_Header::getStr( string key, std::string* varStr ) bool DRW_Header::getStr( std::string key, std::string* varStr )
{ {
bool result = false; bool result = false;
std::map<std::string, DRW_Variant*>::iterator it; std::map<std::string, DRW_Variant*>::iterator it;
...@@ -1291,7 +1317,7 @@ bool DRW_Header::getStr( string key, std::string* varStr ) ...@@ -1291,7 +1317,7 @@ bool DRW_Header::getStr( string key, std::string* varStr )
} }
bool DRW_Header::getCoord( string key, DRW_Coord* varCoord ) bool DRW_Header::getCoord( std::string key, DRW_Coord* varCoord )
{ {
bool result = false; bool result = false;
std::map<std::string, DRW_Variant*>::iterator it; std::map<std::string, DRW_Variant*>::iterator it;
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
class dxfReader; class dxfReader;
class dxfWriter; class dxfWriter;
using std::string;
namespace DRW { namespace DRW {
// ! Table entries type. // ! Table entries type.
enum TTYPE { enum TTYPE {
...@@ -241,8 +239,8 @@ public: ...@@ -241,8 +239,8 @@ public:
int color24; /*!< 24-bit color, code 420 */ int color24; /*!< 24-bit color, code 420 */
bool plotF; /*!< Plot flag, code 290 */ bool plotF; /*!< Plot flag, code 290 */
enum DRW_LW_Conv::lineWidth lWeight; /*!< layer lineweight, code 370 */ enum DRW_LW_Conv::lineWidth lWeight; /*!< layer lineweight, code 370 */
string handlePlotS; /*!< Hard-pointer ID/handle of plotstyle, code 390 */ std::string handlePlotS; /*!< Hard-pointer ID/handle of plotstyle, code 390 */
string handlePlotM; /*!< Hard-pointer ID/handle of materialstyle, code 347 */ std::string handlePlotM; /*!< Hard-pointer ID/handle of materialstyle, code 347 */
}; };
// ! Class to handle text style entries // ! Class to handle text style entries
...@@ -359,7 +357,7 @@ public: ...@@ -359,7 +357,7 @@ public:
void parseCode( int code, dxfReader* reader ); void parseCode( int code, dxfReader* reader );
public: public:
string handle; /*!< entity identifier, code 5 */ std::string handle; /*!< entity identifier, code 5 */
UTF8STRING name; /*!< File name of image, code 1 */ UTF8STRING name; /*!< File name of image, code 1 */
int version; /*!< class version, code 90, 0=R14 version */ int version; /*!< class version, code 90, 0=R14 version */
double u; /*!< image size in pixels U value, code 10 */ double u; /*!< image size in pixels U value, code 10 */
...@@ -369,7 +367,7 @@ public: ...@@ -369,7 +367,7 @@ public:
int loaded; /*!< image is loaded flag, code 280, 0=unloaded, 1=loaded */ int loaded; /*!< image is loaded flag, code 280, 0=unloaded, 1=loaded */
int resolution; /*!< resolution units, code 281, 0=no, 2=centimeters, 5=inch */ int resolution; /*!< resolution units, code 281, 0=no, 2=centimeters, 5=inch */
std::map<string, string> reactors; std::map<std::string, std::string> reactors;
}; };
...@@ -392,20 +390,20 @@ public: ...@@ -392,20 +390,20 @@ public:
void parseCode( int code, dxfReader* reader ); void parseCode( int code, dxfReader* reader );
void write( dxfWriter* writer, DRW::Version ver ); void write( dxfWriter* writer, DRW::Version ver );
void addComment( string c ); void addComment( std::string c );
string getComments() const { return comments; } std::string getComments() const { return comments; }
private: private:
bool getDouble( string key, double* varDouble ); bool getDouble( std::string key, double* varDouble );
bool getInt( string key, int* varInt ); bool getInt( std::string key, int* varInt );
bool getStr( string key, string* varStr ); bool getStr( std::string key, std::string* varStr );
bool getCoord( string key, DRW_Coord* varStr ); bool getCoord( std::string key, DRW_Coord* varStr );
public: public:
std::map<string, DRW_Variant*> vars; std::map<std::string, DRW_Variant*> vars;
private: private:
string comments; std::string comments;
string name; std::string name;
DRW_Variant* curr; DRW_Variant* curr;
int version; // to use on read int version; // to use on read
}; };
......
...@@ -9,241 +9,332 @@ ...@@ -9,241 +9,332 @@
#include "drw_cptable949.h" #include "drw_cptable949.h"
#include "drw_cptable950.h" #include "drw_cptable950.h"
DRW_TextCodec::DRW_TextCodec() { DRW_TextCodec::DRW_TextCodec()
{
version = DRW::AC1021; version = DRW::AC1021;
conv = new DRW_Converter(NULL, 0); conv = new DRW_Converter( NULL, 0 );
} }
DRW_TextCodec::~DRW_TextCodec() {
DRW_TextCodec::~DRW_TextCodec()
{
delete conv; delete conv;
} }
void DRW_TextCodec::setVersion(std::string *v){
void DRW_TextCodec::setVersion( std::string* v )
{
std::string versionStr = *v; std::string versionStr = *v;
if (versionStr == "AC1009" || versionStr == "AC1006") {
if( versionStr == "AC1009" || versionStr == "AC1006" )
{
version = DRW::AC1009; version = DRW::AC1009;
cp = "ANSI_1252"; cp = "ANSI_1252";
setCodePage(&cp); setCodePage( &cp );
} else if (versionStr == "AC1012" || versionStr == "AC1014" }
|| versionStr == "AC1015" || versionStr == "AC1018") { else if( versionStr == "AC1012" || versionStr == "AC1014"
|| versionStr == "AC1015" || versionStr == "AC1018" )
{
version = DRW::AC1015; version = DRW::AC1015;
if (cp.empty()) { //codepage not set, initialize
if( cp.empty() ) // codepage not set, initialize
{
cp = "ANSI_1252"; cp = "ANSI_1252";
setCodePage(&cp); setCodePage( &cp );
}
} }
} else { else
{
version = DRW::AC1021; version = DRW::AC1021;
cp = "ANSI_1252"; cp = "ANSI_1252";
} }
} }
void DRW_TextCodec::setCodePage(std::string *c){
cp = correctCodePage(*c); void DRW_TextCodec::setCodePage( std::string* c )
{
cp = correctCodePage( *c );
delete conv; delete conv;
if (version == DRW::AC1009 || version == DRW::AC1015) {
if (cp == "ANSI_874") if( version == DRW::AC1009 || version == DRW::AC1015 )
conv = new DRW_ConvTable(DRW_Table874, CPLENGHTCOMMON); {
else if (cp == "ANSI_932") if( cp == "ANSI_874" )
conv = new DRW_Conv932Table(DRW_Table932, DRW_LeadTable932, conv = new DRW_ConvTable( DRW_Table874, CPLENGHTCOMMON );
DRW_DoubleTable932, CPLENGHT932); else if( cp == "ANSI_932" )
else if (cp == "ANSI_936") conv = new DRW_Conv932Table( DRW_Table932, DRW_LeadTable932,
conv = new DRW_ConvDBCSTable(DRW_Table936, DRW_LeadTable936, DRW_DoubleTable932, CPLENGHT932 );
DRW_DoubleTable936, CPLENGHT936); else if( cp == "ANSI_936" )
else if (cp == "ANSI_949") conv = new DRW_ConvDBCSTable( DRW_Table936, DRW_LeadTable936,
conv = new DRW_ConvDBCSTable(DRW_Table949, DRW_LeadTable949, DRW_DoubleTable936, CPLENGHT936 );
DRW_DoubleTable949, CPLENGHT949); else if( cp == "ANSI_949" )
else if (cp == "ANSI_950") conv = new DRW_ConvDBCSTable( DRW_Table949, DRW_LeadTable949,
conv = new DRW_ConvDBCSTable(DRW_Table950, DRW_LeadTable950, DRW_DoubleTable949, CPLENGHT949 );
DRW_DoubleTable950, CPLENGHT950); else if( cp == "ANSI_950" )
else if (cp == "ANSI_1250") conv = new DRW_ConvDBCSTable( DRW_Table950, DRW_LeadTable950,
conv = new DRW_ConvTable(DRW_Table1250, CPLENGHTCOMMON); DRW_DoubleTable950, CPLENGHT950 );
else if (cp == "ANSI_1251") else if( cp == "ANSI_1250" )
conv = new DRW_ConvTable(DRW_Table1251, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1250, CPLENGHTCOMMON );
else if (cp == "ANSI_1253") else if( cp == "ANSI_1251" )
conv = new DRW_ConvTable(DRW_Table1253, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1251, CPLENGHTCOMMON );
else if (cp == "ANSI_1254") else if( cp == "ANSI_1253" )
conv = new DRW_ConvTable(DRW_Table1254, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1253, CPLENGHTCOMMON );
else if (cp == "ANSI_1255") else if( cp == "ANSI_1254" )
conv = new DRW_ConvTable(DRW_Table1255, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1254, CPLENGHTCOMMON );
else if (cp == "ANSI_1256") else if( cp == "ANSI_1255" )
conv = new DRW_ConvTable(DRW_Table1256, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1255, CPLENGHTCOMMON );
else if (cp == "ANSI_1257") else if( cp == "ANSI_1256" )
conv = new DRW_ConvTable(DRW_Table1257, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1256, CPLENGHTCOMMON );
else if (cp == "ANSI_1258") else if( cp == "ANSI_1257" )
conv = new DRW_ConvTable(DRW_Table1258, CPLENGHTCOMMON); conv = new DRW_ConvTable( DRW_Table1257, CPLENGHTCOMMON );
else if (cp == "UTF-8") { //DXF older than 2007 are write in win codepages else if( cp == "ANSI_1258" )
conv = new DRW_ConvTable( DRW_Table1258, CPLENGHTCOMMON );
else if( cp == "UTF-8" ) // DXF older than 2007 are write in win codepages
{
cp = "ANSI_1252"; cp = "ANSI_1252";
conv = new DRW_Converter(NULL, 0); conv = new DRW_Converter( NULL, 0 );
} else }
conv = new DRW_ConvTable(DRW_Table1252, CPLENGHTCOMMON); else
} else { conv = new DRW_ConvTable( DRW_Table1252, CPLENGHTCOMMON );
conv = new DRW_Converter(NULL, 0); }
else
{
conv = new DRW_Converter( NULL, 0 );
} }
} }
std::string DRW_TextCodec::toUtf8(std::string s) {
return conv->toUtf8(&s); std::string DRW_TextCodec::toUtf8( std::string s )
{
return conv->toUtf8( &s );
} }
std::string DRW_TextCodec::fromUtf8(std::string s) {
return conv->fromUtf8(&s); std::string DRW_TextCodec::fromUtf8( std::string s )
{
return conv->fromUtf8( &s );
} }
std::string DRW_Converter::toUtf8(std::string *s) {
std::string DRW_Converter::toUtf8( std::string* s )
{
std::string result; std::string result;
int j = 0; int j = 0;
unsigned int i= 0; unsigned int i = 0;
for (i=0; i < s->length(); i++) {
unsigned char c = s->at(i); for( i = 0; i < s->length(); i++ )
if (c < 0x80) { //ascii check for /U+???? {
if (c == '\\' && i+6 < s->length() && s->at(i+1) == 'U' && s->at(i+2) == '+') { unsigned char c = s->at( i );
result += s->substr(j,i-j);
result += encodeText(s->substr(i,7)); if( c < 0x80 ) // ascii check for /U+????
i +=6; {
j = i+1; if( c == '\\' && i + 6 < s->length() && s->at( i + 1 ) == 'U' && s->at( i + 2 ) ==
} '+' )
} else if (c < 0xE0 ) {//2 bits {
result += s->substr( j, i - j );
result += encodeText( s->substr( i, 7 ) );
i += 6;
j = i + 1;
}
}
else if( c < 0xE0 ) // 2 bits
{
i++; i++;
} else if (c < 0xF0 ) {//3 bits }
i +=2; else if( c < 0xF0 ) // 3 bits
} else if (c < 0xF8 ) {//4 bits {
i +=3; i += 2;
}
else if( c < 0xF8 ) // 4 bits
{
i += 3;
} }
} }
result += s->substr(j);
result += s->substr( j );
return result; return result;
} }
std::string DRW_ConvTable::fromUtf8(std::string *s) {
std::string DRW_ConvTable::fromUtf8( std::string* s )
{
std::string result; std::string result;
bool notFound; bool notFound;
int code; int code;
int j = 0; int j = 0;
for (unsigned int i=0; i < s->length(); i++) {
unsigned char c = s->at(i); for( unsigned int i = 0; i < s->length(); i++ )
if (c > 0x7F) { //need to decode {
result += s->substr(j,i-j); unsigned char c = s->at( i );
std::string part1 = s->substr(i,4);
if( c > 0x7F ) // need to decode
{
result += s->substr( j, i - j );
std::string part1 = s->substr( i, 4 );
int l; int l;
code = decodeNum(part1, &l); code = decodeNum( part1, &l );
j = i+l; j = i + l;
i = j - 1; i = j - 1;
notFound = true; notFound = true;
for (int k=0; k<cpLenght; k++){
if(table[k] == code) { for( int k = 0; k<cpLenght; k++ )
result += CPOFFSET + k; //translate from table {
if( table[k] == code )
{
result += CPOFFSET + k; // translate from table
notFound = false; notFound = false;
break; break;
} }
} }
if (notFound)
result += decodeText(code); if( notFound )
result += decodeText( code );
} }
} }
result += s->substr(j);
result += s->substr( j );
return result; return result;
} }
std::string DRW_ConvTable::toUtf8(std::string *s) {
std::string DRW_ConvTable::toUtf8( std::string* s )
{
std::string res; std::string res;
string::iterator it; std::string::iterator it;
for ( it=s->begin() ; it < s->end(); it++ ) {
for( it = s->begin(); it < s->end(); it++ )
{
unsigned char c = *it; unsigned char c = *it;
if (c < 0x80) {
//check for \U+ encoded text if( c < 0x80 )
if (c == '\\') { {
if (it+6 < s->end() && *(it+1) == 'U' && *(it+2) == '+') { // check for \U+ encoded text
res += encodeText(std::string(it, it+7)); if( c == '\\' )
it +=6; {
} else { if( it + 6 < s->end() && *(it + 1) == 'U' && *(it + 2) == '+' )
res +=c; //no \U+ encoded text write {
} res += encodeText( std::string( it, it + 7 ) );
} else it += 6;
res +=c; //c!='\' ascii char write }
} else {//end c < 0x80 else
res += encodeNum(table[c-0x80]); //translate from table {
} res += c; // no \U+ encoded text write
} //end for }
}
else
res += c; // c!='\' ascii char write
}
else // end c < 0x80
{
res += encodeNum( table[c - 0x80] ); // translate from table
}
} // end for
return res; return res;
} }
std::string DRW_Converter::encodeText(std::string stmp){
std::string DRW_Converter::encodeText( std::string stmp )
{
int code; int code;
#if defined(__APPLE__) #if defined(__APPLE__)
int Succeeded = sscanf (&( stmp.substr(3,4)[0]), "%x", &code ); int Succeeded = sscanf( &( stmp.substr( 3, 4 )[0]), "%x", &code );
if ( !Succeeded || Succeeded == EOF )
if( !Succeeded || Succeeded == EOF )
code = 0; code = 0;
#else #else
std::istringstream sd(stmp.substr(3,4)); std::istringstream sd( stmp.substr( 3, 4 ) );
sd >> std::hex >> code; sd >> std::hex >> code;
#endif #endif
return encodeNum(code); return encodeNum( code );
} }
std::string DRW_Converter::decodeText(int c){
std::string DRW_Converter::decodeText( int c )
{
std::string res = "\\U+"; std::string res = "\\U+";
std::string num; std::string num;
#if defined(__APPLE__) #if defined(__APPLE__)
std::string str(16, '\0'); std::string str( 16, '\0' );
snprintf (&(str[0]), 16, "%04X", c ); snprintf( &(str[0]), 16, "%04X", c );
num = str; num = str;
#else #else
std::stringstream ss; std::stringstream ss;
ss << std::uppercase << std::setfill('0') << std::setw(4) << std::hex << c; ss << std::uppercase << std::setfill( '0' ) << std::setw( 4 ) << std::hex << c;
ss >> num; ss >> num;
#endif #endif
res += num; res += num;
return res; return res;
} }
std::string DRW_Converter::encodeNum(int c){
std::string DRW_Converter::encodeNum( int c )
{
unsigned char ret[5]; unsigned char ret[5];
if (c < 128) { // 0-7F US-ASCII 7 bits
if( c < 128 ) // 0-7F US-ASCII 7 bits
{
ret[0] = c; ret[0] = c;
ret[1] = 0; ret[1] = 0;
} else if (c < 0x800) { //80-07FF 2 bytes }
else if( c < 0x800 ) // 80-07FF 2 bytes
{
ret[0] = 0xC0 | (c >> 6); ret[0] = 0xC0 | (c >> 6);
ret[1] = 0x80 | (c & 0x3f); ret[1] = 0x80 | (c & 0x3f);
ret[2] = 0; ret[2] = 0;
} else if (c< 0x10000) { //800-FFFF 3 bytes }
else if( c< 0x10000 ) // 800-FFFF 3 bytes
{
ret[0] = 0xe0 | (c >> 12); ret[0] = 0xe0 | (c >> 12);
ret[1] = 0x80 | ((c >> 6) & 0x3f); ret[1] = 0x80 | ( (c >> 6) & 0x3f );
ret[2] = 0x80 | (c & 0x3f); ret[2] = 0x80 | (c & 0x3f);
ret[3] = 0; ret[3] = 0;
} else { //10000-10FFFF 4 bytes }
else // 10000-10FFFF 4 bytes
{
ret[0] = 0xf0 | (c >> 18); ret[0] = 0xf0 | (c >> 18);
ret[1] = 0x80 | ((c >> 12) & 0x3f); ret[1] = 0x80 | ( (c >> 12) & 0x3f );
ret[2] = 0x80 | ((c >> 6) & 0x3f); ret[2] = 0x80 | ( (c >> 6) & 0x3f );
ret[3] = 0x80 | (c & 0x3f); ret[3] = 0x80 | (c & 0x3f);
ret[4] = 0; ret[4] = 0;
} }
return std::string((char*)ret);
return std::string( (char*) ret );
} }
/** 's' is a string with at least 4 bytes lenght /** 's' is a string with at least 4 bytes lenght
** returned 'b' is byte lenght of encoded char: 2,3 or 4 ** returned 'b' is byte lenght of encoded char: 2,3 or 4
**/ **/
int DRW_Converter::decodeNum(std::string s, int *b){ int DRW_Converter::decodeNum( std::string s, int* b )
int code= 0; {
unsigned char c = s.at(0); int code = 0;
if ( (c& 0xE0) == 0xC0) { //2 bytes unsigned char c = s.at( 0 );
code = ( c&0x1F)<<6;
code = (s.at(1) &0x3F) | code; if( (c & 0xE0) == 0xC0 ) // 2 bytes
{
code = ( c & 0x1F) << 6;
code = (s.at( 1 ) & 0x3F) | code;
*b = 2; *b = 2;
} else if ( (c& 0xF0) == 0xE0) { //3 bytes }
code = ( c&0x0F)<<12; else if( (c & 0xF0) == 0xE0 ) // 3 bytes
code = ((s.at(1) &0x3F)<<6) | code; {
code = (s.at(2) &0x3F) | code; code = ( c & 0x0F) << 12;
code = ( (s.at( 1 ) & 0x3F) << 6 ) | code;
code = (s.at( 2 ) & 0x3F) | code;
*b = 3; *b = 3;
} else if ( (c& 0xF8) == 0xF0) { //4 bytes }
code = ( c&0x07)<<18; else if( (c & 0xF8) == 0xF0 ) // 4 bytes
code = ((s.at(1) &0x3F)<<12) | code; {
code = ((s.at(2) &0x3F)<<6) | code; code = ( c & 0x07) << 18;
code = (s.at(3) &0x3F) | code; code = ( (s.at( 1 ) & 0x3F) << 12 ) | code;
code = ( (s.at( 2 ) & 0x3F) << 6 ) | code;
code = (s.at( 3 ) & 0x3F) | code;
*b = 4; *b = 4;
} }
...@@ -251,246 +342,351 @@ int DRW_Converter::decodeNum(std::string s, int *b){ ...@@ -251,246 +342,351 @@ int DRW_Converter::decodeNum(std::string s, int *b){
} }
std::string DRW_ConvDBCSTable::fromUtf8(std::string *s) { std::string DRW_ConvDBCSTable::fromUtf8( std::string* s )
{
std::string result; std::string result;
bool notFound; bool notFound;
int code; int code;
int j = 0; int j = 0;
for (unsigned int i=0; i < s->length(); i++) {
unsigned char c = s->at(i); for( unsigned int i = 0; i < s->length(); i++ )
if (c > 0x7F) { //need to decode {
result += s->substr(j,i-j); unsigned char c = s->at( i );
std::string part1 = s->substr(i,4);
if( c > 0x7F ) // need to decode
{
result += s->substr( j, i - j );
std::string part1 = s->substr( i, 4 );
int l; int l;
code = decodeNum(part1, &l); code = decodeNum( part1, &l );
j = i+l; j = i + l;
i = j - 1; i = j - 1;
notFound = true; notFound = true;
for (int k=0; k<cpLenght; k++){
if(doubleTable[k][1] == code) { for( int k = 0; k<cpLenght; k++ )
{
if( doubleTable[k][1] == code )
{
int data = doubleTable[k][0]; int data = doubleTable[k][0];
char d[3]; char d[3];
d[0] = data >> 8; d[0] = data >> 8;
d[1] = data & 0xFF; d[1] = data & 0xFF;
d[2]= '\0'; d[2] = '\0';
result += d; //translate from table result += d; // translate from table
notFound = false; notFound = false;
break; break;
} }
} }
if (notFound)
result += decodeText(code); if( notFound )
} //direct conversion result += decodeText( code );
} // direct conversion
} }
result += s->substr(j);
result += s->substr( j );
return result; return result;
} }
std::string DRW_ConvDBCSTable::toUtf8(std::string *s) {
std::string DRW_ConvDBCSTable::toUtf8( std::string* s )
{
std::string res; std::string res;
string::iterator it; std::string::iterator it;
for ( it=s->begin() ; it < s->end(); it++ ) {
for( it = s->begin(); it < s->end(); it++ )
{
bool notFound = true; bool notFound = true;
unsigned char c = *it; unsigned char c = *it;
if (c < 0x80) {
if( c < 0x80 )
{
notFound = false; notFound = false;
//check for \U+ encoded text
if (c == '\\') { // check for \U+ encoded text
if (it+6 < s->end() && *(it+1) == 'U' && *(it+2) == '+') { if( c == '\\' )
res += encodeText(std::string(it, it+7)); {
it +=6; if( it + 6 < s->end() && *(it + 1) == 'U' && *(it + 2) == '+' )
} else { {
res +=c; //no \U+ encoded text write res += encodeText( std::string( it, it + 7 ) );
} it += 6;
} else }
res +=c; //c!='\' ascii char write else
} else if(c == 0x80 ){//1 byte table {
res += c; // no \U+ encoded text write
}
}
else
res += c; // c!='\' ascii char write
}
else if( c == 0x80 ) // 1 byte table
{
notFound = false; notFound = false;
res += encodeNum(0x20AC);//euro sign res += encodeNum( 0x20AC ); // euro sign
} else {//2 bytes }
else // 2 bytes
{
++it; ++it;
int code = (c << 8) | (unsigned char )(*it); int code = (c << 8) | (unsigned char) (*it);
int sta = leadTable[c-0x81]; int sta = leadTable[c - 0x81];
int end = leadTable[c-0x80]; int end = leadTable[c - 0x80];
for (int k=sta; k<end; k++){
if(doubleTable[k][0] == code) { for( int k = sta; k<end; k++ )
res += encodeNum(doubleTable[k][1]); //translate from table {
if( doubleTable[k][0] == code )
{
res += encodeNum( doubleTable[k][1] ); // translate from table
notFound = false; notFound = false;
break; break;
} }
} }
} }
//not found
if (notFound) res += encodeNum(NOTFOUND936); // not found
} //end for if( notFound )
res += encodeNum( NOTFOUND936 );
} // end for
return res; return res;
} }
std::string DRW_Conv932Table::fromUtf8(std::string *s) {
std::string DRW_Conv932Table::fromUtf8( std::string* s )
{
std::string result; std::string result;
bool notFound; bool notFound;
int code; int code;
int j = 0; int j = 0;
for (unsigned int i=0; i < s->length(); i++) {
unsigned char c = s->at(i); for( unsigned int i = 0; i < s->length(); i++ )
if (c > 0x7F) { //need to decode {
result += s->substr(j,i-j); unsigned char c = s->at( i );
std::string part1 = s->substr(i,4);
if( c > 0x7F ) // need to decode
{
result += s->substr( j, i - j );
std::string part1 = s->substr( i, 4 );
int l; int l;
code = decodeNum(part1, &l); code = decodeNum( part1, &l );
j = i+l; j = i + l;
i = j - 1; i = j - 1;
notFound = true; notFound = true;
// 1 byte table // 1 byte table
if (code > 0xff60 && code < 0xFFA0) { if( code > 0xff60 && code < 0xFFA0 )
result += code - CPOFFSET932; //translate from table {
result += code - CPOFFSET932; // translate from table
notFound = false; notFound = false;
} }
if (notFound && ( code<0xF8 || (code>0x390 && code<0x542) ||
(code>0x200F && code<0x9FA1) || code>0xF928 )) { if( notFound && ( code<0xF8 || (code>0x390 && code<0x542)
for (int k=0; k<cpLenght; k++){ || (code>0x200F && code<0x9FA1) || code>0xF928 ) )
if(doubleTable[k][1] == code) { {
for( int k = 0; k<cpLenght; k++ )
{
if( doubleTable[k][1] == code )
{
int data = doubleTable[k][0]; int data = doubleTable[k][0];
char d[3]; char d[3];
d[0] = data >> 8; d[0] = data >> 8;
d[1] = data & 0xFF; d[1] = data & 0xFF;
d[2]= '\0'; d[2] = '\0';
result += d; //translate from table result += d; // translate from table
notFound = false; notFound = false;
break; break;
} }
} }
} }
if (notFound)
result += decodeText(code); if( notFound )
} //direct conversion result += decodeText( code );
} // direct conversion
} }
result += s->substr(j);
result += s->substr( j );
return result; return result;
} }
std::string DRW_Conv932Table::toUtf8(std::string *s) {
std::string DRW_Conv932Table::toUtf8( std::string* s )
{
std::string res; std::string res;
string::iterator it; std::string::iterator it;
for ( it=s->begin() ; it < s->end(); it++ ) {
for( it = s->begin(); it < s->end(); it++ )
{
bool notFound = true; bool notFound = true;
unsigned char c = *it; unsigned char c = *it;
if (c < 0x80) {
if( c < 0x80 )
{
notFound = false; notFound = false;
//check for \U+ encoded text
if (c == '\\') { // check for \U+ encoded text
if (it+6 < s->end() && *(it+1) == 'U' && *(it+2) == '+') { if( c == '\\' )
res += encodeText(std::string(it, it+7)); {
it +=6; if( it + 6 < s->end() && *(it + 1) == 'U' && *(it + 2) == '+' )
} else { {
res +=c; //no \U+ encoded text write res += encodeText( std::string( it, it + 7 ) );
} it += 6;
} else }
res +=c; //c!='\' ascii char write else
} else if(c > 0xA0 && c < 0xE0 ){//1 byte table {
res += c; // no \U+ encoded text write
}
}
else
res += c; // c!='\' ascii char write
}
else if( c > 0xA0 && c < 0xE0 ) // 1 byte table
{
notFound = false; notFound = false;
res += encodeNum(c + CPOFFSET932); //translate from table res += encodeNum( c + CPOFFSET932 ); // translate from table
} else {//2 bytes }
else // 2 bytes
{
++it; ++it;
int code = (c << 8) | (unsigned char )(*it); int code = (c << 8) | (unsigned char) (*it);
int sta; int sta;
int end=0; int end = 0;
if (c > 0x80 && c < 0xA0) {
sta = DRW_LeadTable932[c-0x81]; if( c > 0x80 && c < 0xA0 )
end = DRW_LeadTable932[c-0x80]; {
} else if (c > 0xDF && c < 0xFD){ sta = DRW_LeadTable932[c - 0x81];
sta = DRW_LeadTable932[c-0xC1]; end = DRW_LeadTable932[c - 0x80];
end = DRW_LeadTable932[c-0xC0]; }
} else if( c > 0xDF && c < 0xFD )
if (end > 0) { {
for (int k=sta; k<end; k++){ sta = DRW_LeadTable932[c - 0xC1];
if(DRW_DoubleTable932[k][0] == code) { end = DRW_LeadTable932[c - 0xC0];
res += encodeNum(DRW_DoubleTable932[k][1]); //translate from table }
if( end > 0 )
{
for( int k = sta; k<end; k++ )
{
if( DRW_DoubleTable932[k][0] == code )
{
res += encodeNum( DRW_DoubleTable932[k][1] ); // translate from table
notFound = false; notFound = false;
break; break;
} }
} }
} }
} }
//not found
if (notFound) res += encodeNum(NOTFOUND932); // not found
} //end for if( notFound )
res += encodeNum( NOTFOUND932 );
} // end for
return res; return res;
} }
std::string DRW_TextCodec::correctCodePage(const std::string& s) {
//stringstream cause crash in OS/X, bug#3597944 std::string DRW_TextCodec::correctCodePage( const std::string& s )
std::string cp=s; {
transform(cp.begin(), cp.end(), cp.begin(), toupper); // stringstream cause crash in OS/X, bug#3597944
//Latin/Thai std::string cp = s;
if (cp=="ANSI_874" || cp=="CP874" || cp=="ISO8859-11" || cp=="TIS-620") {
transform( cp.begin(), cp.end(), cp.begin(), toupper );
// Latin/Thai
if( cp=="ANSI_874" || cp=="CP874" || cp=="ISO8859-11" || cp=="TIS-620" )
{
return "ANSI_874"; return "ANSI_874";
//Central Europe and Eastern Europe // Central Europe and Eastern Europe
} else if (cp=="ANSI_1250" || cp=="CP1250" || cp=="ISO8859-2") { }
else if( cp=="ANSI_1250" || cp=="CP1250" || cp=="ISO8859-2" )
{
return "ANSI_1250"; return "ANSI_1250";
//Cyrillic script // Cyrillic script
} else if (cp=="ANSI_1251" || cp=="CP1251" || cp=="ISO8859-5" || cp=="KOI8-R" || }
cp=="KOI8-U" || cp=="IBM 866") { else if( cp=="ANSI_1251" || cp=="CP1251" || cp=="ISO8859-5" || cp=="KOI8-R"
|| cp=="KOI8-U" || cp=="IBM 866" )
{
return "ANSI_1251"; return "ANSI_1251";
//Western Europe // Western Europe
} else if (cp=="ANSI_1252" || cp=="CP1252" || cp=="LATIN1" || cp=="ISO-8859-1" || }
cp=="CP819" || cp=="CSISO" || cp=="IBM819" || cp=="ISO_8859-1" || cp=="APPLE ROMAN" || else if( cp=="ANSI_1252" || cp=="CP1252" || cp=="LATIN1" || cp=="ISO-8859-1"
cp=="ISO8859-1" || cp=="ISO8859-15" || cp=="ISO-IR-100" || cp=="L1" || cp=="IBM 850") { || cp=="CP819" || cp=="CSISO" || cp=="IBM819" || cp=="ISO_8859-1" || cp=="APPLE ROMAN"
|| cp=="ISO8859-1" || cp=="ISO8859-15" || cp=="ISO-IR-100" || cp=="L1" || cp==
"IBM 850" )
{
return "ANSI_1252"; return "ANSI_1252";
//Greek // Greek
} else if (cp=="ANSI_1253" || cp=="CP1253" || cp=="iso8859-7") { }
else if( cp=="ANSI_1253" || cp=="CP1253" || cp=="iso8859-7" )
{
return "ANSI_1253"; return "ANSI_1253";
//Turkish // Turkish
} else if (cp=="ANSI_1254" || cp=="CP1254" || cp=="iso8859-9" || cp=="iso8859-3") { }
else if( cp=="ANSI_1254" || cp=="CP1254" || cp=="iso8859-9" || cp=="iso8859-3" )
{
return "ANSI_1254"; return "ANSI_1254";
//Hebrew // Hebrew
} else if (cp=="ANSI_1255" || cp=="CP1255" || cp=="iso8859-8") { }
else if( cp=="ANSI_1255" || cp=="CP1255" || cp=="iso8859-8" )
{
return "ANSI_1255"; return "ANSI_1255";
//Arabic // Arabic
} else if (cp=="ANSI_1256" || cp=="CP1256" || cp=="ISO8859-6") { }
else if( cp=="ANSI_1256" || cp=="CP1256" || cp=="ISO8859-6" )
{
return "ANSI_1256"; return "ANSI_1256";
//Baltic // Baltic
} else if (cp=="ANSI_1257" || cp=="CP1257" || cp=="ISO8859-4" || cp=="ISO8859-10" || cp=="ISO8859-13") { }
else if( cp=="ANSI_1257" || cp=="CP1257" || cp=="ISO8859-4" || cp=="ISO8859-10" || cp==
"ISO8859-13" )
{
return "ANSI_1257"; return "ANSI_1257";
//Vietnamese // Vietnamese
} else if (cp=="ANSI_1258" || cp=="CP1258") { }
else if( cp=="ANSI_1258" || cp=="CP1258" )
{
return "ANSI_1258"; return "ANSI_1258";
//Japanese // Japanese
} else if (cp=="ANSI_932" || cp=="SHIFT-JIS" || cp=="SHIFT_JIS" || cp=="CSSHIFTJIS" || }
cp=="CSWINDOWS31J" || cp=="MS_KANJI" || cp=="X-MS-CP932" || cp=="X-SJIS" || else if( cp=="ANSI_932" || cp=="SHIFT-JIS" || cp=="SHIFT_JIS" || cp=="CSSHIFTJIS"
cp=="EUCJP" || cp=="EUC-JP" || cp=="CSEUCPKDFMTJAPANESE" || cp=="X-EUC" || || cp=="CSWINDOWS31J" || cp=="MS_KANJI" || cp=="X-MS-CP932" || cp=="X-SJIS"
cp=="X-EUC-JP" || cp=="JIS7") { || cp=="EUCJP" || cp=="EUC-JP" || cp=="CSEUCPKDFMTJAPANESE" || cp=="X-EUC"
|| cp=="X-EUC-JP" || cp=="JIS7" )
{
return "ANSI_932"; return "ANSI_932";
//Chinese PRC GBK (XGB) simplified // Chinese PRC GBK (XGB) simplified
} else if (cp=="ANSI_936" || cp=="GBK" || cp=="GB2312" || cp=="CHINESE" || cp=="CN-GB" || }
cp=="CSGB2312" || cp=="CSGB231280" || cp=="CSISO58BG231280" || else if( cp=="ANSI_936" || cp=="GBK" || cp=="GB2312" || cp=="CHINESE" || cp=="CN-GB"
cp=="GB_2312-80" || cp=="GB231280" || cp=="GB2312-80" || cp=="GBK" || || cp=="CSGB2312" || cp=="CSGB231280" || cp=="CSISO58BG231280"
cp=="ISO-IR-58" || cp=="GB18030") { || cp=="GB_2312-80" || cp=="GB231280" || cp=="GB2312-80" || cp=="GBK"
|| cp=="ISO-IR-58" || cp=="GB18030" )
{
return "ANSI_936"; return "ANSI_936";
//Korean // Korean
} else if (cp=="ANSI_949" || cp=="EUCKR") { }
else if( cp=="ANSI_949" || cp=="EUCKR" )
{
return "ANSI_949"; return "ANSI_949";
//Chinese Big5 (Taiwan, Hong Kong SAR) // Chinese Big5 (Taiwan, Hong Kong SAR)
} else if (cp=="ANSI_950" || cp=="BIG5" || cp=="CN-BIG5" || cp=="CSBIG5" || }
cp=="X-X-BIG5" || cp=="BIG5-HKSCS") { else if( cp=="ANSI_950" || cp=="BIG5" || cp=="CN-BIG5" || cp=="CSBIG5"
|| cp=="X-X-BIG5" || cp=="BIG5-HKSCS" )
{
return "ANSI_950"; return "ANSI_950";
//celtic // celtic
/* } else if (cp=="ISO8859-14") { /* } else if (cp=="ISO8859-14") {
return "ISO8859-14"; * return "ISO8859-14";
} else if (cp=="TSCII") { * } else if (cp=="TSCII") {
return "TSCII"; //tamil * return "TSCII"; //tamil
} else if (cp=="UTF16") { * } else if (cp=="UTF16") {
return "UTF16"; */ * return "UTF16"; */
}
} else if (cp=="UTF-8" || cp=="UTF8" || cp=="UTF88-BIT") { else if( cp=="UTF-8" || cp=="UTF8" || cp=="UTF88-BIT" )
{
return "UTF-8"; return "UTF-8";
} }
......
...@@ -10,75 +10,89 @@ class DRW_TextCodec ...@@ -10,75 +10,89 @@ class DRW_TextCodec
public: public:
DRW_TextCodec(); DRW_TextCodec();
~DRW_TextCodec(); ~DRW_TextCodec();
std::string fromUtf8(std::string s); std::string fromUtf8( std::string s );
std::string toUtf8(std::string s); std::string toUtf8( std::string s );
int getVersion(){return version;}
void setVersion(std::string *v);
void setVersion(int v){version = v;}
void setCodePage(std::string *c);
void setCodePage(std::string c){setCodePage(&c);}
std::string getCodePage(){return cp;}
int getVersion() { return version; }
void setVersion( std::string* v );
void setVersion( int v ) { version = v; }
void setCodePage( std::string* c );
void setCodePage( std::string c ) { setCodePage( &c ); }
std::string getCodePage() { return cp; }
private: private:
std::string correctCodePage(const std::string& s); std::string correctCodePage( const std::string& s );
private: private:
int version; int version;
std::string cp; std::string cp;
DRW_Converter *conv; DRW_Converter* conv;
}; };
class DRW_Converter class DRW_Converter
{ {
public: public:
DRW_Converter(const int *t, int l){table = t; DRW_Converter( const int* t, int l )
cpLenght = l;} {
virtual ~DRW_Converter(){} table = t;
virtual std::string fromUtf8(std::string *s) {return *s;} cpLenght = l;
virtual std::string toUtf8(std::string *s); }
std::string encodeText(std::string stmp);
std::string decodeText(int c); virtual ~DRW_Converter() {}
std::string encodeNum(int c); virtual std::string fromUtf8( std::string* s ) { return *s; }
int decodeNum(std::string s, int *b); virtual std::string toUtf8( std::string* s );
const int *table; std::string encodeText( std::string stmp );
std::string decodeText( int c );
std::string encodeNum( int c );
int decodeNum( std::string s, int* b );
const int* table;
int cpLenght; int cpLenght;
}; };
class DRW_ConvTable : public DRW_Converter { class DRW_ConvTable : public DRW_Converter
{
public: public:
DRW_ConvTable(const int *t, int l):DRW_Converter(t, l) {} DRW_ConvTable( const int* t, int l ) : DRW_Converter( t, l ) {}
virtual std::string fromUtf8(std::string *s); virtual std::string fromUtf8( std::string* s );
virtual std::string toUtf8(std::string *s); virtual std::string toUtf8( std::string* s );
}; };
class DRW_ConvDBCSTable : public DRW_Converter { class DRW_ConvDBCSTable : public DRW_Converter
{
public: public:
DRW_ConvDBCSTable(const int *t, const int *lt, const int dt[][2], int l):DRW_Converter(t, l) { DRW_ConvDBCSTable( const int* t, const int* lt, const int dt[][2], int l ) : DRW_Converter( t,
l )
{
leadTable = lt; leadTable = lt;
doubleTable = dt; doubleTable = dt;
} }
virtual std::string fromUtf8(std::string *s); virtual std::string fromUtf8( std::string* s );
virtual std::string toUtf8(std::string *s); virtual std::string toUtf8( std::string* s );
private: private:
const int *leadTable; const int* leadTable;
const int (*doubleTable)[2]; const int (*doubleTable)[2];
}; };
class DRW_Conv932Table : public DRW_Converter { class DRW_Conv932Table : public DRW_Converter
{
public: public:
DRW_Conv932Table(const int *t, const int *lt, const int dt[][2], int l):DRW_Converter(t, l) { DRW_Conv932Table( const int* t, const int* lt, const int dt[][2], int l ) : DRW_Converter( t,
l )
{
leadTable = lt; leadTable = lt;
doubleTable = dt; doubleTable = dt;
} }
virtual std::string fromUtf8(std::string *s); virtual std::string fromUtf8( std::string* s );
virtual std::string toUtf8(std::string *s); virtual std::string toUtf8( std::string* s );
private: private:
const int *leadTable; const int* leadTable;
const int (*doubleTable)[2]; const int (*doubleTable)[2];
}; };
#endif // DRW_TEXTCODEC_H #endif // DRW_TEXTCODEC_H
...@@ -18,246 +18,316 @@ ...@@ -18,246 +18,316 @@
#include "drw_textcodec.h" #include "drw_textcodec.h"
#ifdef DRW_DBG #ifdef DRW_DBG
#include <iostream> //for debug #include <iostream> // for debug
#define DBG(a) std::cerr << a #define DBG( a ) std::cerr << a
#else #else
#define DBG(a) #define DBG( a )
#endif #endif
bool dxfReader::readRec(int *codeData, bool skip) { bool dxfReader::readRec( int* codeData, bool skip )
{
// std::string text; // std::string text;
int code; int code;
#ifdef DRW_DBG #ifdef DRW_DBG
count = count+2; //DBG count = count + 2; // DBG
/* if (count > 10250) /* if (count > 10250)
DBG("line 10256");*/ * DBG("line 10256");*/
#endif #endif
if (!readCode(&code)) if( !readCode( &code ) )
return false; return false;
*codeData = code; *codeData = code;
if (code < 10) if( code < 10 )
readString(); readString();
else if (code < 60) else if( code < 60 )
readDouble(); readDouble();
else if (code < 80) else if( code < 80 )
readInt(); readInt();
else if (code > 89 && code < 100) //TODO this is an int 32b else if( code > 89 && code < 100 ) // TODO this is an int 32b
readInt32(); readInt32();
else if (code == 100 || code == 102 || code == 105) else if( code == 100 || code == 102 || code == 105 )
readString(); readString();
else if (code > 109 && code < 150) //skip not used at the v2012 else if( code > 109 && code < 150 ) // skip not used at the v2012
readDouble(); readDouble();
else if (code > 159 && code < 170) //skip not used at the v2012 else if( code > 159 && code < 170 ) // skip not used at the v2012
readInt64(); readInt64();
else if (code < 180) else if( code < 180 )
readInt(); readInt();
else if (code > 209 && code < 240) //skip not used at the v2012 else if( code > 209 && code < 240 ) // skip not used at the v2012
readDouble(); readDouble();
else if (code > 269 && code < 290) //skip not used at the v2012 else if( code > 269 && code < 290 ) // skip not used at the v2012
readInt(); readInt();
else if (code < 300) //TODO this is a boolean indicator, int in Binary? else if( code < 300 ) // TODO this is a boolean indicator, int in Binary?
readBool(); readBool();
else if (code < 370) else if( code < 370 )
readString(); readString();
else if (code < 390) else if( code < 390 )
readInt(); readInt();
else if (code < 400) else if( code < 400 )
readString(); readString();
else if (code < 410) else if( code < 410 )
readInt(); readInt();
else if (code < 420) else if( code < 420 )
readString(); readString();
else if (code < 430) //TODO this is an int 32b else if( code < 430 ) // TODO this is an int 32b
readInt32(); readInt32();
else if (code < 440) else if( code < 440 )
readString(); readString();
else if (code < 450) //TODO this is an int 32b else if( code < 450 ) // TODO this is an int 32b
readInt32(); readInt32();
else if (code < 460) //TODO this is long?? else if( code < 460 ) // TODO this is long??
readInt(); readInt();
else if (code < 470) //TODO this is a floating point double precision?? else if( code < 470 ) // TODO this is a floating point double precision??
readDouble(); readDouble();
else if (code < 481) else if( code < 481 )
readString(); readString();
else if (code > 998 && code < 1009) //skip not used at the v2012 else if( code > 998 && code < 1009 ) // skip not used at the v2012
readString(); readString();
else if (code < 1060) //TODO this is a floating point double precision?? else if( code < 1060 ) // TODO this is a floating point double precision??
readDouble(); readDouble();
else if (code < 1071) else if( code < 1071 )
readInt(); readInt();
else if (code == 1071) //TODO this is an int 32b else if( code == 1071 ) // TODO this is an int 32b
readInt32(); readInt32();
else if (skip) else if( skip )
//skip safely this dxf entry ( ok for ascii dxf) // skip safely this dxf entry ( ok for ascii dxf)
readString(); readString();
else else
//break in binary files because the conduct is unpredictable // break in binary files because the conduct is unpredictable
return false; return false;
return (filestr->good()); return filestr->good();
} }
int dxfReader::getHandleString(){
int dxfReader::getHandleString()
{
int res; int res;
#if defined(__APPLE__) #if defined(__APPLE__)
int Succeeded = sscanf ( strData.c_str(), "%x", &res ); int Succeeded = sscanf( strData.c_str(), "%x", &res );
if ( !Succeeded || Succeeded == EOF )
if( !Succeeded || Succeeded == EOF )
res = 0; res = 0;
#else #else
std::istringstream Convert(strData); std::istringstream Convert( strData );
if ( !(Convert >> std::hex >>res) )
if( !(Convert >> std::hex >> res) )
res = 0; res = 0;
#endif #endif
return res; return res;
} }
bool dxfReaderBinary::readCode(int *code) {
unsigned short *int16p; bool dxfReaderBinary::readCode( int* code )
{
unsigned short* int16p;
char buffer[2]; char buffer[2];
filestr->read(buffer,2);
int16p = (unsigned short *) buffer; filestr->read( buffer, 2 );
//exist a 32bits int (code 90) with 2 bytes??? int16p = (unsigned short*) buffer;
if ((*code == 90) && (*int16p>2000)){
DBG(*code); DBG(" de 16bits\n"); // exist a 32bits int (code 90) with 2 bytes???
filestr->seekg(-4, std::ios_base::cur); if( (*code == 90) && (*int16p>2000) )
filestr->read(buffer,2); {
int16p = (unsigned short *) buffer; DBG( *code ); DBG( " de 16bits\n" );
filestr->seekg( -4, std::ios_base::cur );
filestr->read( buffer, 2 );
int16p = (unsigned short*) buffer;
} }
*code = *int16p; *code = *int16p;
DBG(*code); DBG("\n"); DBG( *code ); DBG( "\n" );
return (filestr->good()); return filestr->good();
} }
bool dxfReaderBinary::readString() {
std::getline(*filestr, strData, '\0'); bool dxfReaderBinary::readString()
DBG(strData); DBG("\n"); {
return (filestr->good()); std::getline( *filestr, strData, '\0' );
DBG( strData ); DBG( "\n" );
return filestr->good();
} }
bool dxfReaderBinary::readString(std::string *text) {
std::getline(*filestr, *text, '\0'); bool dxfReaderBinary::readString( std::string* text )
DBG(*text); DBG("\n"); {
return (filestr->good()); std::getline( *filestr, *text, '\0' );
DBG( *text ); DBG( "\n" );
return filestr->good();
} }
bool dxfReaderBinary::readInt() {
bool dxfReaderBinary::readInt()
{
char buffer[2]; char buffer[2];
filestr->read(buffer,2);
intData = (int)((buffer[1] << 8) | buffer[0]); filestr->read( buffer, 2 );
DBG(intData); DBG("\n"); intData = (int) ( (buffer[1] << 8) | buffer[0] );
return (filestr->good()); DBG( intData ); DBG( "\n" );
return filestr->good();
} }
bool dxfReaderBinary::readInt32() {
unsigned int *int32p; bool dxfReaderBinary::readInt32()
{
unsigned int* int32p;
char buffer[4]; char buffer[4];
filestr->read(buffer,4);
int32p = (unsigned int *) buffer; filestr->read( buffer, 4 );
int32p = (unsigned int*) buffer;
intData = *int32p; intData = *int32p;
DBG(intData); DBG("\n"); DBG( intData ); DBG( "\n" );
return (filestr->good()); return filestr->good();
} }
bool dxfReaderBinary::readInt64() {
unsigned long long int *int64p; //64 bits integer pointer bool dxfReaderBinary::readInt64()
{
unsigned long long int* int64p; // 64 bits integer pointer
char buffer[8]; char buffer[8];
filestr->read(buffer,8);
int64p = (unsigned long long int *) buffer; filestr->read( buffer, 8 );
int64p = (unsigned long long int*) buffer;
int64 = *int64p; int64 = *int64p;
DBG(int64); DBG(" int64\n"); DBG( int64 ); DBG( " int64\n" );
return (filestr->good()); return filestr->good();
} }
bool dxfReaderBinary::readDouble() {
double *result; bool dxfReaderBinary::readDouble()
{
double* result;
char buffer[8]; char buffer[8];
filestr->read(buffer,8);
result = (double *) buffer; filestr->read( buffer, 8 );
result = (double*) buffer;
doubleData = *result; doubleData = *result;
DBG(doubleData); DBG("\n"); DBG( doubleData ); DBG( "\n" );
return (filestr->good()); return filestr->good();
} }
//saved as int or add a bool member??
bool dxfReaderBinary::readBool() { // saved as int or add a bool member??
bool dxfReaderBinary::readBool()
{
char buffer[1]; char buffer[1];
filestr->read(buffer,1);
intData = (int)(buffer[0]); filestr->read( buffer, 1 );
DBG(intData); DBG("\n"); intData = (int) (buffer[0]);
return (filestr->good()); DBG( intData ); DBG( "\n" );
return filestr->good();
} }
bool dxfReaderAscii::readCode(int *code) {
bool dxfReaderAscii::readCode( int* code )
{
std::string text; std::string text;
std::getline(*filestr, text); std::getline( *filestr, text );
*code = atoi(text.c_str());
DBG(*code); DBG("\n"); *code = atoi( text.c_str() );
return (filestr->good()); DBG( *code ); DBG( "\n" );
return filestr->good();
} }
bool dxfReaderAscii::readString(std::string *text) {
std::getline(*filestr, *text);
if (!text->empty() && text->at(text->size()-1) == '\r') bool dxfReaderAscii::readString( std::string* text )
text->erase(text->size()-1); {
return (filestr->good()); std::getline( *filestr, *text );
if( !text->empty() && text->at( text->size() - 1 ) == '\r' )
text->erase( text->size() - 1 );
return filestr->good();
} }
bool dxfReaderAscii::readString() {
std::getline(*filestr, strData); bool dxfReaderAscii::readString()
if (!strData.empty() && strData.at(strData.size()-1) == '\r') {
strData.erase(strData.size()-1); std::getline( *filestr, strData );
DBG(strData); DBG("\n");
return (filestr->good()); if( !strData.empty() && strData.at( strData.size() - 1 ) == '\r' )
strData.erase( strData.size() - 1 );
DBG( strData ); DBG( "\n" );
return filestr->good();
} }
bool dxfReaderAscii::readInt() {
bool dxfReaderAscii::readInt()
{
std::string text; std::string text;
if (readString(&text)){
intData = atoi(text.c_str()); if( readString( &text ) )
DBG(intData); DBG("\n"); {
intData = atoi( text.c_str() );
DBG( intData ); DBG( "\n" );
return true; return true;
} else }
else
return false; return false;
} }
bool dxfReaderAscii::readInt32() {
bool dxfReaderAscii::readInt32()
{
return readInt(); return readInt();
} }
bool dxfReaderAscii::readInt64() {
bool dxfReaderAscii::readInt64()
{
return readInt(); return readInt();
} }
bool dxfReaderAscii::readDouble() {
bool dxfReaderAscii::readDouble()
{
std::string text; std::string text;
if (readString(&text)){
if( readString( &text ) )
{
#if defined(__APPLE__) #if defined(__APPLE__)
int succeeded=sscanf( & (text[0]), "%lg", &doubleData); int succeeded = sscanf( &(text[0]), "%lg", &doubleData );
if(succeeded != 1) {
DBG("dxfReaderAscii::readDouble(): reading double error: "); if( succeeded != 1 )
DBG(text); {
DBG('\n'); DBG( "dxfReaderAscii::readDouble(): reading double error: " );
DBG( text );
DBG( '\n' );
} }
#else #else
std::istringstream sd(text); std::istringstream sd( text );
sd >> doubleData; sd >> doubleData;
DBG(doubleData); DBG('\n'); DBG( doubleData ); DBG( '\n' );
#endif #endif
return true; return true;
} else }
else
return false; return false;
} }
//saved as int or add a bool member??
bool dxfReaderAscii::readBool() { // saved as int or add a bool member??
bool dxfReaderAscii::readBool()
{
std::string text; std::string text;
if (readString(&text)){
intData = atoi(text.c_str()); if( readString( &text ) )
DBG(intData); DBG("\n"); {
intData = atoi( text.c_str() );
DBG( intData ); DBG( "\n" );
return true; return true;
} else }
else
return false; return false;
} }
...@@ -15,55 +15,61 @@ ...@@ -15,55 +15,61 @@
#include "drw_textcodec.h" #include "drw_textcodec.h"
class dxfReader { class dxfReader
{
public: public:
dxfReader(std::ifstream *stream){ dxfReader( std::ifstream* stream )
{
filestr = stream; filestr = stream;
#ifdef DRW_DBG #ifdef DRW_DBG
count =0; count = 0;
#endif #endif
} }
virtual ~dxfReader(){}
virtual bool readCode(int *code) = 0; //return true if sucesful (not EOF) virtual ~dxfReader() {}
virtual bool readString(std::string *text) = 0; virtual bool readCode( int* code ) = 0; // return true if sucesful (not EOF)
virtual bool readString( std::string* text ) = 0;
virtual bool readString() = 0; virtual bool readString() = 0;
bool readRec(int *code, bool skip); bool readRec( int* code, bool skip );
virtual bool readInt() = 0; virtual bool readInt() = 0;
virtual bool readInt32() = 0; virtual bool readInt32() = 0;
virtual bool readInt64() = 0; virtual bool readInt64() = 0;
virtual bool readDouble() = 0; virtual bool readDouble() = 0;
virtual bool readBool() = 0; virtual bool readBool() = 0;
std::string getString() {return strData;}
int getHandleString();//Convert hex string to int std::string getString() { return strData; }
std::string toUtf8String(std::string t) {return decoder.toUtf8(t);} int getHandleString(); // Convert hex string to int
std::string getUtf8String() {return decoder.toUtf8(strData);}
double getDouble() {return doubleData;} std::string toUtf8String( std::string t ) { return decoder.toUtf8( t ); }
int getInt32() {return intData;} std::string getUtf8String() { return decoder.toUtf8( strData ); }
unsigned long long int getInt64() {return int64;} double getDouble() { return doubleData; }
bool getBool() { return (intData==0) ? false : true;} int getInt32() { return intData; }
int getVersion(){return decoder.getVersion();} unsigned long long int getInt64() { return int64; }
void setVersion(std::string *v){decoder.setVersion(v);} bool getBool() { return (intData==0) ? false : true; }
void setCodePage(std::string *c){decoder.setCodePage(c);} int getVersion() { return decoder.getVersion(); }
std::string getCodePage(){ return decoder.getCodePage();} void setVersion( std::string* v ) { decoder.setVersion( v ); }
void setCodePage( std::string* c ) { decoder.setCodePage( c ); }
std::string getCodePage() { return decoder.getCodePage(); }
#ifdef DRW_DBG #ifdef DRW_DBG
int count;//DBG int count; // DBG
#endif #endif
protected: protected:
std::ifstream *filestr; std::ifstream* filestr;
std::string strData; std::string strData;
double doubleData; double doubleData;
signed short intData; //16 bits integer signed int intData; // 32 bits integer
unsigned long long int int64; //64 bits integer unsigned long long int int64; // 64 bits integer
private: private:
DRW_TextCodec decoder; DRW_TextCodec decoder;
}; };
class dxfReaderBinary : public dxfReader { class dxfReaderBinary : public dxfReader
{
public: public:
dxfReaderBinary(std::ifstream *stream):dxfReader(stream){ } dxfReaderBinary( std::ifstream* stream ) : dxfReader( stream ) { }
virtual ~dxfReaderBinary() {} virtual ~dxfReaderBinary() {}
virtual bool readCode(int *code); virtual bool readCode( int* code );
virtual bool readString(std::string *text); virtual bool readString( std::string* text );
virtual bool readString(); virtual bool readString();
virtual bool readInt(); virtual bool readInt();
virtual bool readInt32(); virtual bool readInt32();
...@@ -72,12 +78,13 @@ public: ...@@ -72,12 +78,13 @@ public:
virtual bool readBool(); virtual bool readBool();
}; };
class dxfReaderAscii : public dxfReader { class dxfReaderAscii : public dxfReader
{
public: public:
dxfReaderAscii(std::ifstream *stream):dxfReader(stream){ } dxfReaderAscii( std::ifstream* stream ) : dxfReader( stream ) { }
virtual ~dxfReaderAscii(){} virtual ~dxfReaderAscii() {}
virtual bool readCode(int *code); virtual bool readCode( int* code );
virtual bool readString(std::string *text); virtual bool readString( std::string* text );
virtual bool readString(); virtual bool readString();
virtual bool readInt(); virtual bool readInt();
virtual bool readDouble(); virtual bool readDouble();
......
...@@ -17,265 +17,303 @@ ...@@ -17,265 +17,303 @@
#include "dxfwriter.h" #include "dxfwriter.h"
#ifdef DRW_DBG #ifdef DRW_DBG
#include <iostream> //for debug #include <iostream> // for debug
#define DBG(a) std::cerr << a #define DBG( a ) std::cerr << a
#else #else
#define DBG(a) #define DBG( a )
#endif #endif
//RLZ TODO change std::endl to x0D x0A (13 10) // RLZ TODO change std::endl to x0D x0A (13 10)
/*bool dxfWriter::readRec(int *codeData, bool skip) { /*bool dxfWriter::readRec(int *codeData, bool skip) {
// std::string text; * // std::string text;
int code; * int code;
*
* #ifdef DRW_DBG
* count = count+2; //DBG
* #endif
*
* if (!readCode(&code))
* return false;
* codeData = code;
*
* if (code < 10)
* readString();
* else if (code < 60)
* readDouble();
* else if (code < 80)
* readInt();
* else if (code > 89 && code < 100) //TODO this is an int 32b
* readInt32();
* else if (code == 100 || code == 102 || code == 105)
* readString();
* else if (code > 109 && code < 150) //skip not used at the v2012
* readDouble();
* else if (code > 159 && code < 170) //skip not used at the v2012
* readInt64();
* else if (code < 180)
* readInt();
* else if (code > 209 && code < 240) //skip not used at the v2012
* readDouble();
* else if (code > 269 && code < 290) //skip not used at the v2012
* readInt();
* else if (code < 300) //TODO this is a boolean indicator, int in Binary?
* readBool();
* else if (code < 370)
* readString();
* else if (code < 390)
* readInt();
* else if (code < 400)
* readString();
* else if (code < 410)
* readInt();
* else if (code < 420)
* readString();
* else if (code < 430) //TODO this is an int 32b
* readInt32();
* else if (code < 440)
* readString();
* else if (code < 450) //TODO this is an int 32b
* readInt32();
* else if (code < 460) //TODO this is long??
* readInt();
* else if (code < 470) //TODO this is a floating point double precision??
* readDouble();
* else if (code < 481)
* readString();
* else if (code > 998 && code < 1009) //skip not used at the v2012
* readString();
* else if (code < 1060) //TODO this is a floating point double precision??
* readDouble();
* else if (code < 1071)
* readInt();
* else if (code == 1071) //TODO this is an int 32b
* readInt32();
* else if (skip)
* //skip safely this dxf entry ( ok for ascii dxf)
* readString();
* else
* //break in binary files because the conduct is unpredictable
* return false;
*
* return (filestr->good());
* }*/
#ifdef DRW_DBG bool dxfWriter::writeUtf8String( int code, std::string text )
count = count+2; //DBG {
#endif std::string t = encoder.fromUtf8( text );
if (!readCode(&code)) return writeString( code, t );
return false;
*codeData = code;
if (code < 10)
readString();
else if (code < 60)
readDouble();
else if (code < 80)
readInt();
else if (code > 89 && code < 100) //TODO this is an int 32b
readInt32();
else if (code == 100 || code == 102 || code == 105)
readString();
else if (code > 109 && code < 150) //skip not used at the v2012
readDouble();
else if (code > 159 && code < 170) //skip not used at the v2012
readInt64();
else if (code < 180)
readInt();
else if (code > 209 && code < 240) //skip not used at the v2012
readDouble();
else if (code > 269 && code < 290) //skip not used at the v2012
readInt();
else if (code < 300) //TODO this is a boolean indicator, int in Binary?
readBool();
else if (code < 370)
readString();
else if (code < 390)
readInt();
else if (code < 400)
readString();
else if (code < 410)
readInt();
else if (code < 420)
readString();
else if (code < 430) //TODO this is an int 32b
readInt32();
else if (code < 440)
readString();
else if (code < 450) //TODO this is an int 32b
readInt32();
else if (code < 460) //TODO this is long??
readInt();
else if (code < 470) //TODO this is a floating point double precision??
readDouble();
else if (code < 481)
readString();
else if (code > 998 && code < 1009) //skip not used at the v2012
readString();
else if (code < 1060) //TODO this is a floating point double precision??
readDouble();
else if (code < 1071)
readInt();
else if (code == 1071) //TODO this is an int 32b
readInt32();
else if (skip)
//skip safely this dxf entry ( ok for ascii dxf)
readString();
else
//break in binary files because the conduct is unpredictable
return false;
return (filestr->good());
}*/
bool dxfWriter::writeUtf8String(int code, std::string text) {
std::string t = encoder.fromUtf8(text);
return writeString(code, t);
} }
bool dxfWriter::writeUtf8Caps(int code, std::string text) {
bool dxfWriter::writeUtf8Caps( int code, std::string text )
{
std::string strname = text; std::string strname = text;
std::transform(strname.begin(), strname.end(), strname.begin(),::toupper); std::transform( strname.begin(), strname.end(), strname.begin(), ::toupper );
std::string t = encoder.fromUtf8(strname); std::string t = encoder.fromUtf8( strname );
return writeString(code, t);
return writeString( code, t );
} }
bool dxfWriterBinary::writeString(int code, std::string text) {
bool dxfWriterBinary::writeString( int code, std::string text )
{
char bufcode[2]; char bufcode[2];
bufcode[0] =code & 0xFF;
bufcode[1] =code >> 8; bufcode[0] = code & 0xFF;
filestr->write(bufcode, 2); bufcode[1] = code >> 8;
filestr->write( bufcode, 2 );
*filestr << text << '\0'; *filestr << text << '\0';
return (filestr->good()); return filestr->good();
} }
/*bool dxfWriterBinary::readCode(int *code) {
unsigned short *int16p;
char buffer[2];
filestr->read(buffer,2);
int16p = (unsigned short *) buffer;
//exist a 32bits int (code 90) with 2 bytes???
if ((*code == 90) && (*int16p>2000)){
DBG(*code); DBG(" de 16bits\n");
filestr->seekg(-4, std::ios_base::cur);
filestr->read(buffer,2);
int16p = (unsigned short *) buffer;
}
*code = *int16p;
DBG(*code); DBG("\n");
return (filestr->good()); /*bool dxfWriterBinary::readCode(int *code) {
}*/ * unsigned short *int16p;
* char buffer[2];
* filestr->read(buffer,2);
* int16p = (unsigned short *) buffer;
* //exist a 32bits int (code 90) with 2 bytes???
* if ((*code == 90) && (*int16p>2000)){
* DBG(*code); DBG(" de 16bits\n");
* filestr->seekg(-4, std::ios_base::cur);
* filestr->read(buffer,2);
* int16p = (unsigned short *) buffer;
* }
* code = *int16p;
* DBG(*code); DBG("\n");
*
* return (filestr->good());
* }*/
/*bool dxfWriterBinary::readString() { /*bool dxfWriterBinary::readString() {
std::getline(*filestr, strData, '\0'); * std::getline(*filestr, strData, '\0');
DBG(strData); DBG("\n"); * DBG(strData); DBG("\n");
return (filestr->good()); * return (filestr->good());
}*/ * }*/
/*bool dxfWriterBinary::readString(std::string *text) { /*bool dxfWriterBinary::readString(std::string *text) {
std::getline(*filestr, *text, '\0'); * std::getline(*filestr, *text, '\0');
DBG(*text); DBG("\n"); * DBG(*text); DBG("\n");
return (filestr->good()); * return (filestr->good());
}*/ * }*/
bool dxfWriterBinary::writeInt16(int code, int data) { bool dxfWriterBinary::writeInt16( int code, int data )
{
char bufcode[2]; char bufcode[2];
char buffer[2]; char buffer[2];
bufcode[0] =code & 0xFF;
bufcode[1] =code >> 8; bufcode[0] = code & 0xFF;
buffer[0] =data & 0xFF; bufcode[1] = code >> 8;
buffer[1] =data >> 8; buffer[0] = data & 0xFF;
filestr->write(bufcode, 2); buffer[1] = data >> 8;
filestr->write(buffer, 2); filestr->write( bufcode, 2 );
return (filestr->good()); filestr->write( buffer, 2 );
return filestr->good();
} }
bool dxfWriterBinary::writeInt32(int code, int data) {
bool dxfWriterBinary::writeInt32( int code, int data )
{
char buffer[4]; char buffer[4];
buffer[0] =code & 0xFF;
buffer[1] =code >> 8; buffer[0] = code & 0xFF;
filestr->write(buffer, 2); buffer[1] = code >> 8;
filestr->write( buffer, 2 );
buffer[0] =data & 0xFF;
buffer[1] =data >> 8; buffer[0] = data & 0xFF;
buffer[2] =data >> 16; buffer[1] = data >> 8;
buffer[3] =data >> 24; buffer[2] = data >> 16;
filestr->write(buffer, 4); buffer[3] = data >> 24;
return (filestr->good()); filestr->write( buffer, 4 );
return filestr->good();
} }
bool dxfWriterBinary::writeInt64(int code, unsigned long long int data) {
bool dxfWriterBinary::writeInt64( int code, unsigned long long int data )
{
char buffer[8]; char buffer[8];
buffer[0] =code & 0xFF;
buffer[1] =code >> 8; buffer[0] = code & 0xFF;
filestr->write(buffer, 2); buffer[1] = code >> 8;
filestr->write( buffer, 2 );
buffer[0] =data & 0xFF;
buffer[1] =data >> 8; buffer[0] = data & 0xFF;
buffer[2] =data >> 16; buffer[1] = data >> 8;
buffer[3] =data >> 24; buffer[2] = data >> 16;
buffer[4] =data >> 32; buffer[3] = data >> 24;
buffer[5] =data >> 40; buffer[4] = data >> 32;
buffer[6] =data >> 48; buffer[5] = data >> 40;
buffer[7] =data >> 56; buffer[6] = data >> 48;
filestr->write(buffer, 8); buffer[7] = data >> 56;
return (filestr->good()); filestr->write( buffer, 8 );
return filestr->good();
} }
bool dxfWriterBinary::writeDouble(int code, double data) {
bool dxfWriterBinary::writeDouble( int code, double data )
{
char bufcode[2]; char bufcode[2];
char buffer[8]; char buffer[8];
bufcode[0] =code & 0xFF;
bufcode[1] =code >> 8; bufcode[0] = code & 0xFF;
filestr->write(bufcode, 2); bufcode[1] = code >> 8;
filestr->write( bufcode, 2 );
unsigned char *val;
val = (unsigned char *) &data; unsigned char* val;
for (int i=0; i<8; i++) { val = (unsigned char*) &data;
buffer[i] =val[i];
for( int i = 0; i<8; i++ )
{
buffer[i] = val[i];
} }
filestr->write(buffer, 8);
return (filestr->good()); filestr->write( buffer, 8 );
return filestr->good();
} }
//saved as int or add a bool member??
bool dxfWriterBinary::writeBool(int code, bool data) { // saved as int or add a bool member??
bool dxfWriterBinary::writeBool( int code, bool data )
{
char buffer[1]; char buffer[1];
char bufcode[2]; char bufcode[2];
bufcode[0] =code & 0xFF;
bufcode[1] =code >> 8; bufcode[0] = code & 0xFF;
filestr->write(bufcode, 2); bufcode[1] = code >> 8;
filestr->write( bufcode, 2 );
buffer[0] = data; buffer[0] = data;
filestr->write(buffer, 1); filestr->write( buffer, 1 );
return (filestr->good()); return filestr->good();
} }
bool dxfWriterAscii::writeString(int code, std::string text) {
*filestr << code << std::endl << text << std::endl ; bool dxfWriterAscii::writeString( int code, std::string text )
{
*filestr << code << std::endl << text << std::endl;
/* std::getline(*filestr, strData, '\0'); /* std::getline(*filestr, strData, '\0');
DBG(strData); DBG("\n");*/ * DBG(strData); DBG("\n");*/
return (filestr->good()); return filestr->good();
} }
/*bool dxfWriterAscii::readCode(int *code) { /*bool dxfWriterAscii::readCode(int *code) {
std::string text; * std::string text;
std::getline(*filestr, text); * std::getline(*filestr, text);
*code = atoi(text.c_str()); * code = atoi(text.c_str());
DBG(*code); DBG("\n"); * DBG(*code); DBG("\n");
return (filestr->good()); * return (filestr->good());
}*/ * }*/
/*bool dxfWriterAscii::readString(std::string *text) { /*bool dxfWriterAscii::readString(std::string *text) {
std::getline(*filestr, *text); * std::getline(*filestr, *text);
if (text->at(text->size()-1) == '\r') * if (text->at(text->size()-1) == '\r')
text->erase(text->size()-1); * text->erase(text->size()-1);
return (filestr->good()); * return (filestr->good());
}*/ * }*/
/*bool dxfWriterAscii::readString() { /*bool dxfWriterAscii::readString() {
std::getline(*filestr, strData); * std::getline(*filestr, strData);
if (strData.at(strData.size()-1) == '\r') * if (strData.at(strData.size()-1) == '\r')
strData.erase(strData.size()-1); * strData.erase(strData.size()-1);
DBG(strData); DBG("\n"); * DBG(strData); DBG("\n");
return (filestr->good()); * return (filestr->good());
}*/ * }*/
bool dxfWriterAscii::writeInt16(int code, int data) { bool dxfWriterAscii::writeInt16( int code, int data )
{
// *filestr << code << "\r\n" << data << "\r\n"; // *filestr << code << "\r\n" << data << "\r\n";
*filestr << code << std::endl << data << std::endl; *filestr << code << std::endl << data << std::endl;
return (filestr->good()); return filestr->good();
} }
bool dxfWriterAscii::writeInt32(int code, int data) {
return writeInt16(code, data); bool dxfWriterAscii::writeInt32( int code, int data )
{
return writeInt16( code, data );
} }
bool dxfWriterAscii::writeInt64(int code, unsigned long long int data) {
bool dxfWriterAscii::writeInt64( int code, unsigned long long int data )
{
*filestr << code << std::endl << data << std::endl; *filestr << code << std::endl << data << std::endl;
return (filestr->good()); return filestr->good();
} }
bool dxfWriterAscii::writeDouble(int code, double data) {
bool dxfWriterAscii::writeDouble( int code, double data )
{
std::streamsize prec = filestr->precision(); std::streamsize prec = filestr->precision();
filestr->precision(12);
filestr->precision( 12 );
*filestr << code << std::endl << data << std::endl; *filestr << code << std::endl << data << std::endl;
filestr->precision(prec); filestr->precision( prec );
return (filestr->good()); return filestr->good();
} }
//saved as int or add a bool member??
bool dxfWriterAscii::writeBool(int code, bool data) { // saved as int or add a bool member??
bool dxfWriterAscii::writeBool( int code, bool data )
{
*filestr << code << std::endl << data << std::endl; *filestr << code << std::endl << data << std::endl;
return (filestr->good()); return filestr->good();
} }
...@@ -15,50 +15,55 @@ ...@@ -15,50 +15,55 @@
#include "drw_textcodec.h" #include "drw_textcodec.h"
class dxfWriter { class dxfWriter
{
public: public:
dxfWriter(std::ofstream *stream){filestr = stream; /*count =0;*/} dxfWriter( std::ofstream* stream ) { filestr = stream; /*count =0;*/ }
virtual ~dxfWriter(){} virtual ~dxfWriter() {}
virtual bool writeString(int code, std::string text) = 0; virtual bool writeString( int code, std::string text ) = 0;
bool writeUtf8String(int code, std::string text); bool writeUtf8String( int code, std::string text );
bool writeUtf8Caps(int code, std::string text); bool writeUtf8Caps( int code, std::string text );
std::string fromUtf8String(std::string t) {return encoder.fromUtf8(t);}
virtual bool writeInt16(int code, int data) = 0; std::string fromUtf8String( std::string t ) { return encoder.fromUtf8( t ); }
virtual bool writeInt32(int code, int data) = 0; virtual bool writeInt16( int code, int data ) = 0;
virtual bool writeInt64(int code, unsigned long long int data) = 0; virtual bool writeInt32( int code, int data ) = 0;
virtual bool writeDouble(int code, double data) = 0; virtual bool writeInt64( int code, unsigned long long int data ) = 0;
virtual bool writeBool(int code, bool data) = 0; virtual bool writeDouble( int code, double data ) = 0;
void setVersion(std::string *v){encoder.setVersion(v);} virtual bool writeBool( int code, bool data ) = 0;
void setCodePage(std::string *c){encoder.setCodePage(c);}
std::string getCodePage(){return encoder.getCodePage();} void setVersion( std::string* v ) { encoder.setVersion( v ); }
void setCodePage( std::string* c ) { encoder.setCodePage( c ); }
std::string getCodePage() { return encoder.getCodePage(); }
protected: protected:
std::ofstream *filestr; std::ofstream* filestr;
private: private:
DRW_TextCodec encoder; DRW_TextCodec encoder;
}; };
class dxfWriterBinary : public dxfWriter { class dxfWriterBinary : public dxfWriter
{
public: public:
dxfWriterBinary(std::ofstream *stream):dxfWriter(stream){ } dxfWriterBinary( std::ofstream* stream ) : dxfWriter( stream ) { }
virtual ~dxfWriterBinary() {} virtual ~dxfWriterBinary() {}
virtual bool writeString(int code, std::string text); virtual bool writeString( int code, std::string text );
virtual bool writeInt16(int code, int data); virtual bool writeInt16( int code, int data );
virtual bool writeInt32(int code, int data); virtual bool writeInt32( int code, int data );
virtual bool writeInt64(int code, unsigned long long int data); virtual bool writeInt64( int code, unsigned long long int data );
virtual bool writeDouble(int code, double data); virtual bool writeDouble( int code, double data );
virtual bool writeBool(int code, bool data); virtual bool writeBool( int code, bool data );
}; };
class dxfWriterAscii : public dxfWriter { class dxfWriterAscii : public dxfWriter
{
public: public:
dxfWriterAscii(std::ofstream *stream):dxfWriter(stream){ } dxfWriterAscii( std::ofstream* stream ) : dxfWriter( stream ) { }
virtual ~dxfWriterAscii(){} virtual ~dxfWriterAscii() {}
virtual bool writeString(int code, std::string text); virtual bool writeString( int code, std::string text );
virtual bool writeInt16(int code, int data); virtual bool writeInt16( int code, int data );
virtual bool writeInt32(int code, int data); virtual bool writeInt32( int code, int data );
virtual bool writeInt64(int code, unsigned long long int data); virtual bool writeInt64( int code, unsigned long long int data );
virtual bool writeDouble(int code, double data); virtual bool writeDouble( int code, double data );
virtual bool writeBool(int code, bool data); virtual bool writeBool( int code, bool data );
}; };
#endif // DXFWRITER_H #endif // DXFWRITER_H
...@@ -215,7 +215,7 @@ bool dxfRW::writeEntity( DRW_Entity* ent ) ...@@ -215,7 +215,7 @@ bool dxfRW::writeEntity( DRW_Entity* ent )
bool dxfRW::writeLineType( DRW_LType* ent ) bool dxfRW::writeLineType( DRW_LType* ent )
{ {
string strname = ent->name; std::string strname = ent->name;
transform( strname.begin(), strname.end(), strname.begin(), ::toupper ); transform( strname.begin(), strname.end(), strname.begin(), ::toupper );
...@@ -1322,7 +1322,12 @@ bool dxfRW::writeDimension( DRW_Dimension* ent ) ...@@ -1322,7 +1322,12 @@ bool dxfRW::writeDimension( DRW_Dimension* ent )
writer->writeString( 0, "DIMENSION" ); writer->writeString( 0, "DIMENSION" );
writeEntity( ent ); writeEntity( ent );
writer->writeString( 100, "AcDbDimension" ); writer->writeString( 100, "AcDbDimension" );
// writer->writeString(2, ent->name);
if( !ent->getName().empty() )
{
writer->writeString( 2, ent->getName() );
}
writer->writeDouble( 10, ent->getDefPoint().x ); writer->writeDouble( 10, ent->getDefPoint().x );
writer->writeDouble( 20, ent->getDefPoint().y ); writer->writeDouble( 20, ent->getDefPoint().y );
writer->writeDouble( 30, ent->getDefPoint().z ); writer->writeDouble( 30, ent->getDefPoint().z );
...@@ -2129,8 +2134,13 @@ bool dxfRW::writeTables() ...@@ -2129,8 +2134,13 @@ bool dxfRW::writeTables()
writer->writeInt16( 280, 1 ); writer->writeInt16( 280, 1 );
writer->writeInt16( 281, 0 ); writer->writeInt16( 281, 0 );
} }
}
/* allways call writeBlockRecords to iface for prepare unnamed blocks */
iface->writeBlockRecords(); iface->writeBlockRecords();
if( version > DRW::AC1009 )
{
writer->writeString( 0, "ENDTAB" ); writer->writeString( 0, "ENDTAB" );
} }
...@@ -2312,7 +2322,7 @@ bool dxfRW::writeObjects() ...@@ -2312,7 +2322,7 @@ bool dxfRW::writeObjects()
for( unsigned int i = 0; i<imageDef.size(); i++ ) for( unsigned int i = 0; i<imageDef.size(); i++ )
{ {
DRW_ImageDef* id = imageDef.at( i ); DRW_ImageDef* id = imageDef.at( i );
std::map<string, string>::iterator it; std::map<std::string, std::string>::iterator it;
for( it = id->reactors.begin(); it != id->reactors.end(); it++ ) for( it = id->reactors.begin(); it != id->reactors.end(); it++ )
{ {
...@@ -2356,7 +2366,7 @@ bool dxfRW::writeObjects() ...@@ -2356,7 +2366,7 @@ bool dxfRW::writeObjects()
} }
writer->writeString( 102, "{ACAD_REACTORS" ); writer->writeString( 102, "{ACAD_REACTORS" );
std::map<string, string>::iterator it; std::map<std::string, std::string>::iterator it;
for( it = id->reactors.begin(); it != id->reactors.end(); it++ ) for( it = id->reactors.begin(); it != id->reactors.end(); it++ )
{ {
...@@ -2392,7 +2402,7 @@ bool dxfRW::processDxf() ...@@ -2392,7 +2402,7 @@ bool dxfRW::processDxf()
DBG( "dxfRW::processDxf() start processing dxf\n" ); DBG( "dxfRW::processDxf() start processing dxf\n" );
int code; int code;
bool more = true; bool more = true;
string sectionstr; std::string sectionstr;
// section = secUnknown; // section = secUnknown;
while( reader->readRec( &code, !binary ) ) while( reader->readRec( &code, !binary ) )
...@@ -2469,7 +2479,7 @@ bool dxfRW::processHeader() ...@@ -2469,7 +2479,7 @@ bool dxfRW::processHeader()
{ {
DBG( "dxfRW::processHeader\n" ); DBG( "dxfRW::processHeader\n" );
int code; int code;
string sectionstr; std::string sectionstr;
while( reader->readRec( &code, !binary ) ) while( reader->readRec( &code, !binary ) )
{ {
...@@ -2500,7 +2510,7 @@ bool dxfRW::processTables() ...@@ -2500,7 +2510,7 @@ bool dxfRW::processTables()
{ {
DBG( "dxfRW::processTables\n" ); DBG( "dxfRW::processTables\n" );
int code; int code;
string sectionstr; std::string sectionstr;
bool more = true; bool more = true;
while( reader->readRec( &code, !binary ) ) while( reader->readRec( &code, !binary ) )
...@@ -2579,7 +2589,7 @@ bool dxfRW::processLType() ...@@ -2579,7 +2589,7 @@ bool dxfRW::processLType()
{ {
DBG( "dxfRW::processLType\n" ); DBG( "dxfRW::processLType\n" );
int code; int code;
string sectionstr; std::string sectionstr;
bool reading = false; bool reading = false;
DRW_LType ltype; DRW_LType ltype;
...@@ -2620,7 +2630,7 @@ bool dxfRW::processLayer() ...@@ -2620,7 +2630,7 @@ bool dxfRW::processLayer()
{ {
DBG( "dxfRW::processLayer\n" ); DBG( "dxfRW::processLayer\n" );
int code; int code;
string sectionstr; std::string sectionstr;
bool reading = false; bool reading = false;
DRW_Layer layer; DRW_Layer layer;
...@@ -2658,7 +2668,7 @@ bool dxfRW::processDimStyle() ...@@ -2658,7 +2668,7 @@ bool dxfRW::processDimStyle()
{ {
DBG( "dxfRW::processDimStyle" ); DBG( "dxfRW::processDimStyle" );
int code; int code;
string sectionstr; std::string sectionstr;
bool reading = false; bool reading = false;
DRW_Dimstyle dimSty; DRW_Dimstyle dimSty;
...@@ -2696,7 +2706,7 @@ bool dxfRW::processTextStyle() ...@@ -2696,7 +2706,7 @@ bool dxfRW::processTextStyle()
{ {
DBG( "dxfRW::processTextStyle" ); DBG( "dxfRW::processTextStyle" );
int code; int code;
string sectionstr; std::string sectionstr;
bool reading = false; bool reading = false;
DRW_Textstyle TxtSty; DRW_Textstyle TxtSty;
...@@ -2734,7 +2744,7 @@ bool dxfRW::processVports() ...@@ -2734,7 +2744,7 @@ bool dxfRW::processVports()
{ {
DBG( "dxfRW::processVports" ); DBG( "dxfRW::processVports" );
int code; int code;
string sectionstr; std::string sectionstr;
bool reading = false; bool reading = false;
DRW_Vport vp; DRW_Vport vp;
...@@ -2774,7 +2784,7 @@ bool dxfRW::processBlocks() ...@@ -2774,7 +2784,7 @@ bool dxfRW::processBlocks()
{ {
DBG( "dxfRW::processBlocks\n" ); DBG( "dxfRW::processBlocks\n" );
int code; int code;
string sectionstr; std::string sectionstr;
while( reader->readRec( &code, !binary ) ) while( reader->readRec( &code, !binary ) )
{ {
......
...@@ -127,7 +127,7 @@ private: ...@@ -127,7 +127,7 @@ private:
DRW_Interface* iface; DRW_Interface* iface;
DRW_Header header; DRW_Header header;
// int section; // int section;
string nextentity; std::string nextentity;
int entCount; int entCount;
bool wlayer0; bool wlayer0;
bool dimstyleStd; bool dimstyleStd;
......
...@@ -27,16 +27,25 @@ ...@@ -27,16 +27,25 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <appl_wxstruct.h>
#include <dxf2brd_items.h> #include <dxf2brd_items.h>
#include <wxPcbStruct.h> #include <wxPcbStruct.h>
#include <convert_from_iu.h> #include <convert_from_iu.h>
#include <dialog_dxf_import_base.h> #include <dialog_dxf_import_base.h>
#include <class_pcb_layer_box_selector.h> #include <class_pcb_layer_box_selector.h>
// Keys to store setup in config
#define DXF_IMPORT_LAYER_OPTION_KEY wxT("DxfImportBrdLayer")
#define DXF_IMPORT_COORD_ORIGIN_KEY wxT("DxfImportCoordOrigin")
#define DXF_IMPORT_LAST_FILE_KEY wxT("DxfImportLastFile")
class DIALOG_DXF_IMPORT : public DIALOG_DXF_IMPORT_BASE class DIALOG_DXF_IMPORT : public DIALOG_DXF_IMPORT_BASE
{ {
private: private:
PCB_EDIT_FRAME * m_parent; PCB_EDIT_FRAME * m_parent;
wxConfig* m_config; // Current config
static wxString m_dxfFilename; static wxString m_dxfFilename;
static int m_offsetSelection; static int m_offsetSelection;
static LAYER_NUM m_layer; static LAYER_NUM m_layer;
...@@ -64,6 +73,15 @@ DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_EDIT_FRAME* aParent ) ...@@ -64,6 +73,15 @@ DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_EDIT_FRAME* aParent )
: DIALOG_DXF_IMPORT_BASE( aParent ) : DIALOG_DXF_IMPORT_BASE( aParent )
{ {
m_parent = aParent; m_parent = aParent;
m_config = wxGetApp().GetSettings();
if( m_config )
{
m_layer = m_config->Read( DXF_IMPORT_LAYER_OPTION_KEY, (long)DRAW_N );
m_offsetSelection = m_config->Read( DXF_IMPORT_COORD_ORIGIN_KEY, 3 );
m_dxfFilename = m_config->Read( DXF_IMPORT_LAST_FILE_KEY, wxEmptyString );
}
m_textCtrlFileName->SetValue( m_dxfFilename ); m_textCtrlFileName->SetValue( m_dxfFilename );
m_rbOffsetOption->SetSelection( m_offsetSelection ); m_rbOffsetOption->SetSelection( m_offsetSelection );
...@@ -72,6 +90,7 @@ DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_EDIT_FRAME* aParent ) ...@@ -72,6 +90,7 @@ DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_EDIT_FRAME* aParent )
m_SelLayerBox->SetLayerMask( ALL_CU_LAYERS ); // Do not use copper layers m_SelLayerBox->SetLayerMask( ALL_CU_LAYERS ); // Do not use copper layers
m_SelLayerBox->SetBoardFrame( m_parent ); m_SelLayerBox->SetBoardFrame( m_parent );
m_SelLayerBox->Resync(); m_SelLayerBox->Resync();
if( m_SelLayerBox->SetLayerSelection( m_layer ) < 0 ) if( m_SelLayerBox->SetLayerSelection( m_layer ) < 0 )
{ {
m_layer = DRAW_N; m_layer = DRAW_N;
...@@ -88,14 +107,28 @@ DIALOG_DXF_IMPORT::~DIALOG_DXF_IMPORT() ...@@ -88,14 +107,28 @@ DIALOG_DXF_IMPORT::~DIALOG_DXF_IMPORT()
{ {
m_offsetSelection = m_rbOffsetOption->GetSelection(); m_offsetSelection = m_rbOffsetOption->GetSelection();
m_layer = m_SelLayerBox->GetLayerSelection(); m_layer = m_SelLayerBox->GetLayerSelection();
if( m_config )
{
m_config->Write( DXF_IMPORT_LAYER_OPTION_KEY, (long)m_layer );
m_config->Write( DXF_IMPORT_COORD_ORIGIN_KEY, m_offsetSelection );
m_config->Write( DXF_IMPORT_LAST_FILE_KEY, m_dxfFilename );
}
} }
void DIALOG_DXF_IMPORT::OnBrowseDxfFiles( wxCommandEvent& event ) void DIALOG_DXF_IMPORT::OnBrowseDxfFiles( wxCommandEvent& event )
{ {
wxString path;
if( !m_dxfFilename.IsEmpty() )
{
wxFileName fn( m_dxfFilename );
path = fn.GetPath();
}
wxFileDialog dlg( m_parent, wxFileDialog dlg( m_parent,
wxT( "Open File" ), wxT( "Open File" ),
wxEmptyString, wxEmptyString, path, m_dxfFilename,
wxT( "dxf Files (*.dxf)|*.dxf|*.DXF" ), wxT( "dxf Files (*.dxf)|*.dxf|*.DXF" ),
wxFD_OPEN|wxFD_FILE_MUST_EXIST ); wxFD_OPEN|wxFD_FILE_MUST_EXIST );
dlg.ShowModal(); dlg.ShowModal();
......
999
dxfrw 0.5.10
0
SECTION
2
HEADER
9
$ACADVER
1
AC1021
9
$HANDSEED
5
20000
9
$DWGCODEPAGE
3
ANSI_1252
9
$INSBASE
10
0
20
0
30
0
9
$EXTMIN
10
8.01510349296
20
22.3703927791
30
0
9
$EXTMAX
10
160.415103493
20
173.677807569
30
0
9
$LIMMIN
10
0
20
0
9
$LIMMAX
10
210
20
297
9
$ORTHOMODE
70
0
9
$LTSCALE
40
1
9
$TEXTSTYLE
7
Standard
9
$DIMASZ
40
1.8
9
$DIMSCALE
40
1
9
$DIMEXO
40
0.0625
9
$DIMEXE
40
0.18
9
$DIMTXT
40
0.25
9
$DIMTSZ
40
0
9
$DIMAUNIT
70
0
9
$DIMADEC
70
0
9
$DIMLUNIT
70
2
9
$DIMSTYLE
2
Standard
9
$DIMGAP
40
0.09
9
$DIMTIH
70
1
9
$LUNITS
70
2
9
$LUPREC
70
4
9
$AUNITS
70
0
9
$AUPREC
70
0
9
$SPLINESEGS
70
8
9
$GRIDMODE
70
0
9
$SNAPSTYLE
70
0
9
$PINSBASE
10
0
20
0
30
0
9
$PLIMMIN
10
0
20
0
9
$PLIMMAX
10
210
20
297
9
$INSUNITS
70
4
9
$PSVPSCALE
40
0
0
ENDSEC
0
SECTION
2
CLASSES
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
VPORT
5
8
330
0
100
AcDbSymbolTable
70
1
0
VPORT
5
31
330
2
100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
2
*ACTIVE
70
0
10
0
20
0
11
1
21
1
12
103.477837818
22
82.10741479
13
0
23
0
14
10
24
10
15
10
25
10
16
0
26
0
36
1
17
0
27
0
37
0
40
368.920987002
41
0.976829268293
42
50
43
0
44
0
50
0
51
0
71
0
72
100
73
1
74
3
75
0
76
0
77
0
78
0
281
0
65
1
110
0
120
0
130
0
111
1
121
0
131
0
112
0
122
1
132
0
79
0
146
0
348
10020
60
7
61
5
292
1
282
1
141
0
142
0
63
250
421
3358443
0
ENDTAB
0
TABLE
2
LTYPE
5
5
330
0
100
AcDbSymbolTable
70
4
0
LTYPE
5
14
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ByBlock
70
0
3
72
65
73
0
40
0
0
LTYPE
5
15
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ByLayer
70
0
3
72
65
73
0
40
0
0
LTYPE
5
16
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
Continuous
70
0
3
Solid line
72
65
73
0
40
0
0
LTYPE
5
32
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DOT
70
0
3
Dot . . . . . . . . . . . . . . . . . . . . . .
72
65
73
2
40
6.35
49
0
74
0
49
-6.35
74
0
0
LTYPE
5
33
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DOT2
70
0
3
Dot (.5x) .....................................
72
65
73
2
40
3.175
49
0
74
0
49
-3.175
74
0
0
LTYPE
5
34
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DOTX2
70
0
3
Dot (2x) . . . . . . . . . . . . .
72
65
73
2
40
12.7
49
0
74
0
49
-12.7
74
0
0
LTYPE
5
35
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHED
70
0
3
Dot . . . . . . . . . . . . . . . . . . . . . .
72
65
73
2
40
19.05
49
12.7
74
0
49
-6.35
74
0
0
LTYPE
5
36
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHED2
70
0
3
Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
72
65
73
2
40
9.525
49
6.35
74
0
49
-3.175
74
0
0
LTYPE
5
37
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHEDX2
70
0
3
Dashed (2x) ____ ____ ____ ____ ____ ___
72
65
73
2
40
38.1
49
25.4
74
0
49
-12.7
74
0
0
LTYPE
5
38
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHDOT
70
0
3
Dash dot __ . __ . __ . __ . __ . __ . __ . __
72
65
73
4
40
25.4
49
12.7
74
0
49
-6.35
74
0
49
0
74
0
49
-6.35
74
0
0
LTYPE
5
39
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHDOT2
70
0
3
Dash dot (.5x) _._._._._._._._._._._._._._._.
72
65
73
4
40
12.7
49
6.35
74
0
49
-3.175
74
0
49
0
74
0
49
-3.175
74
0
0
LTYPE
5
3A
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHDOTX2
70
0
3
Dash dot (2x) ____ . ____ . ____ . ___
72
65
73
4
40
50.8
49
25.4
74
0
49
-12.7
74
0
49
0
74
0
49
-12.7
74
0
0
LTYPE
5
3B
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DIVIDE
70
0
3
Divide ____ . . ____ . . ____ . . ____ . . ____
72
65
73
6
40
31.75
49
12.7
74
0
49
-6.35
74
0
49
0
74
0
49
-6.35
74
0
49
0
74
0
49
-6.35
74
0
0
LTYPE
5
3C
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DIVIDE2
70
0
3
Divide (.5x) __..__..__..__..__..__..__..__.._
72
65
73
6
40
15.875
49
6.35
74
0
49
-3.175
74
0
49
0
74
0
49
-3.175
74
0
49
0
74
0
49
-3.175
74
0
0
LTYPE
5
3D
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DIVIDEX2
70
0
3
Divide (2x) ________ . . ________ . . _
72
65
73
6
40
63.5
49
25.4
74
0
49
-12.7
74
0
49
0
74
0
49
-12.7
74
0
49
0
74
0
49
-12.7
74
0
0
LTYPE
5
3E
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BORDER
70
0
3
Border __ __ . __ __ . __ __ . __ __ . __ __ .
72
65
73
6
40
44.45
49
12.7
74
0
49
-6.35
74
0
49
12.7
74
0
49
-6.35
74
0
49
0
74
0
49
-6.35
74
0
0
LTYPE
5
3F
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BORDER2
70
0
3
Border (.5x) __.__.__.__.__.__.__.__.__.__.__.
72
65
73
6
40
22.225
49
6.35
74
0
49
-3.175
74
0
49
6.35
74
0
49
-3.175
74
0
49
0
74
0
49
-3.175
74
0
0
LTYPE
5
40
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BORDERX2
70
0
3
Border (2x) ____ ____ . ____ ____ . ___
72
65
73
6
40
88.9
49
25.4
74
0
49
-12.7
74
0
49
25.4
74
0
49
-12.7
74
0
49
0
74
0
49
-12.7
74
0
0
LTYPE
5
41
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CENTER
70
0
3
Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
72
65
73
4
40
50.8
49
31.75
74
0
49
-6.35
74
0
49
6.35
74
0
49
-6.35
74
0
0
LTYPE
5
42
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CENTER2
70
0
3
Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
72
65
73
4
40
28.575
49
19.05
74
0
49
-3.175
74
0
49
3.175
74
0
49
-3.175
74
0
0
LTYPE
5
43
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CENTERX2
70
0
3
Center (2x) ________ __ ________ __ _____
72
65
73
4
40
101.6
49
63.5
74
0
49
-12.7
74
0
49
12.7
74
0
49
-12.7
74
0
0
ENDTAB
0
TABLE
2
LAYER
5
2
330
0
100
AcDbSymbolTable
70
1
0
LAYER
5
10
330
2
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
0
70
0
62
7
6
CONTINUOUS
370
-3
390
F
0
LAYER
5
44
330
2
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
Visible Edges(PEC)
70
0
62
7
6
CONTINUOUS
370
50
390
F
0
ENDTAB
0
TABLE
2
STYLE
5
3
330
0
100
AcDbSymbolTable
70
3
0
STYLE
5
45
330
2
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
Standard
70
0
40
0
41
1
50
0
71
0
42
1
3
txt
4
0
ENDTAB
0
TABLE
2
VIEW
5
6
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
UCS
5
7
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
APPID
5
9
330
0
100
AcDbSymbolTable
70
1
0
APPID
5
12
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD
70
0
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
A
330
0
100
AcDbSymbolTable
70
1
100
AcDbDimStyleTable
71
1
0
DIMSTYLE
105
46
330
A
100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
2
Standard
70
0
40
1
41
1.8
42
0.0625
43
0.38
44
0.18
45
0
46
0
47
0
48
0
140
0.25
141
0.09
142
0
143
25.4
144
1
145
0
146
1
147
0.09
148
0
71
0
72
0
73
0
74
1
75
0
76
0
77
0
78
0
79
0
170
0
171
2
172
0
173
0
174
0
175
0
176
0
177
0
178
0
179
0
271
4
272
4
273
2
274
2
275
0
276
0
277
2
278
46
279
0
280
0
281
0
282
0
283
1
284
0
285
0
286
0
288
0
289
3
340
Standard
341
371
-2
372
-2
0
ENDTAB
0
TABLE
2
BLOCK_RECORD
5
1
330
0
100
AcDbSymbolTable
70
2
0
BLOCK_RECORD
5
1F
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Model_Space
70
0
280
1
281
0
0
BLOCK_RECORD
5
1E
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Paper_Space
70
0
280
1
281
0
0
ENDTAB
0
ENDSEC
0
SECTION
2
BLOCKS
0
BLOCK
5
20
330
1F
100
AcDbEntity
8
0
100
AcDbBlockBegin
2
*Model_Space
70
0
10
0
20
0
30
0
3
*Model_Space
1
0
ENDBLK
5
21
330
1F
100
AcDbEntity
8
0
100
AcDbBlockEnd
0
BLOCK
5
1C
330
1B
100
AcDbEntity
8
0
100
AcDbBlockBegin
2
*Paper_Space
70
0
10
0
20
0
30
0
3
*Paper_Space
1
0
ENDBLK
5
1D
330
1F
100
AcDbEntity
8
0
100
AcDbBlockEnd
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
5
47
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
54.0015095768
20
145.07427149
11
57.9407405889
21
144.379678779
0
LINE
5
48
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
57.9407405889
20
144.379678779
11
55.9264217279
21
132.955908844
0
LINE
5
49
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
55.9264217279
20
132.955908844
11
51.9871907159
21
133.650501555
0
CIRCLE
5
4A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
76.6151034931
20
128.870392779
40
2
0
CIRCLE
5
4B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
62.3755750957
20
142.867767753
40
1.6
0
CIRCLE
5
4C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
60.6112785469
20
132.861944812
40
1.6
0
CIRCLE
5
4D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
76.9279747741
20
141.354399538
40
1.1
0
CIRCLE
5
4E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
28.165103493
20
25.4703927791
40
0.7
0
CIRCLE
5
4F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
44.265103493
20
25.4703927791
40
0.7
0
CIRCLE
5
50
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
36.965103493
20
25.4703927791
40
0.7
0
ARC
5
51
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
78.5610437151
20
131.847953136
40
0.4
100
AcDbArc
50
85.34
51
265.34
0
LINE
5
52
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
78.5935407971
20
132.246630875
11
79.4905657101
21
132.173512441
0
ARC
5
53
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
79.4580686281
20
131.774834702
40
0.4
100
AcDbArc
50
265.34
51
85.34
0
LINE
5
54
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
79.4255715461
20
131.376156963
11
78.5285466331
21
131.449275397
0
LINE
5
55
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
79.1866125401
20
139.522499614
11
80.0836374531
21
139.44938118
0
ARC
5
56
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
80.0511403711
20
139.050703441
40
0.4
100
AcDbArc
50
265.34
51
85.34
0
LINE
5
57
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
80.0186432901
20
138.652025702
11
79.1216183771
21
138.725144136
0
ARC
5
58
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
79.1541154581
20
139.123821875
40
0.4
100
AcDbArc
50
85.34
51
265.34
0
ARC
5
59
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
73.8716354151
20
139.554408209
40
0.4
100
AcDbArc
50
85.34
51
265.34
0
LINE
5
5A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
73.9041324969
20
139.953085949
11
74.8011574099
21
139.879967514
0
ARC
5
5B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
74.7686603281
20
139.481289775
40
0.4
100
AcDbArc
50
265.34
51
85.34
0
LINE
5
5C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
74.7361632463
20
139.082612036
11
73.8391383333
21
139.15573047
0
ARC
5
5D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
73.2785636718
20
132.27853947
40
0.4
100
AcDbArc
50
85.34
51
265.34
0
LINE
5
5E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
73.3110607536
20
132.67721721
11
74.2080856666
21
132.604098775
0
ARC
5
5F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
74.1755885848
20
132.205421036
40
0.4
100
AcDbArc
50
265.34
51
85.34
0
LINE
5
60
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
74.143091503
20
131.806743297
11
73.2460665899
21
131.879861731
0
LINE
5
61
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
56.8197279711
20
132.003859741
11
57.9030164994
21
131.812846746
0
ARC
5
62
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
57.8509220461
20
131.51740442
40
0.3
100
AcDbArc
50
260
51
80
0
LINE
5
63
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
57.7988275928
20
131.221962094
11
56.7155390645
21
131.412975089
0
ARC
5
64
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
56.7676335178
20
131.708417415
40
0.3
100
AcDbArc
50
80
51
260
0
LINE
5
65
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
59.2022229169
20
145.515660013
11
60.2855114452
21
145.324647017
0
ARC
5
66
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
60.2334169919
20
145.029204691
40
0.3
100
AcDbArc
50
260
51
80
0
LINE
5
67
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
60.1813225386
20
144.733762365
11
59.0980340103
21
144.924775361
0
ARC
5
68
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
59.1501284636
20
145.220217687
40
0.3
100
AcDbArc
50
80
51
260
0
CIRCLE
5
69
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
17.415103493
20
33.7103927791
40
0.5
0
CIRCLE
5
6A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
17.415103493
20
36.2503927791
40
0.5
0
CIRCLE
5
6B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
17.415103493
20
38.7903927791
40
0.5
0
CIRCLE
5
6C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
17.415103493
20
41.3303927791
40
0.5
0
CIRCLE
5
6D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
76.1591754285
20
137.461644322
40
0.45
0
CIRCLE
5
6E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
75.8748259626
20
133.973214105
40
0.45
0
CIRCLE
5
6F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
68.0851733401
20
138.680315907
40
0.45
0
CIRCLE
5
70
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
67.6440992029
20
136.178860171
40
0.45
0
CIRCLE
5
71
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
70.3686653354
20
137.003365518
40
0.45
0
CIRCLE
5
72
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
69.9275911982
20
134.501909782
40
0.45
0
LINE
5
73
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
54.388745013
20
147.270392779
11
54.0015095768
21
145.07427149
0
LINE
5
74
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
51.9871907159
20
133.650501555
11
50.7387765123
21
126.570392779
0
LINE
5
75
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
26.115103493
20
28.5703927791
11
26.115103493
21
22.3703927791
0
LINE
5
76
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
26.115103493
20
22.3703927791
11
46.315103493
21
22.3703927791
0
LINE
5
77
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
46.315103493
20
22.3703927791
11
46.315103493
21
28.5703927791
0
LINE
5
78
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
80.1469013801
20
126.070392779
11
81.4988185711
21
142.655860116
0
LINE
5
79
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
54.388745013
20
147.270392779
11
81.4988185711
21
142.655860116
0
CIRCLE
5
7A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
38.615103493
20
36.0703927791
40
0.75
0
CIRCLE
5
7B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
31.115103493
20
33.8203927791
40
0.75
0
CIRCLE
5
7C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
141.915103493
20
109.820392779
40
0.75
0
CIRCLE
5
7D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
149.415103493
20
112.070392779
40
0.75
0
CIRCLE
5
7E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
139.665103493
20
71.8203927791
40
0.75
0
CIRCLE
5
7F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
147.165103493
20
74.0703927791
40
0.75
0
CIRCLE
5
80
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
135.165103493
20
52.8203927791
40
0.75
0
CIRCLE
5
81
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
142.665103493
20
55.0703927791
40
0.75
0
CIRCLE
5
82
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
137.415103493
20
33.8203927791
40
0.75
0
CIRCLE
5
83
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
144.915103493
20
36.0703927791
40
0.75
0
CIRCLE
5
84
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
114.765103493
20
36.0703927791
40
0.75
0
CIRCLE
5
85
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
107.265103493
20
33.8203927791
40
0.75
0
CIRCLE
5
86
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
91.3651034931
20
36.0703927791
40
0.75
0
CIRCLE
5
87
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
83.8651034931
20
33.8203927791
40
0.75
0
CIRCLE
5
88
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
67.965103493
20
36.0703927791
40
0.75
0
CIRCLE
5
89
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
60.465103493
20
33.8203927791
40
0.75
0
CIRCLE
5
8A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
104.715103493
20
52.8203927791
40
0.75
0
CIRCLE
5
8B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
112.215103493
20
55.0703927791
40
0.75
0
CIRCLE
5
8C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
85.5151034931
20
52.8203927791
40
0.75
0
CIRCLE
5
8D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
93.0151034931
20
55.0703927791
40
0.75
0
CIRCLE
5
8E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
66.315103493
20
52.8203927791
40
0.75
0
CIRCLE
5
8F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
73.815103493
20
55.0703927791
40
0.75
0
CIRCLE
5
90
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
47.115103493
20
52.8203927791
40
0.75
0
CIRCLE
5
91
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
54.615103493
20
55.0703927791
40
0.75
0
CIRCLE
5
92
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
35.415103493
20
55.0703927791
40
0.75
0
CIRCLE
5
93
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
27.915103493
20
52.8203927791
40
0.75
0
CIRCLE
5
94
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
121.325103493
20
74.0703927791
40
0.75
0
CIRCLE
5
95
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
113.825103493
20
71.8203927791
40
0.75
0
CIRCLE
5
96
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
102.235103493
20
74.0703927791
40
0.75
0
CIRCLE
5
97
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
94.7351034931
20
71.8203927791
40
0.75
0
CIRCLE
5
98
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
83.1451034931
20
74.0703927791
40
0.75
0
CIRCLE
5
99
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
75.645103493
20
71.8203927791
40
0.75
0
CIRCLE
5
9A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
64.055103493
20
74.0703927791
40
0.75
0
CIRCLE
5
9B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
56.555103493
20
71.8203927791
40
0.75
0
CIRCLE
5
9C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
44.965103493
20
74.0703927791
40
0.75
0
CIRCLE
5
9D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
37.465103493
20
71.8203927791
40
0.75
0
CIRCLE
5
9E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
18.375103493
20
71.8203927791
40
0.75
0
CIRCLE
5
9F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
25.875103493
20
74.0703927791
40
0.75
0
CIRCLE
5
A0
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
146.415103493
20
90.8203927791
40
0.75
0
CIRCLE
5
A1
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
153.915103493
20
93.0703927791
40
0.75
0
CIRCLE
5
A2
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
127.415103493
20
90.8203927791
40
0.75
0
CIRCLE
5
A3
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
134.915103493
20
93.0703927791
40
0.75
0
CIRCLE
5
A4
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
108.415103493
20
90.8203927791
40
0.75
0
CIRCLE
5
A5
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
115.915103493
20
93.0703927791
40
0.75
0
CIRCLE
5
A6
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
89.4151034931
20
90.8203927791
40
0.75
0
CIRCLE
5
A7
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
96.9151034931
20
93.0703927791
40
0.75
0
CIRCLE
5
A8
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
70.415103493
20
90.8203927791
40
0.75
0
CIRCLE
5
A9
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
77.9151034931
20
93.0703927791
40
0.75
0
CIRCLE
5
AA
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
58.915103493
20
93.0703927791
40
0.75
0
CIRCLE
5
AB
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
32.415103493
20
90.8203927791
40
0.75
0
CIRCLE
5
AC
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
39.915103493
20
93.0703927791
40
0.75
0
CIRCLE
5
AD
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
13.415103493
20
90.8203927791
40
0.75
0
CIRCLE
5
AE
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
20.915103493
20
93.0703927791
40
0.75
0
CIRCLE
5
AF
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
118.415103493
20
109.820392779
40
0.75
0
CIRCLE
5
B0
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
125.915103493
20
112.070392779
40
0.75
0
CIRCLE
5
B1
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
99.4151034931
20
109.820392779
40
0.75
0
CIRCLE
5
B2
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
106.915103493
20
112.070392779
40
0.75
0
CIRCLE
5
B3
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
80.4151034931
20
109.820392779
40
0.75
0
CIRCLE
5
B4
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
87.9151034931
20
112.070392779
40
0.75
0
CIRCLE
5
B5
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
61.415103493
20
109.820392779
40
0.75
0
CIRCLE
5
B6
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
68.915103493
20
112.070392779
40
0.75
0
CIRCLE
5
B7
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
42.415103493
20
109.820392779
40
0.75
0
CIRCLE
5
B8
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
49.915103493
20
112.070392779
40
0.75
0
CIRCLE
5
B9
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
23.415103493
20
109.820392779
40
0.75
0
CIRCLE
5
BA
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
30.915103493
20
112.070392779
40
0.75
0
LINE
5
BB
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
19.215103493
20
114.070392779
11
19.215103493
21
110.070392779
0
LINE
5
BC
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
19.215103493
20
110.070392779
11
17.915103493
21
110.070392779
0
LINE
5
BD
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
17.915103493
20
114.070392779
11
19.215103493
21
114.070392779
0
LINE
5
BE
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
19.215103493
20
122.070392779
11
19.215103493
21
118.070392779
0
LINE
5
BF
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
19.215103493
20
118.070392779
11
17.915103493
21
118.070392779
0
LINE
5
C0
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
17.915103493
20
122.070392779
11
19.215103493
21
122.070392779
0
LINE
5
C1
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
23.815103493
20
64.0703927791
11
23.815103493
21
60.0703927791
0
LINE
5
C2
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
23.815103493
20
60.0703927791
11
22.515103493
21
60.0703927791
0
LINE
5
C3
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
22.515103493
20
64.0703927791
11
23.815103493
21
64.0703927791
0
LINE
5
C4
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
23.815103493
20
57.0703927791
11
23.815103493
21
53.0703927791
0
LINE
5
C5
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
23.815103493
20
53.0703927791
11
22.515103493
21
53.0703927791
0
LINE
5
C6
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
22.515103493
20
57.0703927791
11
23.815103493
21
57.0703927791
0
LINE
5
C7
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
14.315103493
20
76.0703927791
11
14.315103493
21
72.0703927791
0
LINE
5
C8
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
14.315103493
20
72.0703927791
11
13.015103493
21
72.0703927791
0
LINE
5
C9
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
13.015103493
20
76.0703927791
11
14.315103493
21
76.0703927791
0
LINE
5
CA
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
14.315103493
20
83.5703927791
11
14.315103493
21
79.5703927791
0
LINE
5
CB
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
14.315103493
20
79.5703927791
11
13.015103493
21
79.5703927791
0
LINE
5
CC
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
13.015103493
20
83.5703927791
11
14.315103493
21
83.5703927791
0
LINE
5
CD
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
9.31510349296
20
95.0703927791
11
9.31510349296
21
91.0703927791
0
LINE
5
CE
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
9.31510349296
20
91.0703927791
11
8.01510349296
21
91.0703927791
0
LINE
5
CF
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
8.01510349296
20
95.0703927791
11
9.31510349296
21
95.0703927791
0
LINE
5
D0
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
9.31510349296
20
102.070392779
11
9.31510349296
21
98.0703927791
0
LINE
5
D1
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
9.31510349296
20
98.0703927791
11
8.01510349296
21
98.0703927791
0
LINE
5
D2
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
8.01510349296
20
102.070392779
11
9.31510349296
21
102.070392779
0
LINE
5
D3
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
15.615103493
20
28.5703927791
11
26.115103493
21
28.5703927791
0
LINE
5
D4
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
46.315103493
20
28.5703927791
11
160.415103493
21
28.5703927791
0
LINE
5
D5
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
21.115103493
20
126.570392779
11
21.115103493
21
123.270392779
0
LINE
5
D6
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
21.115103493
20
123.270392779
11
17.915103493
21
123.270392779
0
LINE
5
D7
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
50.7387765123
20
126.570392779
11
21.115103493
21
126.570392779
0
LINE
5
D8
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
31.215103493
20
103.570392779
11
8.01510349296
21
103.570392779
0
LINE
5
D9
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
17.915103493
20
108.570392779
11
31.215103493
21
108.570392779
0
LINE
5
DA
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
31.215103493
20
108.570392779
11
31.215103493
21
103.570392779
0
LINE
5
DB
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
160.415103493
20
126.070392779
11
80.1469013801
21
126.070392779
0
LINE
5
DC
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
31.215103493
20
84.5703927791
11
13.015103493
21
84.5703927791
0
LINE
5
DD
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
31.215103493
20
89.5703927791
11
31.215103493
21
84.5703927791
0
LINE
5
DE
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
8.01510349296
20
89.5703927791
11
31.215103493
21
89.5703927791
0
LINE
5
DF
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
41.715103493
20
46.5703927791
11
15.615103493
21
46.5703927791
0
LINE
5
E0
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
41.715103493
20
51.5703927791
11
41.715103493
21
46.5703927791
0
LINE
5
E1
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
22.515103493
20
51.5703927791
11
41.715103493
21
51.5703927791
0
LINE
5
E2
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
41.715103493
20
65.5703927791
11
22.515103493
21
65.5703927791
0
LINE
5
E3
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
41.715103493
20
70.5703927791
11
41.715103493
21
65.5703927791
0
LINE
5
E4
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
13.015103493
20
70.5703927791
11
41.715103493
21
70.5703927791
0
LINE
5
E5
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
17.915103493
20
122.070392779
11
17.915103493
21
123.270392779
0
LINE
5
E6
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
17.915103493
20
108.570392779
11
17.915103493
21
110.070392779
0
LINE
5
E7
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
8.01510349296
20
102.070392779
11
8.01510349296
21
103.570392779
0
LINE
5
E8
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
8.01510349296
20
89.5703927791
11
8.01510349296
21
91.0703927791
0
LINE
5
E9
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
15.615103493
20
28.5703927791
11
15.615103493
21
46.5703927791
0
LINE
5
EA
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
17.915103493
20
114.070392779
11
17.915103493
21
118.070392779
0
LINE
5
EB
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
8.01510349296
20
95.0703927791
11
8.01510349296
21
98.0703927791
0
LINE
5
EC
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
13.015103493
20
83.5703927791
11
13.015103493
21
84.5703927791
0
LINE
5
ED
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
13.015103493
20
76.0703927791
11
13.015103493
21
79.5703927791
0
LINE
5
EE
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
13.015103493
20
70.5703927791
11
13.015103493
21
72.0703927791
0
LINE
5
EF
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
22.515103493
20
64.0703927791
11
22.515103493
21
65.5703927791
0
LINE
5
F0
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
22.515103493
20
57.0703927791
11
22.515103493
21
60.0703927791
0
LINE
5
F1
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
22.515103493
20
51.5703927791
11
22.515103493
21
53.0703927791
0
LINE
5
F2
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
160.415103493
20
126.070392779
11
160.415103493
21
28.5703927791
0
CIRCLE
5
F3
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
44.915103493
20
105.570392779
40
2.1
0
CIRCLE
5
F4
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
59.715103493
20
67.5703927791
40
2.1
0
CIRCLE
5
F5
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
98.1151034931
20
67.5703927791
40
2.1
0
CIRCLE
5
F6
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
155.415103493
20
77.5703927791
40
2.1
0
CIRCLE
5
F7
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
111.915103493
20
106.570392779
40
2.1
0
CIRCLE
5
F8
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
140.415103493
20
39.5703927791
40
2
0
CIRCLE
5
F9
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
110.265103493
20
39.5703927791
40
2
0
CIRCLE
5
FA
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
107.715103493
20
58.5703927791
40
2
0
CIRCLE
5
FB
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
138.165103493
20
58.5703927791
40
2
0
CIRCLE
5
FC
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
142.665103493
20
77.5703927791
40
2
0
CIRCLE
5
FD
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
116.825103493
20
77.5703927791
40
2
0
CIRCLE
5
FE
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
149.415103493
20
96.5703927791
40
2
0
CIRCLE
5
FF
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
144.915103493
20
115.570392779
40
2
0
CIRCLE
5
100
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
121.415103493
20
115.570392779
40
2
0
CIRCLE
5
101
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
102.415103493
20
115.570392779
40
2
0
CIRCLE
5
102
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
83.4151034931
20
115.570392779
40
2
0
CIRCLE
5
103
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
64.415103493
20
115.570392779
40
2
0
CIRCLE
5
104
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
45.415103493
20
115.570392779
40
2
0
CIRCLE
5
105
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
26.415103493
20
115.570392779
40
2
0
CIRCLE
5
106
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
130.415103493
20
96.5703927791
40
2
0
CIRCLE
5
107
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
111.415103493
20
96.5703927791
40
2
0
CIRCLE
5
108
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
92.4151034931
20
96.5703927791
40
2
0
CIRCLE
5
109
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
73.415103493
20
96.5703927791
40
2
0
CIRCLE
5
10A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
54.415103493
20
96.5703927791
40
2
0
CIRCLE
5
10B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
35.415103493
20
96.5703927791
40
2
0
CIRCLE
5
10C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
16.415103493
20
96.5703927791
40
2
0
CIRCLE
5
10D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
97.7351034931
20
77.5703927791
40
2
0
CIRCLE
5
10E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
78.6451034931
20
77.5703927791
40
2
0
CIRCLE
5
10F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
59.555103493
20
77.5703927791
40
2
0
CIRCLE
5
110
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
40.465103493
20
77.5703927791
40
2
0
CIRCLE
5
111
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
21.375103493
20
77.5703927791
40
2
0
CIRCLE
5
112
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
88.5151034931
20
58.5703927791
40
2
0
CIRCLE
5
113
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
69.315103493
20
58.5703927791
40
2
0
CIRCLE
5
114
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
50.115103493
20
58.5703927791
40
2
0
CIRCLE
5
115
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
30.915103493
20
58.5703927791
40
2
0
CIRCLE
5
116
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
34.115103493
20
39.5703927791
40
2
0
CIRCLE
5
117
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
86.8651034931
20
39.5703927791
40
2
0
CIRCLE
5
118
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
63.465103493
20
39.5703927791
40
2
0
ARC
5
119
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
124.426298668
20
54.6043548311
40
2.37170824513
100
AcDbArc
50
341.565051177
51
198.434948823
0
LINE
5
11A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
122.176298668
20
53.8543548311
11
123.676298668
21
50.8543548311
0
LINE
5
11B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
126.676298668
20
53.8543548311
11
125.176298668
21
50.8543548311
0
ARC
5
11C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
124.426298668
20
51.2543548311
40
0.85
100
AcDbArc
50
208.072486936
51
331.927513064
0
ARC
5
11D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
124.380058759
20
41.2642934551
40
2.37170824513
100
AcDbArc
50
161.565051177
51
18.4349488229
0
LINE
5
11E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
126.630058759
20
42.0142934551
11
125.130058759
21
45.0142934551
0
LINE
5
11F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
122.130058759
20
42.0142934551
11
123.630058759
21
45.0142934551
0
ARC
5
120
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
124.380058759
20
44.6142934551
40
0.85
100
AcDbArc
50
28.0724869359
51
151.927513064
0
ARC
5
121
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
117.630058759
20
48.1425852101
40
2.37170824513
100
AcDbArc
50
71.5650511771
51
288.434948823
0
LINE
5
122
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
118.380058759
20
45.8925852101
11
121.380058759
21
47.3925852101
0
LINE
5
123
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
118.380058759
20
50.3925852101
11
121.380058759
21
48.8925852101
0
ARC
5
124
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
120.980058759
20
48.1425852101
40
0.85
100
AcDbArc
50
298.072486936
51
61.9275130641
0
ARC
5
125
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
131.130058759
20
48.1425852101
40
2.37170824513
100
AcDbArc
50
251.565051177
51
108.434948823
0
LINE
5
126
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
130.380058759
20
50.3925852101
11
127.380058759
21
48.8925852101
0
LINE
5
127
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
130.380058759
20
45.8925852101
11
127.380058759
21
47.3925852101
0
ARC
5
128
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
127.780058759
20
48.1425852101
40
0.85
100
AcDbArc
50
118.072486936
51
241.927513064
0
ARC
5
129
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
53.1318556378
20
37.0101551811
40
0.85
100
AcDbArc
50
73.0724869359
51
196.927513064
0
ARC
5
12A
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
45.8640058389
20
34.7320634341
40
2.37170824513
100
AcDbArc
50
116.565051177
51
333.434948823
0
LINE
5
12B
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
47.9853261825
20
33.6714032621
11
49.0459863543
21
36.8533837771
0
LINE
5
12C
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
44.8033456672
20
36.8533837771
11
47.9853261825
21
37.9140439491
0
ARC
5
12D
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
48.2328135559
20
37.1008711511
40
0.85
100
AcDbArc
50
343.072486936
51
106.927513064
0
ARC
5
12E
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
55.4099473849
20
44.2780049801
40
2.37170824513
100
AcDbArc
50
296.565051177
51
153.434948823
0
LINE
5
12F
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
53.2886270414
20
45.3386651511
11
52.2279668696
21
42.1566846361
0
LINE
5
130
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
56.4706075567
20
42.1566846361
11
53.2886270414
21
41.0960244641
0
ARC
5
131
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
53.041139668
20
41.9091972631
40
0.85
100
AcDbArc
50
163.072486936
51
286.927513064
0
ARC
5
132
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
46.1005120477
20
44.1068918771
40
2.37170824513
100
AcDbArc
50
26.5650511771
51
243.434948823
0
LINE
5
133
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
45.0398518759
20
41.9855715331
11
48.2218323913
21
40.9249113611
0
LINE
5
134
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
48.2218323913
20
45.1675520491
11
49.282492563
21
41.9855715331
0
ARC
5
135
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
48.4693197647
20
41.7380841601
40
0.85
100
AcDbArc
50
253.072486936
51
16.9275130641
0
ARC
5
136
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
55.5006633548
20
34.6413474641
40
2.37170824513
100
AcDbArc
50
206.565051177
51
63.4349488229
0
LINE
5
137
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
56.5613235266
20
36.7626678071
11
53.3793430112
21
37.8233279791
0
LINE
5
138
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbLine
10
53.3793430112
20
33.5806872921
11
52.3186828395
21
36.7626678071
0
CIRCLE
5
139
100
AcDbEntity
8
Visible Edges(PEC)
6
ByLayer
62
256
370
-1
100
AcDbCircle
10
156.82650113
20
63.0606544828
40
0.75
0
ENDSEC
0
SECTION
2
OBJECTS
0
DICTIONARY
5
C
330
0
100
AcDbDictionary
281
1
3
ACAD_GROUP
350
D
0
DICTIONARY
5
D
330
C
100
AcDbDictionary
281
1
0
ENDSEC
0
EOF
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment