diff --git a/src/libs/vdxf/dxflib/dl_entities.h b/src/libs/vdxf/dxflib/dl_entities.h index 67c8597ff..59d9f7084 100644 --- a/src/libs/vdxf/dxflib/dl_entities.h +++ b/src/libs/vdxf/dxflib/dl_entities.h @@ -39,11 +39,9 @@ struct DXFLIB_EXPORT DL_LayerData * Constructor. * Parameters: see member variables. */ - DL_LayerData(const std::string& lName, - int lFlags) + DL_LayerData(const std::string& lName, int lFlags) + : name(lName), flags(lFlags) { - name = lName; - flags = lFlags; } /** Layer name. */ @@ -63,15 +61,10 @@ struct DXFLIB_EXPORT DL_BlockData * Constructor. * Parameters: see member variables. */ - DL_BlockData(const std::string& bName, - int bFlags, + DL_BlockData(const std::string& bName, int bFlags, double bbpx, double bbpy, double bbpz) - { - name = bName; - flags = bFlags; - bpx = bbpx; - bpy = bbpy; - bpz = bbpz; + : name(bName), flags(bFlags), bpx(bbpx), bpy(bbpy), bpz(bbpz) + { } /** Block name. */ @@ -208,10 +201,8 @@ struct DXFLIB_EXPORT DL_PointData * Parameters: see member variables. */ DL_PointData(double px=0.0, double py=0.0, double pz=0.0) + : x(px), y(py), z(pz) { - x = px; - y = py; - z = pz; } /*! X Coordinate of the point. */ @@ -235,14 +226,8 @@ struct DXFLIB_EXPORT DL_LineData */ DL_LineData(double lx1, double ly1, double lz1, double lx2, double ly2, double lz2) + : x1(lx1), y1(ly1), z1(lz1), x2(lx2), y2(ly2), z2(lz2) { - x1 = lx1; - y1 = ly1; - z1 = lz1; - - x2 = lx2; - y2 = ly2; - z2 = lz2; } /*! X Start coordinate of the point. */ @@ -336,14 +321,8 @@ struct DXFLIB_EXPORT DL_ArcData DL_ArcData(double acx, double acy, double acz, double aRadius, double aAngle1, double aAngle2) - { - - cx = acx; - cy = acy; - cz = acz; - radius = aRadius; - angle1 = aAngle1; - angle2 = aAngle2; + : cx(acx), cy(acy), cz(acz), radius(aRadius), angle1(aAngle1), angle2(aAngle2) + { } /*! X Coordinate of center point. */ @@ -374,12 +353,8 @@ struct DXFLIB_EXPORT DL_CircleData */ DL_CircleData(double acx, double acy, double acz, double aRadius) + : cx(acx), cy(acy), cz(acz), radius(aRadius) { - - cx = acx; - cy = acy; - cz = acz; - radius = aRadius; } /*! X Coordinate of center point. */ @@ -405,11 +380,8 @@ struct DXFLIB_EXPORT DL_PolylineData * Parameters: see member variables. */ DL_PolylineData(int pNumber, int pMVerteces, int pNVerteces, int pFlags) + : number(pNumber), m(pMVerteces), n(pNVerteces), flags(pFlags) { - number = pNumber; - m = pMVerteces; - n = pNVerteces; - flags = pFlags; } /*! Number of vertices in this polyline. */ @@ -438,11 +410,8 @@ struct DXFLIB_EXPORT DL_VertexData */ DL_VertexData(double px=0.0, double py=0.0, double pz=0.0, double pBulge=0.0) + : x(px), y(py), z(pz), bulge(pBulge) { - x = px; - y = py; - z = pz; - bulge = pBulge; } /*! X Coordinate of the vertex. */ @@ -463,8 +432,8 @@ struct DXFLIB_EXPORT DL_VertexData struct DXFLIB_EXPORT DL_TraceData { DL_TraceData() + : thickness(0.0) { - thickness = 0.0; for (int i=0; i<4; i++) { x[i] = 0.0; @@ -482,10 +451,8 @@ struct DXFLIB_EXPORT DL_TraceData double sx3, double sy3, double sz3, double sx4, double sy4, double sz4, double sthickness=0.0) + : thickness(sthickness) { - - thickness = sthickness; - x[0] = sx1; y[0] = sy1; z[0] = sz1; @@ -586,8 +553,8 @@ struct DXFLIB_EXPORT DL_KnotData * Parameters: see member variables. */ DL_KnotData(double pk) + : k(pk) { - k = pk; } /*! Knot value. */ @@ -606,11 +573,8 @@ struct DXFLIB_EXPORT DL_ControlPointData * Parameters: see member variables. */ DL_ControlPointData(double px, double py, double pz, double weight) + : x(px), y(py), z(pz), w(weight) { - x = px; - y = py; - z = pz; - w = weight; } /*! X coordinate of the control point. */ @@ -911,7 +875,6 @@ struct DXFLIB_EXPORT DL_AttributeData : public DL_TextData DL_AttributeData(const DL_TextData& tData, const std::string& tag) : DL_TextData(tData), tag(tag) { - } /** @@ -1063,15 +1026,9 @@ struct DXFLIB_EXPORT DL_DimAlignedData */ DL_DimAlignedData(double depx1, double depy1, double depz1, double depx2, double depy2, double depz2) - { - - epx1 = depx1; - epy1 = depy1; - epz1 = depz1; - - epx2 = depx2; - epy2 = depy2; - epz2 = depz2; + : epx1(depx1), epy1(depy1), epz1(depz1), + epx2(depx2), epy2(depy2), epz2(depz2) + { } /*! X Coordinate of Extension point 1. */ @@ -1103,18 +1060,10 @@ struct DXFLIB_EXPORT DL_DimLinearData DL_DimLinearData(double ddpx1, double ddpy1, double ddpz1, double ddpx2, double ddpy2, double ddpz2, double dAngle, double dOblique) + : dpx1(ddpx1), dpy1(ddpy1), dpz1(ddpz1), + dpx2(ddpx2), dpy2(ddpy2), dpz2(ddpz2), + angle(dAngle), oblique(dOblique) { - - dpx1 = ddpx1; - dpy1 = ddpy1; - dpz1 = ddpz1; - - dpx2 = ddpx2; - dpy2 = ddpy2; - dpz2 = ddpz2; - - angle = dAngle; - oblique = dOblique; } /*! X Coordinate of Extension point 1. */ @@ -1149,12 +1098,8 @@ struct DXFLIB_EXPORT DL_DimRadialData * Parameters: see member variables. */ DL_DimRadialData(double ddpx, double ddpy, double ddpz, double dleader) + : dpx(ddpx), dpy(ddpy), dpz(ddpz), leader(dleader) { - dpx = ddpx; - dpy = ddpy; - dpz = ddpz; - - leader = dleader; } /*! X Coordinate of definition point. */ @@ -1180,12 +1125,8 @@ struct DXFLIB_EXPORT DL_DimDiametricData * Parameters: see member variables. */ DL_DimDiametricData(double ddpx, double ddpy, double ddpz, double dleader) + : dpx(ddpx), dpy(ddpy), dpz(ddpz), leader(dleader) { - dpx = ddpx; - dpy = ddpy; - dpz = ddpz; - - leader = dleader; } /*! X Coordinate of definition point (DXF 15). */ @@ -1214,24 +1155,12 @@ struct DXFLIB_EXPORT DL_DimAngularData double ddpx2, double ddpy2, double ddpz2, double ddpx3, double ddpy3, double ddpz3, double ddpx4, double ddpy4, double ddpz4) - { - - dpx1 = ddpx1; - dpy1 = ddpy1; - dpz1 = ddpz1; - - dpx2 = ddpx2; - dpy2 = ddpy2; - dpz2 = ddpz2; - - dpx3 = ddpx3; - dpy3 = ddpy3; - dpz3 = ddpz3; - - dpx4 = ddpx4; - dpy4 = ddpy4; - dpz4 = ddpz4; - } + : dpx1(ddpx1), dpy1(ddpy1), dpz1(ddpz1), + dpx2(ddpx2), dpy2(ddpy2), dpz2(ddpz2), + dpx3(ddpx3), dpy3(ddpy3), dpz3(ddpz3), + dpx4(ddpx4), dpy4(ddpy4), dpz4(ddpz4) + { + } /*! X Coordinate of definition point 1. */ double dpx1; @@ -1275,20 +1204,11 @@ struct DXFLIB_EXPORT DL_DimAngular3PData DL_DimAngular3PData(double ddpx1, double ddpy1, double ddpz1, double ddpx2, double ddpy2, double ddpz2, double ddpx3, double ddpy3, double ddpz3) - { - - dpx1 = ddpx1; - dpy1 = ddpy1; - dpz1 = ddpz1; - - dpx2 = ddpx2; - dpy2 = ddpy2; - dpz2 = ddpz2; - - dpx3 = ddpx3; - dpy3 = ddpy3; - dpz3 = ddpz3; - } + : dpx1(ddpx1), dpy1(ddpy1), dpz1(ddpz1), + dpx2(ddpx2), dpy2(ddpy2), dpz2(ddpz2), + dpx3(ddpx3), dpy3(ddpy3), dpz3(ddpz3) + { + } /*! X Coordinate of definition point 1. */ double dpx1; @@ -1326,17 +1246,10 @@ struct DXFLIB_EXPORT DL_DimOrdinateData DL_DimOrdinateData(double ddpx1, double ddpy1, double ddpz1, double ddpx2, double ddpy2, double ddpz2, bool dxtype) + : dpx1(ddpx1), dpy1(ddpy1), dpz1(ddpz1), + dpx2(ddpx2), dpy2(ddpy2), dpz2(ddpz2), + xtype(dxtype) { - - dpx1 = ddpx1; - dpy1 = ddpy1; - dpz1 = ddpz1; - - dpx2 = ddpx2; - dpy2 = ddpy2; - dpz2 = ddpz2; - - xtype = dxtype; } /*! X Coordinate of definition point 1. */ @@ -1376,16 +1289,15 @@ struct DXFLIB_EXPORT DL_LeaderData double lTextAnnotationHeight, double lTextAnnotationWidth, int lNumber) + : arrowHeadFlag(lArrowHeadFlag), + leaderPathType(lLeaderPathType), + leaderCreationFlag(lLeaderCreationFlag), + hooklineDirectionFlag(lHooklineDirectionFlag), + hooklineFlag(lHooklineFlag), + textAnnotationHeight(lTextAnnotationHeight), + textAnnotationWidth(lTextAnnotationWidth), + number(lNumber) { - - arrowHeadFlag = lArrowHeadFlag; - leaderPathType = lLeaderPathType; - leaderCreationFlag = lLeaderCreationFlag; - hooklineDirectionFlag = lHooklineDirectionFlag; - hooklineFlag = lHooklineFlag; - textAnnotationHeight = lTextAnnotationHeight; - textAnnotationWidth = lTextAnnotationWidth; - number = lNumber; } /*! Arrow head flag (71). */ @@ -1418,10 +1330,8 @@ struct DXFLIB_EXPORT DL_LeaderVertexData * Parameters: see member variables. */ DL_LeaderVertexData(double px=0.0, double py=0.0, double pz=0.0) + : x(px), y(py), z(pz) { - x = px; - y = py; - z = pz; } /*! X Coordinate of the vertex. */ @@ -1463,7 +1373,6 @@ struct DXFLIB_EXPORT DL_HatchData originX(originX), originY(originY) { - } /*! Number of boundary paths (loops). */ @@ -1497,8 +1406,8 @@ struct DXFLIB_EXPORT DL_HatchLoopData * Parameters: see member variables. */ DL_HatchLoopData(int hNumEdges) + : numEdges(hNumEdges) { - numEdges = hNumEdges; } /*! Number of edges in this loop. */ @@ -1698,22 +1607,13 @@ struct DXFLIB_EXPORT DL_ImageData double ivx, double ivy, double ivz, int iwidth, int iheight, int ibrightness, int icontrast, int ifade) + : ref(iref), + ipx(iipx), ipy(iipy), ipz(iipz), + ux(iux), uy(iuy), uz(iuz), + vx(ivx), vy(ivy), vz(ivz), + width(iwidth), height(iheight), + brightness(ibrightness), contrast(icontrast), fade(ifade) { - ref = iref; - ipx = iipx; - ipy = iipy; - ipz = iipz; - ux = iux; - uy = iuy; - uz = iuz; - vx = ivx; - vy = ivy; - vz = ivz; - width = iwidth; - height = iheight; - brightness = ibrightness; - contrast = icontrast; - fade = ifade; } /*! Reference to the image file @@ -1762,9 +1662,8 @@ struct DXFLIB_EXPORT DL_ImageDefData */ DL_ImageDefData(const std::string& iref, const std::string& ifile) - { - ref = iref; - file = ifile; + : ref(iref), file(ifile) + { } /*! Reference to the image file diff --git a/src/libs/vdxf/dxflib/dl_writer.h b/src/libs/vdxf/dxflib/dl_writer.h index 882033ede..86a7f668e 100644 --- a/src/libs/vdxf/dxflib/dl_writer.h +++ b/src/libs/vdxf/dxflib/dl_writer.h @@ -62,12 +62,9 @@ public: /** * @param version DXF version. Defaults to DL_VERSION_2002. */ - DL_Writer(DL_Codes::version version) : m_handle(0x30) + DL_Writer(DL_Codes::version version) : m_handle(0x30), modelSpaceHandle(0), paperSpaceHandle(0), paperSpace0Handle(0) { this->version = version; - modelSpaceHandle = 0; - paperSpaceHandle = 0; - paperSpace0Handle = 0; } virtual ~DL_Writer() {}