From c95b162c0dc6166f3fd943f214993e44257a069b Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Mon, 11 Apr 2016 05:27:51 +0300 Subject: [PATCH 1/2] Fixed build in win7 --HG-- branch : feature --- src/libs/vgeometry/vabstractcubicbezier.cpp | 1 + src/libs/vtools/tools/drawTools/vdrawtool.h | 2 +- src/libs/vtools/tools/vabstracttool.h | 2 +- src/libs/vtools/tools/vdatatool.h | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/vgeometry/vabstractcubicbezier.cpp b/src/libs/vgeometry/vabstractcubicbezier.cpp index 6a167bc1e..feb04cd51 100644 --- a/src/libs/vgeometry/vabstractcubicbezier.cpp +++ b/src/libs/vgeometry/vabstractcubicbezier.cpp @@ -31,6 +31,7 @@ #include #include +#include //--------------------------------------------------------------------------------------------------------------------- VAbstractCubicBezier::VAbstractCubicBezier(const GOType &type, const quint32 &idObject, const Draw &mode) diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index dcabb0288..76e8adfa3 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -30,7 +30,7 @@ #define VDRAWTOOL_H #include "../vabstracttool.h" -#include "../../dialogs/tools/dialogtool.h" +#include "dialogs/tools/dialogtool.h" #include "../vwidgets/vmaingraphicsview.h" #include diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index 8a86c7e90..8126fdfb8 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -33,7 +33,7 @@ #include "../ifc/xml/vabstractpattern.h" #include "../vmisc/vabstractapplication.h" #include "../vwidgets/vmaingraphicsscene.h" -#include "../visualization/visualization.h" +#include "visualization/visualization.h" class QDomElement; class QLineF; diff --git a/src/libs/vtools/tools/vdatatool.h b/src/libs/vtools/tools/vdatatool.h index 3b939b07e..6405e2a59 100644 --- a/src/libs/vtools/tools/vdatatool.h +++ b/src/libs/vtools/tools/vdatatool.h @@ -29,7 +29,7 @@ #ifndef VDATATOOL_H #define VDATATOOL_H -#include "../../vpatterndb/vcontainer.h" +#include "../vpatterndb/vcontainer.h" #include "../vmisc/logging.h" Q_DECLARE_LOGGING_CATEGORY(vTool) From 66fbcab64c4aa85e47d74508283f944067c8bc5d Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Mon, 11 Apr 2016 05:52:32 +0300 Subject: [PATCH 2/2] Better to use qDegreesToRadians than M_PI/180 --HG-- branch : feature --- src/libs/vgeometry/varc.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/vgeometry/varc.cpp b/src/libs/vgeometry/varc.cpp index 6637d3ad7..2936c1036 100644 --- a/src/libs/vgeometry/varc.cpp +++ b/src/libs/vgeometry/varc.cpp @@ -123,7 +123,7 @@ VArc::~VArc() */ qreal VArc::GetLength() const { - qreal length = (M_PI * d->radius)/180 * AngleArc(); + qreal length = d->radius * qDegreesToRadians(AngleArc()); if (d->isFlipped) { length *= -1; @@ -232,7 +232,7 @@ QVector VArc::GetPoints() const for (int i = 0; i < sectionAngle.size(); ++i) { - const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(M_PI/180.0 * sectionAngle.at(i) * 0.25); + const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(qDegreesToRadians(sectionAngle.at(i)) * 0.25); const QPointF center = GetCenter().toQPointF(); @@ -297,7 +297,8 @@ QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const len = length; } - qreal n = (len*180)/(M_PI*d->radius); // n - is angle in degrees + qreal n = qRadiansToDegrees(len/d->radius); // n - is angle in degrees + QLineF line(GetCenter().toQPointF(), GetP1()); line.setAngle(line.angle()+n); @@ -374,7 +375,7 @@ void VArc::FindF2(qreal length) length = MaxLength(); } - qreal arcAngle = (qAbs(length)*180)/(M_PI*d->radius); + qreal arcAngle = qAbs(qRadiansToDegrees(length/d->radius)); if (d->isFlipped) {