Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 901510 Details for
Bug 1093657
librecad-2.0.4 is available
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Diff of upstream libdxfrw 0.5.11 and libdxfrw bundled in librecad 2.0.4
libdxfrw_librecad.diff (text/plain), 11.09 KB, created by
Richard Shaw
on 2014-06-02 17:15:05 UTC
(
hide
)
Description:
Diff of upstream libdxfrw 0.5.11 and libdxfrw bundled in librecad 2.0.4
Filename:
MIME Type:
Creator:
Richard Shaw
Created:
2014-06-02 17:15:05 UTC
Size:
11.09 KB
patch
obsolete
>diff -aur libdxfrw-0.5.11/src/drw_base.h libdxfrw/src/drw_base.h >--- libdxfrw-0.5.11/src/drw_base.h 2013-12-29 04:37:22.000000000 -0600 >+++ libdxfrw/src/drw_base.h 2014-05-29 22:54:17.000000000 -0500 >@@ -148,20 +148,26 @@ > DRW_Variant() { > type = INVALID; > } >+ DRW_Variant(const DRW_Variant& d) { >+ code = d.code; >+ type = d.type; >+ if (d.type == COORD) vdata = d.vdata; >+ if (d.type == STRING) sdata = d.sdata; >+ content = d.content; >+ } >+ > ~DRW_Variant() { >- if (type == COORD) >- delete content.v; > } >- enum TYPE type; > >- void addString(UTF8STRING s) {setType(STRING); data = s; content.s = &data;} >+ void addString(UTF8STRING s) {setType(STRING); sdata = s; content.s = &sdata;} > void addInt(int i) {setType(INTEGER); content.i = i;} > void addDouble(double d) {setType(DOUBLE); content.d = d;} >- void addCoord(DRW_Coord *v) {setType(COORD); content.v = v;} >- void setType(enum TYPE t) { if (type == COORD) delete content.v; type = t;} >- void setCoordX(double d) { if (type == COORD) content.v->x = d;} >- void setCoordY(double d) { if (type == COORD) content.v->y = d;} >- void setCoordZ(double d) { if (type == COORD) content.v->z = d;} >+ void addCoord() {setType(COORD); vdata.x=0.0; vdata.y=0.0; vdata.z=0.0; content.v = &vdata;} >+ void addCoord(DRW_Coord v) {setType(COORD); vdata = v; content.v = &vdata;} >+ void setType(enum TYPE t) { type = t;} >+ void setCoordX(double d) { if (type == COORD) vdata.x = d;} >+ void setCoordY(double d) { if (type == COORD) vdata.y = d;} >+ void setCoordZ(double d) { if (type == COORD) vdata.z = d;} > > private: > typedef union { >@@ -173,14 +179,12 @@ > > public: > DRW_VarContent content; >+ enum TYPE type; >+ int code; /*!< dxf code of this value*/ > >-public: >- int code; >-// string version; >-// string codepage; > private: >-// DRW_VarContent content; >- std::string data; >+ std::string sdata; >+ DRW_Coord vdata; > }; > > >diff -aur libdxfrw-0.5.11/src/drw_entities.cpp libdxfrw/src/drw_entities.cpp >--- libdxfrw-0.5.11/src/drw_entities.cpp 2013-12-29 04:00:40.000000000 -0600 >+++ libdxfrw/src/drw_entities.cpp 2014-05-29 22:54:17.000000000 -0500 >@@ -21,19 +21,30 @@ > * @author Rallaz > */ > void DRW_Entity::calculateAxis(DRW_Coord extPoint){ >+ //Follow the arbitrary DXF definitions for extrusion axes. > if (fabs(extPoint.x) < 0.015625 && fabs(extPoint.y) < 0.015625) { >+ //If we get here, implement Ax = Wy x N where Wy is [0,1,0] per the DXF spec. >+ //The cross product works out to Wy.y*N.z-Wy.z*N.y, Wy.z*N.x-Wy.x*N.z, Wy.x*N.y-Wy.y*N.x >+ //Factoring in the fixed values for Wy gives N.z,0,-N.x > extAxisX.x = extPoint.z; > extAxisX.y = 0; > extAxisX.z = -extPoint.x; > } else { >+ //Otherwise, implement Ax = Wz x N where Wz is [0,0,1] per the DXF spec. >+ //The cross product works out to Wz.y*N.z-Wz.z*N.y, Wz.z*N.x-Wz.x*N.z, Wz.x*N.y-Wz.y*N.x >+ //Factoring in the fixed values for Wz gives -N.y,N.x,0. > extAxisX.x = -extPoint.y; > extAxisX.y = extPoint.x; > extAxisX.z = 0; > } >+ > extAxisX.unitize(); >+ >+ //Ay = N x Ax > extAxisY.x = (extPoint.y * extAxisX.z) - (extAxisX.y * extPoint.z); > extAxisY.y = (extPoint.z * extAxisX.x) - (extAxisX.z * extPoint.x); > extAxisY.z = (extPoint.x * extAxisX.y) - (extAxisX.x * extPoint.y); >+ > extAxisY.unitize(); > } > //! Extrude a point using arbitary axis >@@ -141,6 +152,8 @@ > > void DRW_Circle::applyExtrusion(){ > if (haveExtrusion) { >+ //NOTE: Commenting these out causes the the arcs being tested to be located >+ //on the other side of the y axis (all x dimensions are negated). > calculateAxis(extPoint); > extrudePoint(extPoint, &basePoint); > } >@@ -157,6 +170,26 @@ > } > } > >+void DRW_Arc::applyExtrusion(){ >+ DRW_Circle::applyExtrusion(); >+ >+ if(haveExtrusion){ >+ // If the extrusion vector has a z value less than 0, the angles for the arc >+ // have to be mirrored since DXF files use the right hand rule. >+ // Note that the following code only handles the special case where there is a 2D >+ // drawing with the z axis heading into the paper (or rather screen). An arbitrary >+ // extrusion axis (with x and y values greater than 1/64) may still have issues. >+ if (fabs(extPoint.x) < 0.015625 && fabs(extPoint.y) < 0.015625 && extPoint.z < 0.0) { >+ staangle=M_PI-staangle; >+ endangle=M_PI-endangle; >+ >+ double temp = staangle; >+ staangle=endangle; >+ endangle=temp; >+ } >+ } >+} >+ > void DRW_Arc::parseCode(int code, dxfReader *reader){ > switch (code) { > case 50: >diff -aur libdxfrw-0.5.11/src/drw_entities.h libdxfrw/src/drw_entities.h >--- libdxfrw-0.5.11/src/drw_entities.h 2013-12-29 04:34:59.000000000 -0600 >+++ libdxfrw/src/drw_entities.h 2014-05-29 22:54:17.000000000 -0500 >@@ -223,7 +223,7 @@ > isccw = 1; > } > >- virtual void applyExtrusion(){DRW_Circle::applyExtrusion();} >+ virtual void applyExtrusion(); > void parseCode(int code, dxfReader *reader); > > public: >@@ -811,7 +811,7 @@ > int clip; /*!< Clipping state, code 280, 0=off 1=on */ > int brightness; /*!< Brightness value, code 281, (0-100) default 50 */ > int contrast; /*!< Brightness value, code 282, (0-100) default 50 */ >- int fade; /*!< Brightness value, code 283, (0-100) default 0 */ >+ int fade; /*!< Brightness value, code 283, (0-100) default 0 */ > > }; > >@@ -1117,7 +1117,7 @@ > void parseCode(int code, dxfReader *reader); > > public: >- UTF8STRING style; /*!< Dimension style name, code 3 */ >+ UTF8STRING style; /*!< Dimension style name, code 3 */ > int arrow; /*!< Arrowhead flag, code 71, 0=Disabled; 1=Enabled */ > int leadertype; /*!< Leader path type, code 72, 0=Straight line segments; 1=Spline */ > int flag; /*!< Leader creation flag, code 73, default 3 */ >diff -aur libdxfrw-0.5.11/src/drw_objects.cpp libdxfrw/src/drw_objects.cpp >--- libdxfrw-0.5.11/src/drw_objects.cpp 2013-12-29 04:34:59.000000000 -0600 >+++ libdxfrw/src/drw_objects.cpp 2014-05-29 22:54:17.000000000 -0500 >@@ -567,7 +567,7 @@ > curr->code = code; > break; > case 10: >- curr->addCoord(new DRW_Coord()); >+ curr->addCoord(); > curr->setCoordX(reader->getDouble()); > curr->code = code; > break; >@@ -922,6 +922,34 @@ > #endif > } > >+void DRW_Header::addDouble(std::string key, double value, int code){ >+ curr = new DRW_Variant(); >+ curr->addDouble( value ); >+ curr->code = code; >+ vars[key] =curr; >+} >+ >+void DRW_Header::addInt(std::string key, int value, int code){ >+ curr = new DRW_Variant(); >+ curr->addInt( value ); >+ curr->code = code; >+ vars[key] =curr; >+} >+ >+void DRW_Header::addStr(std::string key, std::string value, int code){ >+ curr = new DRW_Variant(); >+ curr->addString( value ); >+ curr->code = code; >+ vars[key] =curr; >+} >+ >+void DRW_Header::addCoord(std::string key, DRW_Coord value, int code){ >+ curr = new DRW_Variant(); >+ curr->addCoord( value ); >+ curr->code = code; >+ vars[key] =curr; >+} >+ > bool DRW_Header::getDouble(std::string key, double *varDouble){ > bool result = false; > std::map<std::string,DRW_Variant *>::iterator it; >diff -aur libdxfrw-0.5.11/src/drw_objects.h libdxfrw/src/drw_objects.h >--- libdxfrw-0.5.11/src/drw_objects.h 2013-12-29 04:34:59.000000000 -0600 >+++ libdxfrw/src/drw_objects.h 2014-05-29 22:54:17.000000000 -0500 >@@ -187,10 +187,6 @@ > size = 0; > length = 0.0; > pathIdx = 0; >-/* color = 256; // default BYLAYER (256) >- plotF = true; // default TRUE (plot yes) >- lWeight = -1; // default BYLAYER (-1)*/ >-// align = 65; //always 65 > } > > void parseCode(int code, dxfReader *reader); >@@ -229,10 +225,10 @@ > void parseCode(int code, dxfReader *reader); > > public: >- UTF8STRING lineType; /*!< line type, code 6 */ >- int color; /*!< layer color, code 62 */ >- int color24; /*!< 24-bit color, code 420 */ >- bool plotF; /*!< Plot flag, code 290 */ >+ UTF8STRING lineType; /*!< line type, code 6 */ >+ int color; /*!< layer color, code 62 */ >+ int color24; /*!< 24-bit color, code 420 */ >+ bool plotF; /*!< Plot flag, code 290 */ > enum DRW_LW_Conv::lineWidth lWeight; /*!< layer lineweight, code 370 */ > std::string handlePlotS; /*!< Hard-pointer ID/handle of plotstyle, code 390 */ > std::string handlePlotM; /*!< Hard-pointer ID/handle of materialstyle, code 347 */ >@@ -347,7 +343,7 @@ > > public: > 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 */ > double u; /*!< image size in pixels U value, code 10 */ > double v; /*!< image size in pixels V value, code 20 */ >@@ -362,7 +358,9 @@ > > //! Class to handle header entries > /*! >-* Class to handle layer symbol table entries >+* Class to handle header vars, to read iterate over "std::map vars" >+* to write add a DRW_Variant* into "std::map vars" (do not delete it, are cleared in dtor) >+* or use add* helper functions. > * @author Rallaz > */ > class DRW_Header { >@@ -370,13 +368,21 @@ > DRW_Header() { > } > ~DRW_Header() { >+ for (std::map<std::string,DRW_Variant*>::iterator it=vars.begin(); it!=vars.end(); ++it) >+ delete it->second; >+ > vars.clear(); > } > >+ void addDouble(std::string key, double value, int code); >+ void addInt(std::string key, int value, int code); >+ void addStr(std::string key, std::string value, int code); >+ void addCoord(std::string key, DRW_Coord value, int code); >+ std::string getComments() const {return comments;} >+ > void parseCode(int code, dxfReader *reader); > void write(dxfWriter *writer, DRW::Version ver); > void addComment(std::string c); >- std::string getComments() const {return comments;} > private: > bool getDouble(std::string key, double *varDouble); > bool getInt(std::string key, int *varInt); >@@ -388,7 +394,7 @@ > private: > std::string comments; > std::string name; >- DRW_Variant *curr; >+ DRW_Variant* curr; > int version; //to use on read > }; > >diff -aur libdxfrw-0.5.11/src/intern/dxfreader.cpp libdxfrw/src/intern/dxfreader.cpp >--- libdxfrw-0.5.11/src/intern/dxfreader.cpp 2013-12-29 04:00:40.000000000 -0600 >+++ libdxfrw/src/intern/dxfreader.cpp 2014-05-29 22:54:17.000000000 -0500 >@@ -234,7 +234,7 @@ > std::string text; > if (readString(&text)){ > #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: "); > DBG(text);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1093657
: 901510