mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Remove custom QGIS debug code and partially resync with upstream library
Allows removing the qgis_core/qt dependancy from embedded libdxfrw copy
This commit is contained in:
parent
f14ddac702
commit
f14c7a9786
9
external/libdxfrw/CMakeLists.txt
vendored
9
external/libdxfrw/CMakeLists.txt
vendored
@ -1,8 +1,3 @@
|
||||
|
||||
include_directories(SYSTEM
|
||||
${Qt5Core_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(libdxfrw STATIC
|
||||
drw_base.cpp
|
||||
drw_classes.cpp
|
||||
@ -32,10 +27,6 @@ target_include_directories(libdxfrw PUBLIC
|
||||
|
||||
set_property(TARGET libdxfrw PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
target_link_libraries(libdxfrw
|
||||
qgis_core # QgsDebugMsg
|
||||
)
|
||||
|
||||
if(FALSE)
|
||||
if(DOXYGEN_FOUND)
|
||||
add_custom_target(doxygen-dxfrw ALL
|
||||
|
5079
external/libdxfrw/drw_entities.cpp
vendored
5079
external/libdxfrw/drw_entities.cpp
vendored
File diff suppressed because it is too large
Load Diff
206
external/libdxfrw/drw_entities.h
vendored
206
external/libdxfrw/drw_entities.h
vendored
@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include "drw_base.h"
|
||||
|
||||
class dxfReader;
|
||||
@ -170,25 +171,18 @@ class DRW_Entity
|
||||
, numReactors( e.numReactors )
|
||||
, curr( nullptr )
|
||||
{
|
||||
for ( std::vector<DRW_Variant *>::const_iterator it = e.extData.begin(); it != e.extData.end(); ++it )
|
||||
for ( auto it = e.extData.begin(); it != e.extData.end(); ++it )
|
||||
{
|
||||
extData.push_back( new DRW_Variant( *( *it ) ) );
|
||||
extData.push_back( std::make_shared<DRW_Variant>( *( *it ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~DRW_Entity()
|
||||
{
|
||||
for ( std::vector<DRW_Variant *>::iterator it = extData.begin(); it != extData.end(); ++it )
|
||||
delete *it;
|
||||
|
||||
extData.clear();
|
||||
}
|
||||
virtual ~DRW_Entity() = default;
|
||||
|
||||
void reset()
|
||||
{
|
||||
for ( std::vector<DRW_Variant *>::iterator it = extData.begin(); it != extData.end(); ++it )
|
||||
delete *it;
|
||||
extData.clear();
|
||||
curr.reset();
|
||||
}
|
||||
|
||||
virtual void applyExtrusion() = 0;
|
||||
@ -230,7 +224,7 @@ class DRW_Entity
|
||||
int plotStyle; //!< Hard pointer id to plot style object, code 390
|
||||
DRW::ShadowMode shadow; //!< Shadow mode, code 284
|
||||
bool haveExtrusion; //!< Set to true if the entity have extrusion
|
||||
std::vector<DRW_Variant *> extData; //!< FIFO list of extended data, codes 1000 to 1071
|
||||
std::vector<std::shared_ptr<DRW_Variant>> extData; /*!< FIFO list of extended data, codes 1000 to 1071*/
|
||||
|
||||
protected: //only for read dwg
|
||||
duint8 haveNextLinks; // aka nolinks //B
|
||||
@ -252,7 +246,7 @@ class DRW_Entity
|
||||
private:
|
||||
DRW_Coord extAxisX;
|
||||
DRW_Coord extAxisY;
|
||||
DRW_Variant *curr = nullptr;
|
||||
std::shared_ptr<DRW_Variant> curr;
|
||||
};
|
||||
|
||||
|
||||
@ -349,7 +343,7 @@ class DRW_Circle : public DRW_Point
|
||||
public:
|
||||
DRW_Circle( enum DRW::ETYPE type = DRW::CIRCLE )
|
||||
: DRW_Point( type )
|
||||
, mRadius( 0. )
|
||||
, radius( 0. )
|
||||
{
|
||||
}
|
||||
|
||||
@ -360,7 +354,7 @@ class DRW_Circle : public DRW_Point
|
||||
virtual bool parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs = 0 );
|
||||
|
||||
public:
|
||||
double mRadius; //!< Radius, code 40
|
||||
double radius; //!< Radius, code 40
|
||||
};
|
||||
|
||||
/**
|
||||
@ -384,7 +378,7 @@ class DRW_Arc : public DRW_Circle
|
||||
//! center point in OCS
|
||||
const DRW_Coord ¢er() { return basePoint; }
|
||||
//! the radius of the circle
|
||||
double radius() { return mRadius; }
|
||||
double getRadius() { return radius; }
|
||||
//! start angle in radians
|
||||
double startAngle() { return staangle; }
|
||||
//! end angle in radians
|
||||
@ -458,7 +452,7 @@ class DRW_Trace : public DRW_Line
|
||||
DRW_Trace( enum DRW::ETYPE type = DRW::TRACE )
|
||||
: DRW_Line( type )
|
||||
, thirdPoint( 0., 0., 0. )
|
||||
, fourthPoint( 0., 0., 0. )
|
||||
, forthPoint( 0., 0., 0. )
|
||||
{
|
||||
}
|
||||
|
||||
@ -470,7 +464,7 @@ class DRW_Trace : public DRW_Line
|
||||
|
||||
public:
|
||||
DRW_Coord thirdPoint; //!< Third point, code 12, 22 & 32
|
||||
DRW_Coord fourthPoint; //!< Four point, code 13, 23 & 33
|
||||
DRW_Coord forthPoint; //!< Four point, code 13, 23 & 33
|
||||
};
|
||||
|
||||
/**
|
||||
@ -544,7 +538,7 @@ class DRW_3Dface : public DRW_Trace
|
||||
//! third corner in WCS
|
||||
const DRW_Coord &thirdCorner() { return thirdPoint; }
|
||||
//! fourth corner in WCS
|
||||
const DRW_Coord &fourthCorner() { return fourthPoint; }
|
||||
const DRW_Coord &fourthCorner() { return forthPoint; }
|
||||
//! edge visibility flags
|
||||
InvisibleEdgeFlags edgeFlags() { return ( InvisibleEdgeFlags )invisibleflag; }
|
||||
|
||||
@ -661,36 +655,25 @@ class DRW_LWPolyline : public DRW_Entity
|
||||
, extPoint( p.extPoint )
|
||||
, vertex( nullptr )
|
||||
{
|
||||
for ( unsigned i = 0; i < p.vertlist.size(); i++ )// RLZ ok or new
|
||||
vertlist.push_back( new DRW_Vertex2D( *( p.vertlist.at( i ) ) ) );
|
||||
for (unsigned i=0; i<p.vertlist.size(); i++)// RLZ ok or new
|
||||
this->vertlist.push_back(
|
||||
std::make_shared<DRW_Vertex2D>(*p.vertlist.at(i))
|
||||
);
|
||||
}
|
||||
|
||||
~DRW_LWPolyline()
|
||||
{
|
||||
while ( !vertlist.empty() )
|
||||
{
|
||||
vertlist.pop_back();
|
||||
}
|
||||
}
|
||||
virtual void applyExtrusion();
|
||||
void addVertex( DRW_Vertex2D v )
|
||||
{
|
||||
DRW_Vertex2D *vert = new DRW_Vertex2D();
|
||||
vert->x = v.x;
|
||||
vert->y = v.y;
|
||||
vert->stawidth = v.stawidth;
|
||||
vert->endwidth = v.endwidth;
|
||||
vert->bulge = v.bulge;
|
||||
vertlist.push_back( vert );
|
||||
std::shared_ptr<DRW_Vertex2D> vert = std::make_shared<DRW_Vertex2D>(v);
|
||||
vertlist.push_back(vert);
|
||||
}
|
||||
DRW_Vertex2D *addVertex()
|
||||
{
|
||||
DRW_Vertex2D *vert = new DRW_Vertex2D();
|
||||
vert->stawidth = 0;
|
||||
vert->endwidth = 0;
|
||||
vert->bulge = 0;
|
||||
vertlist.push_back( vert );
|
||||
return vert;
|
||||
std::shared_ptr<DRW_Vertex2D> addVertex () {
|
||||
std::shared_ptr<DRW_Vertex2D> vert = std::make_shared<DRW_Vertex2D>();
|
||||
vert->stawidth = 0;
|
||||
vert->endwidth = 0;
|
||||
vert->bulge = 0;
|
||||
vertlist.push_back(vert);
|
||||
return vert;
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -698,14 +681,14 @@ class DRW_LWPolyline : public DRW_Entity
|
||||
bool parseDwg( DRW::Version v, dwgBuffer *buf, duint32 bs = 0 );
|
||||
|
||||
public:
|
||||
std::vector<DRW_Vertex2D *>::size_type vertexnum; //!< Number of vertices, code 90
|
||||
int vertexnum; //!< Number of vertices, code 90
|
||||
int flags; //!< Polyline flag, code 70, default 0
|
||||
double width; //!< Constant width, code 43
|
||||
double elevation; //!< Elevation, code 38
|
||||
double thickness; //!< Thickness, code 39
|
||||
DRW_Coord extPoint; //!< Dir extrusion normal vector, code 210, 220 & 230
|
||||
DRW_Vertex2D *vertex; //!< Current vertex to add data
|
||||
std::vector<DRW_Vertex2D *> vertlist; //!< Vertex list
|
||||
std::shared_ptr<DRW_Vertex2D> vertex; /*!< current vertex to add data */
|
||||
std::vector<std::shared_ptr<DRW_Vertex2D>> vertlist; /*!< vertex list */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -934,7 +917,7 @@ class DRW_Polyline : public DRW_Point
|
||||
std::vector<DRW_Vertex *> vertlist; //!< Vertex list
|
||||
|
||||
private:
|
||||
std::list<duint32> handleList; // list of handles, only in 2004+
|
||||
std::list<duint32> handlesList; // list of handles, only in 2004+
|
||||
duint32 firstEH; // handle of first entity, only in pre-2004
|
||||
duint32 lastEH; // handle of last entity, only in pre-2004
|
||||
dwgHandle seqEndH; // handle of SEQEND entity
|
||||
@ -963,17 +946,7 @@ class DRW_Spline : public DRW_Entity
|
||||
, fitpoint( nullptr )
|
||||
{
|
||||
}
|
||||
~DRW_Spline()
|
||||
{
|
||||
while ( !controllist.empty() )
|
||||
{
|
||||
controllist.pop_back();
|
||||
}
|
||||
while ( !fitlist.empty() )
|
||||
{
|
||||
fitlist.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void applyExtrusion() {}
|
||||
|
||||
protected:
|
||||
@ -1003,12 +976,13 @@ class DRW_Spline : public DRW_Entity
|
||||
double tolfit; //!< Fit point tolerance, code 44, default 0.0000001
|
||||
|
||||
std::vector<double> knotslist; //!< Knots list, code 40
|
||||
std::vector<DRW_Coord *> controllist; //!< Control points list, code 10, 20 & 30
|
||||
std::vector<DRW_Coord *> fitlist; //!< Fit points list, code 11, 21 & 31
|
||||
std::vector<double> weightlist; /*!< weight list, code 41 */
|
||||
std::vector<std::shared_ptr<DRW_Coord>> controllist; /*!< control points list, code 10, 20 & 30 */
|
||||
std::vector<std::shared_ptr<DRW_Coord>> fitlist; /*!< fit points list, code 11, 21 & 31 */
|
||||
|
||||
private:
|
||||
DRW_Coord *controlpoint; //!< Current control point to add data
|
||||
DRW_Coord *fitpoint; //!< Current fit point to add data
|
||||
std::shared_ptr<DRW_Coord> controlpoint; /*!< current control point to add data */
|
||||
std::shared_ptr<DRW_Coord> fitpoint; /*!< current fit point to add data */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1024,20 +998,6 @@ class DRW_HatchLoop
|
||||
{
|
||||
}
|
||||
|
||||
~DRW_HatchLoop()
|
||||
{
|
||||
#if 0
|
||||
while ( !pollist.empty() )
|
||||
{
|
||||
pollist.pop_back();
|
||||
}
|
||||
#endif
|
||||
while ( !objlist.empty() )
|
||||
{
|
||||
objlist.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
void update()
|
||||
{
|
||||
numedges = objlist.size();
|
||||
@ -1048,7 +1008,7 @@ class DRW_HatchLoop
|
||||
std::vector<DRW_Entity *>::size_type numedges; //!< Number of edges (if not a polyline), code 93
|
||||
//TODO: store lwpolylines as entities
|
||||
// std::vector<DRW_LWPolyline *> pollist; //!< Polyline list
|
||||
std::vector<DRW_Entity *> objlist; //!< Entities list
|
||||
std::vector<std::shared_ptr<DRW_Entity>> objlist; /*!< entities list */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1076,17 +1036,8 @@ class DRW_Hatch : public DRW_Point
|
||||
clearEntities();
|
||||
}
|
||||
|
||||
~DRW_Hatch()
|
||||
{
|
||||
while ( !looplist.empty() )
|
||||
{
|
||||
looplist.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
void appendLoop( DRW_HatchLoop *v )
|
||||
{
|
||||
looplist.push_back( v );
|
||||
void appendLoop (std::shared_ptr<DRW_HatchLoop> const& v) {
|
||||
looplist.push_back(v);
|
||||
}
|
||||
|
||||
virtual void applyExtrusion() {}
|
||||
@ -1102,12 +1053,12 @@ class DRW_Hatch : public DRW_Point
|
||||
int hstyle; //!< Hatch style, code 75
|
||||
int hpattern; //!< Hatch pattern type, code 76
|
||||
int doubleflag; //!< Hatch pattern double flag, code 77, double=1, single=0
|
||||
std::vector<DRW_HatchLoop *>::size_type loopsnum; //!< Number of boundary paths (loops), code 91
|
||||
int loopsnum; //!< Number of boundary paths (loops), code 91
|
||||
double angle; //!< Hatch pattern angle, code 52
|
||||
double scale; //!< Hatch pattern scale, code 41
|
||||
int deflines; //!< Number of pattern definition lines, code 78
|
||||
|
||||
std::vector<DRW_HatchLoop *> looplist; //!< Polyline list
|
||||
std::vector<std::shared_ptr<DRW_HatchLoop>> looplist; /*!< polyline list */
|
||||
|
||||
private:
|
||||
void clearEntities()
|
||||
@ -1122,53 +1073,48 @@ class DRW_Hatch : public DRW_Point
|
||||
|
||||
void addLine()
|
||||
{
|
||||
clearEntities();
|
||||
if ( loop )
|
||||
{
|
||||
pt = line = new DRW_Line;
|
||||
loop->objlist.push_back( line );
|
||||
}
|
||||
clearEntities();
|
||||
if (loop) {
|
||||
pt = line = std::make_shared<DRW_Line>();
|
||||
loop->objlist.push_back(line);
|
||||
}
|
||||
}
|
||||
|
||||
void addArc()
|
||||
{
|
||||
clearEntities();
|
||||
if ( loop )
|
||||
{
|
||||
pt = arc = new DRW_Arc;
|
||||
loop->objlist.push_back( arc );
|
||||
}
|
||||
clearEntities();
|
||||
if (loop) {
|
||||
pt = arc = std::make_shared<DRW_Arc>();
|
||||
loop->objlist.push_back(arc);
|
||||
}
|
||||
}
|
||||
|
||||
void addEllipse()
|
||||
{
|
||||
clearEntities();
|
||||
if ( loop )
|
||||
{
|
||||
pt = ellipse = new DRW_Ellipse;
|
||||
loop->objlist.push_back( ellipse );
|
||||
}
|
||||
clearEntities();
|
||||
if (loop) {
|
||||
pt = ellipse = std::make_shared<DRW_Ellipse>();
|
||||
loop->objlist.push_back(ellipse);
|
||||
}
|
||||
}
|
||||
|
||||
void addSpline()
|
||||
{
|
||||
clearEntities();
|
||||
if ( loop )
|
||||
{
|
||||
pt = nullptr;
|
||||
spline = new DRW_Spline;
|
||||
loop->objlist.push_back( spline );
|
||||
}
|
||||
clearEntities();
|
||||
if (loop) {
|
||||
pt.reset();
|
||||
spline = std::make_shared<DRW_Spline>();
|
||||
loop->objlist.push_back(spline);
|
||||
}
|
||||
}
|
||||
|
||||
DRW_HatchLoop *loop; //!< Current loop to add data
|
||||
DRW_Line *line = nullptr;
|
||||
DRW_Arc *arc = nullptr;
|
||||
DRW_Ellipse *ellipse = nullptr;
|
||||
DRW_Spline *spline = nullptr;
|
||||
DRW_LWPolyline *pline = nullptr;
|
||||
DRW_Point *pt = nullptr;
|
||||
DRW_Vertex2D *plvert = nullptr;
|
||||
std::shared_ptr<DRW_HatchLoop> loop; /*!< current loop to add data */
|
||||
std::shared_ptr<DRW_Line> line;
|
||||
std::shared_ptr<DRW_Arc> arc;
|
||||
std::shared_ptr<DRW_Ellipse> ellipse;
|
||||
std::shared_ptr<DRW_Spline> spline;
|
||||
std::shared_ptr<DRW_LWPolyline> pline;
|
||||
std::shared_ptr<DRW_Point> pt;
|
||||
std::shared_ptr<DRW_Vertex2D> plvert;
|
||||
bool ispol;
|
||||
};
|
||||
|
||||
@ -1578,14 +1524,6 @@ class DRW_Leader : public DRW_Entity
|
||||
{
|
||||
}
|
||||
|
||||
~DRW_Leader()
|
||||
{
|
||||
while ( !vertexlist.empty() )
|
||||
{
|
||||
vertexlist.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void applyExtrusion() {}
|
||||
|
||||
protected:
|
||||
@ -1609,10 +1547,10 @@ class DRW_Leader : public DRW_Entity
|
||||
DRW_Coord offsetblock; //!< Offset of last leader vertex from block, code 212, 222 & 232
|
||||
DRW_Coord offsettext; //!< Offset of last leader vertex from annotation, code 213, 223 & 233
|
||||
|
||||
std::vector<DRW_Coord *> vertexlist; //!< Vertex points list, code 10, 20 & 30
|
||||
std::vector<std::shared_ptr<DRW_Coord>> vertexlist; /*!< vertex points list, code 10, 20 & 30 */
|
||||
|
||||
private:
|
||||
DRW_Coord *vertexpoint; //!< Current control point to add data
|
||||
std::shared_ptr<DRW_Coord> vertexpoint; /*!< current control point to add data */
|
||||
dwgHandle dimStyleH;
|
||||
dwgHandle AnnotH;
|
||||
};
|
||||
|
2063
external/libdxfrw/drw_objects.cpp
vendored
2063
external/libdxfrw/drw_objects.cpp
vendored
File diff suppressed because it is too large
Load Diff
2
external/libdxfrw/intern/dwgreader.cpp
vendored
2
external/libdxfrw/intern/dwgreader.cpp
vendored
@ -1070,7 +1070,7 @@ bool dwgReader::readPlineVertex( DRW_Polyline &pline, dwgBuffer *dbuf )
|
||||
}
|
||||
else //2004+
|
||||
{
|
||||
for ( std::list<duint32>::iterator it = pline.handleList.begin() ; it != pline.handleList.end(); ++it )
|
||||
for ( std::list<duint32>::iterator it = pline.handlesList.begin() ; it != pline.handlesList.end(); ++it )
|
||||
{
|
||||
duint32 nextH = *it;
|
||||
mit = ObjectMap.find( nextH );
|
||||
|
48
external/libdxfrw/libdxfrw.cpp
vendored
48
external/libdxfrw/libdxfrw.cpp
vendored
@ -732,7 +732,7 @@ bool dxfRW::writeCircle( DRW_Circle *ent )
|
||||
{
|
||||
writer->writeDouble( 30, ent->basePoint.z );
|
||||
}
|
||||
writer->writeDouble( 40, ent->mRadius );
|
||||
writer->writeDouble( 40, ent->radius );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -750,7 +750,7 @@ bool dxfRW::writeArc( DRW_Arc *ent )
|
||||
{
|
||||
writer->writeDouble( 30, ent->basePoint.z );
|
||||
}
|
||||
writer->writeDouble( 40, ent->mRadius );
|
||||
writer->writeDouble( 40, ent->radius );
|
||||
if ( version > DRW::AC1009 )
|
||||
{
|
||||
writer->writeString( 100, "AcDbArc" );
|
||||
@ -809,9 +809,9 @@ bool dxfRW::writeTrace( DRW_Trace *ent )
|
||||
writer->writeDouble( 12, ent->thirdPoint.x );
|
||||
writer->writeDouble( 22, ent->thirdPoint.y );
|
||||
writer->writeDouble( 32, ent->thirdPoint.z );
|
||||
writer->writeDouble( 13, ent->fourthPoint.x );
|
||||
writer->writeDouble( 23, ent->fourthPoint.y );
|
||||
writer->writeDouble( 33, ent->fourthPoint.z );
|
||||
writer->writeDouble( 13, ent->forthPoint.x );
|
||||
writer->writeDouble( 23, ent->forthPoint.y );
|
||||
writer->writeDouble( 33, ent->forthPoint.z );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -832,9 +832,9 @@ bool dxfRW::writeSolid( DRW_Solid *ent )
|
||||
writer->writeDouble( 12, ent->thirdPoint.x );
|
||||
writer->writeDouble( 22, ent->thirdPoint.y );
|
||||
writer->writeDouble( 32, ent->thirdPoint.z );
|
||||
writer->writeDouble( 13, ent->fourthPoint.x );
|
||||
writer->writeDouble( 23, ent->fourthPoint.y );
|
||||
writer->writeDouble( 33, ent->fourthPoint.z );
|
||||
writer->writeDouble( 13, ent->forthPoint.x );
|
||||
writer->writeDouble( 23, ent->forthPoint.y );
|
||||
writer->writeDouble( 33, ent->forthPoint.z );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -855,9 +855,9 @@ bool dxfRW::write3dface( DRW_3Dface *ent )
|
||||
writer->writeDouble( 12, ent->thirdPoint.x );
|
||||
writer->writeDouble( 22, ent->thirdPoint.y );
|
||||
writer->writeDouble( 32, ent->thirdPoint.z );
|
||||
writer->writeDouble( 13, ent->fourthPoint.x );
|
||||
writer->writeDouble( 23, ent->fourthPoint.y );
|
||||
writer->writeDouble( 33, ent->fourthPoint.z );
|
||||
writer->writeDouble( 13, ent->forthPoint.x );
|
||||
writer->writeDouble( 23, ent->forthPoint.y );
|
||||
writer->writeDouble( 33, ent->forthPoint.z );
|
||||
writer->writeInt16( 70, ent->invisibleflag );
|
||||
return true;
|
||||
}
|
||||
@ -873,16 +873,16 @@ bool dxfRW::writeLWPolyline( DRW_LWPolyline *ent )
|
||||
writer->writeString( 100, "AcDbPolyline" );
|
||||
}
|
||||
ent->vertexnum = ent->vertlist.size();
|
||||
writer->writeInt32( 90, static_cast<int>( ent->vertexnum ) );
|
||||
writer->writeInt32( 90, ent->vertexnum );
|
||||
writer->writeInt16( 70, ent->flags );
|
||||
writer->writeDouble( 43, ent->width );
|
||||
if ( ent->elevation != 0 )
|
||||
writer->writeDouble( 38, ent->elevation );
|
||||
if ( ent->thickness != 0 )
|
||||
writer->writeDouble( 39, ent->thickness );
|
||||
for ( std::vector<DRW_Vertex2D *>::size_type i = 0; i < ent->vertexnum; i++ )
|
||||
for ( int i = 0; i < ent->vertexnum; i++ )
|
||||
{
|
||||
DRW_Vertex2D *v = ent->vertlist.at( i );
|
||||
auto v = ent->vertlist.at( i );
|
||||
writer->writeDouble( 10, v->x );
|
||||
writer->writeDouble( 20, v->y );
|
||||
if ( v->stawidth != 0 )
|
||||
@ -1044,7 +1044,7 @@ bool dxfRW::writeSpline( DRW_Spline *ent )
|
||||
}
|
||||
for ( int i = 0; i < ent->ncontrol; i++ )
|
||||
{
|
||||
DRW_Coord *crd = ent->controllist.at( i );
|
||||
auto crd = ent->controllist.at( i );
|
||||
writer->writeDouble( 10, crd->x );
|
||||
writer->writeDouble( 20, crd->y );
|
||||
writer->writeDouble( 30, crd->z );
|
||||
@ -1073,12 +1073,12 @@ bool dxfRW::writeHatch( DRW_Hatch *ent )
|
||||
writer->writeString( 2, ent->name );
|
||||
writer->writeInt16( 70, ent->solid );
|
||||
writer->writeInt16( 71, ent->associative );
|
||||
ent->loopsnum = ent->looplist.size();
|
||||
writer->writeInt16( 91, static_cast<int>( ent->loopsnum ) );
|
||||
ent->loopsnum = static_cast< int >( ent->looplist.size() );
|
||||
writer->writeInt16( 91, ent->loopsnum );
|
||||
//write paths data
|
||||
for ( std::vector<DRW_HatchLoop *>::size_type i = 0; i < ent->loopsnum; i++ )
|
||||
for ( int i = 0; i < ent->loopsnum; i++ )
|
||||
{
|
||||
DRW_HatchLoop *loop = ent->looplist.at( i );
|
||||
auto loop = ent->looplist.at( i );
|
||||
writer->writeInt16( 92, loop->type );
|
||||
if ( ( loop->type & 2 ) == 2 )
|
||||
{
|
||||
@ -1096,7 +1096,7 @@ bool dxfRW::writeHatch( DRW_Hatch *ent )
|
||||
case DRW::LINE:
|
||||
{
|
||||
writer->writeInt16( 72, 1 );
|
||||
DRW_Line *l = ( DRW_Line * )loop->objlist.at( j );
|
||||
DRW_Line* l = (DRW_Line*)loop->objlist.at(j).get();
|
||||
writer->writeDouble( 10, l->basePoint.x );
|
||||
writer->writeDouble( 20, l->basePoint.y );
|
||||
writer->writeDouble( 11, l->secPoint.x );
|
||||
@ -1106,10 +1106,10 @@ bool dxfRW::writeHatch( DRW_Hatch *ent )
|
||||
case DRW::ARC:
|
||||
{
|
||||
writer->writeInt16( 72, 2 );
|
||||
DRW_Arc *a = ( DRW_Arc * )loop->objlist.at( j );
|
||||
DRW_Arc* a = (DRW_Arc*)loop->objlist.at(j).get();
|
||||
writer->writeDouble( 10, a->basePoint.x );
|
||||
writer->writeDouble( 20, a->basePoint.y );
|
||||
writer->writeDouble( 40, a->mRadius );
|
||||
writer->writeDouble( 40, a->radius );
|
||||
writer->writeDouble( 50, a->staangle * ARAD );
|
||||
writer->writeDouble( 51, a->endangle * ARAD );
|
||||
writer->writeInt16( 73, a->isccw );
|
||||
@ -1118,7 +1118,7 @@ bool dxfRW::writeHatch( DRW_Hatch *ent )
|
||||
case DRW::ELLIPSE:
|
||||
{
|
||||
writer->writeInt16( 72, 3 );
|
||||
DRW_Ellipse *a = ( DRW_Ellipse * )loop->objlist.at( j );
|
||||
DRW_Ellipse* a = (DRW_Ellipse*)loop->objlist.at(j).get();
|
||||
a->correctAxis();
|
||||
writer->writeDouble( 10, a->basePoint.x );
|
||||
writer->writeDouble( 20, a->basePoint.y );
|
||||
@ -1184,7 +1184,7 @@ bool dxfRW::writeLeader( DRW_Leader *ent )
|
||||
writer->writeDouble( 76, ent->vertexlist.size() );
|
||||
for ( unsigned int i = 0; i < ent->vertexlist.size(); i++ )
|
||||
{
|
||||
DRW_Coord *vert = ent->vertexlist.at( i );
|
||||
auto vert = ent->vertexlist.at( i );
|
||||
writer->writeDouble( 10, vert->x );
|
||||
writer->writeDouble( 20, vert->y );
|
||||
writer->writeDouble( 30, vert->z );
|
||||
|
@ -1579,9 +1579,9 @@ bool QgsDwgImporter::circularStringFromArc( const DRW_Arc &data, QgsCircularStri
|
||||
const double a2 = data.isccw ? data.endangle : -data.endangle;
|
||||
|
||||
c.setPoints( QgsPointSequence()
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a0 ) * data.mRadius, data.basePoint.y + std::sin( a0 ) * data.mRadius )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a1 ) * data.mRadius, data.basePoint.y + std::sin( a1 ) * data.mRadius )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a2 ) * data.mRadius, data.basePoint.y + std::sin( a2 ) * data.mRadius )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a0 ) * data.radius, data.basePoint.y + std::sin( a0 ) * data.radius )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a1 ) * data.radius, data.basePoint.y + std::sin( a1 ) * data.radius )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a2 ) * data.radius, data.basePoint.y + std::sin( a2 ) * data.radius )
|
||||
);
|
||||
|
||||
return true;
|
||||
@ -1635,9 +1635,9 @@ void QgsDwgImporter::addCircle( const DRW_Circle &data )
|
||||
|
||||
QgsCircularString c;
|
||||
c.setPoints( QgsPointSequence()
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x - data.mRadius, data.basePoint.y, data.basePoint.z )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + data.mRadius, data.basePoint.y, data.basePoint.z )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x - data.mRadius, data.basePoint.y, data.basePoint.z )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x - data.radius, data.basePoint.y, data.basePoint.z )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + data.radius, data.basePoint.y, data.basePoint.z )
|
||||
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x - data.radius, data.basePoint.y, data.basePoint.z )
|
||||
);
|
||||
|
||||
if ( !createFeature( layer, f, c ) )
|
||||
@ -2457,7 +2457,7 @@ void QgsDwgImporter::addSolid( const DRW_Solid &data )
|
||||
QgsPointSequence s;
|
||||
s << QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x, data.basePoint.y, data.basePoint.z );
|
||||
s << QgsPoint( QgsWkbTypes::PointZ, data.secPoint.x, data.secPoint.y, data.basePoint.z );
|
||||
s << QgsPoint( QgsWkbTypes::PointZ, data.fourthPoint.x, data.fourthPoint.y, data.basePoint.z );
|
||||
s << QgsPoint( QgsWkbTypes::PointZ, data.forthPoint.x, data.forthPoint.y, data.basePoint.z );
|
||||
s << QgsPoint( QgsWkbTypes::PointZ, data.thirdPoint.x, data.thirdPoint.y, data.basePoint.z );
|
||||
s << s[0];
|
||||
|
||||
@ -2650,17 +2650,12 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
|
||||
for ( std::vector<DRW_Entity *>::size_type j = 0; j < hatchLoop.objlist.size(); j++ )
|
||||
{
|
||||
Q_ASSERT( hatchLoop.objlist[j] );
|
||||
const DRW_Entity *entity = hatchLoop.objlist[j];
|
||||
|
||||
const DRW_LWPolyline *lwp = dynamic_cast<const DRW_LWPolyline *>( entity );
|
||||
const DRW_Line *l = dynamic_cast<const DRW_Line *>( entity );
|
||||
const DRW_Arc *a = dynamic_cast<const DRW_Arc *>( entity );
|
||||
const DRW_Spline *sp = dynamic_cast<const DRW_Spline *>( entity );
|
||||
if ( lwp )
|
||||
const DRW_Entity *entity = hatchLoop.objlist[j].get();
|
||||
if ( const DRW_LWPolyline *lwp = dynamic_cast<const DRW_LWPolyline *>( entity ) )
|
||||
{
|
||||
curveFromLWPolyline( *lwp, *cc );
|
||||
}
|
||||
else if ( l )
|
||||
else if ( const DRW_Line *l = dynamic_cast<const DRW_Line *>( entity ) )
|
||||
{
|
||||
QgsLineString *ls = new QgsLineString();
|
||||
ls->setPoints( QgsPointSequence()
|
||||
@ -2672,7 +2667,7 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
|
||||
|
||||
cc->addCurve( ls );
|
||||
}
|
||||
else if ( a )
|
||||
else if ( const DRW_Arc *a = dynamic_cast<const DRW_Arc *>( entity ) )
|
||||
{
|
||||
QgsCircularString *cs = new QgsCircularString();
|
||||
circularStringFromArc( *a, *cs );
|
||||
@ -2682,7 +2677,7 @@ void QgsDwgImporter::addHatch( const DRW_Hatch *pdata )
|
||||
|
||||
cc->addCurve( cs );
|
||||
}
|
||||
else if ( sp )
|
||||
else if ( const DRW_Spline *sp = dynamic_cast<const DRW_Spline *>( entity ) )
|
||||
{
|
||||
QgsLineString *ls = new QgsLineString();
|
||||
lineFromSpline( *sp, *ls );
|
||||
|
Loading…
x
Reference in New Issue
Block a user