From f9aa8964770c303dfb63222136a8f02bbc423df6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 31 Mar 2017 17:04:11 +0300 Subject: [PATCH] Refactoring. Avoid implicit conversions. --HG-- branch : develop --- src/app/valentina/xml/vpattern.cpp | 3 +- src/libs/vgeometry/vabstractcubicbezier.cpp | 10 ++-- src/libs/vgeometry/varc.cpp | 17 +++--- src/libs/vgeometry/vcubicbezier.cpp | 18 +++--- src/libs/vgeometry/vcubicbezierpath.cpp | 10 ++-- src/libs/vgeometry/vellipticalarc.cpp | 14 ++--- src/libs/vgeometry/vpointf.h | 5 +- src/libs/vgeometry/vspline.cpp | 42 +++++++------- src/libs/vgeometry/vspline_p.h | 6 +- src/libs/vgeometry/vsplinepath.cpp | 2 +- src/libs/vlayout/vlayoutpiece.cpp | 7 ++- src/libs/vmisc/backport/qmarginsf.h | 2 +- src/libs/vpatterndb/variables/vlineangle.cpp | 3 +- src/libs/vpatterndb/variables/vlinelength.cpp | 3 +- src/libs/vpatterndb/vpiecepath.cpp | 8 +-- .../tools/dialogcurveintersectaxis.cpp | 2 +- .../vtools/dialogs/tools/dialogendline.cpp | 2 +- .../vtools/dialogs/tools/dialogheight.cpp | 8 +-- .../dialogs/tools/dialoglineintersect.cpp | 8 +-- .../dialogs/tools/dialoglineintersectaxis.cpp | 2 +- .../vtools/dialogs/tools/dialogrotation.cpp | 2 +- .../flipping/vtoolflippingbyaxis.cpp | 2 +- .../flipping/vtoolflippingbyline.cpp | 4 +- .../drawTools/operation/vtoolrotation.cpp | 2 +- .../drawTools/toolcurve/vabstractspline.cpp | 4 +- .../tools/drawTools/toolcurve/vtoolspline.cpp | 36 +++++++----- .../drawTools/toolcurve/vtoolsplinepath.cpp | 28 ++++----- .../tooldoublepoint/vtooltruedarts.cpp | 4 +- .../toollinepoint/vtoolalongline.cpp | 2 +- .../toollinepoint/vtoolbisector.cpp | 3 +- .../toollinepoint/vtoolcurveintersectaxis.cpp | 2 +- .../toollinepoint/vtoolendline.cpp | 2 +- .../toollinepoint/vtoolheight.cpp | 3 +- .../toollinepoint/vtoollineintersectaxis.cpp | 4 +- .../toollinepoint/vtoollinepoint.cpp | 8 +-- .../toollinepoint/vtoolnormal.cpp | 3 +- .../toollinepoint/vtoolshoulderpoint.cpp | 4 +- .../toolsinglepoint/vtoolbasepoint.cpp | 2 +- .../toolsinglepoint/vtoollineintersect.cpp | 4 +- .../vtoolpointfromarcandtangent.cpp | 4 +- .../vtoolpointfromcircleandtangent.cpp | 4 +- .../toolsinglepoint/vtoolpointofcontact.cpp | 3 +- .../vtoolpointofintersectionarcs.cpp | 4 +- .../vtoolpointofintersectioncircles.cpp | 3 +- .../toolsinglepoint/vtoolsinglepoint.cpp | 2 +- .../toolsinglepoint/vtooltriangle.cpp | 3 +- src/libs/vtools/tools/drawTools/vtoolline.cpp | 4 +- .../vtools/tools/nodeDetails/vnodepoint.cpp | 2 +- src/libs/vtools/tools/vtoolseamallowance.cpp | 7 ++- src/libs/vtools/tools/vtooluniondetails.cpp | 58 ++++++++++--------- .../line/operation/visoperation.cpp | 4 +- .../line/operation/vistoolflippingbyaxis.cpp | 2 +- .../line/operation/vistoolflippingbyline.cpp | 4 +- .../line/operation/vistoolmove.cpp | 4 +- .../line/operation/vistoolrotation.cpp | 28 ++++----- .../visualization/line/vistoolalongline.cpp | 10 ++-- .../visualization/line/vistoolbisector.cpp | 30 ++++++---- .../line/vistoolcurveintersectaxis.cpp | 10 ++-- .../visualization/line/vistoolendline.cpp | 6 +- .../visualization/line/vistoolheight.cpp | 16 ++--- .../vtools/visualization/line/vistoolline.cpp | 4 +- .../line/vistoollineintersect.cpp | 24 ++++---- .../line/vistoollineintersectaxis.cpp | 16 ++--- .../visualization/line/vistoolnormal.cpp | 13 +++-- .../line/vistoolpointfromarcandtangent.cpp | 9 +-- .../line/vistoolpointfromcircleandtangent.cpp | 12 ++-- .../line/vistoolpointofcontact.cpp | 16 ++--- .../line/vistoolpointofintersection.cpp | 8 +-- .../vistoolpointofintersectioncircles.cpp | 13 +++-- .../line/vistoolshoulderpoint.cpp | 30 +++++----- .../visualization/line/vistooltriangle.cpp | 33 ++++++----- .../visualization/line/vistooltruedarts.cpp | 35 ++++++----- .../vtools/visualization/path/vistoolarc.cpp | 2 +- .../path/vistoolarcwithlength.cpp | 2 +- .../visualization/path/vistoolcubicbezier.cpp | 19 +++--- .../path/vistoolcubicbezierpath.cpp | 38 ++++++------ .../visualization/path/vistoolcutspline.cpp | 4 +- .../path/vistoolcutsplinepath.cpp | 2 +- .../path/vistoolellipticalarc.cpp | 2 +- .../visualization/path/vistoolspline.cpp | 20 ++++--- .../visualization/path/vistoolsplinepath.cpp | 16 ++--- src/libs/vwidgets/vsimplepoint.cpp | 2 +- src/test/ValentinaTest/tst_varc.cpp | 6 +- src/test/ValentinaTest/tst_vellipticalarc.cpp | 12 ++-- src/test/ValentinaTest/tst_vspline.cpp | 2 +- 85 files changed, 455 insertions(+), 384 deletions(-) diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 2f3d002e7..173989ec9 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -1524,7 +1524,8 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par Q_UNUSED(e) return;// Just ignore } - data->UpdateGObject(id, new VPointF(*point, point->name(), mx, my, idObject, Draw::Modeling)); + data->UpdateGObject(id, new VPointF(static_cast(*point), point->name(), mx, my, idObject, + Draw::Modeling)); VNodePoint::Create(this, data, sceneDetail, id, idObject, parse, Source::FromFile, "", idTool); } catch (const VExceptionBadId &e) diff --git a/src/libs/vgeometry/vabstractcubicbezier.cpp b/src/libs/vgeometry/vabstractcubicbezier.cpp index 7694e9cc1..aec041f42 100644 --- a/src/libs/vgeometry/vabstractcubicbezier.cpp +++ b/src/libs/vgeometry/vabstractcubicbezier.cpp @@ -101,7 +101,7 @@ QPointF VAbstractCubicBezier::CutSpline(qreal length, QPointF &spl1p2, QPointF & const qreal parT = GetParmT(length); - QLineF seg1_2 ( GetP1 (), GetControlPoint1 () ); + QLineF seg1_2 ( static_cast(GetP1 ()), GetControlPoint1 () ); seg1_2.setLength(seg1_2.length () * parT); const QPointF p12 = seg1_2.p2(); @@ -113,7 +113,7 @@ QPointF VAbstractCubicBezier::CutSpline(qreal length, QPointF &spl1p2, QPointF & seg12_23.setLength(seg12_23.length () * parT); const QPointF p123 = seg12_23.p2(); - QLineF seg3_4 ( GetControlPoint2 (), GetP4 () ); + QLineF seg3_4 ( GetControlPoint2 (), static_cast(GetP4 ()) ); seg3_4.setLength(seg3_4.length () * parT); const QPointF p34 = seg3_4.p2(); @@ -551,7 +551,7 @@ qreal VAbstractCubicBezier::LengthT(qreal t) const qDebug()<<"Wrong value t."; return 0; } - QLineF seg1_2 ( GetP1 (), GetControlPoint1 () ); + QLineF seg1_2 ( static_cast(GetP1 ()), GetControlPoint1 () ); seg1_2.setLength(seg1_2.length () * t); const QPointF p12 = seg1_2.p2(); @@ -563,7 +563,7 @@ qreal VAbstractCubicBezier::LengthT(qreal t) const seg12_23.setLength(seg12_23.length () * t); const QPointF p123 = seg12_23.p2(); - QLineF seg3_4 ( GetControlPoint2 (), GetP4 () ); + QLineF seg3_4 ( GetControlPoint2 (), static_cast(GetP4 ()) ); seg3_4.setLength(seg3_4.length () * t); const QPointF p34 = seg3_4.p2(); @@ -575,5 +575,5 @@ qreal VAbstractCubicBezier::LengthT(qreal t) const seg123_234.setLength(seg123_234.length () * t); const QPointF p1234 = seg123_234.p2(); - return LengthBezier ( GetP1(), p12, p123, p1234); + return LengthBezier ( static_cast(GetP1()), p12, p123, p1234); } diff --git a/src/libs/vgeometry/varc.cpp b/src/libs/vgeometry/varc.cpp index abfab0e62..0b9fe9c88 100644 --- a/src/libs/vgeometry/varc.cpp +++ b/src/libs/vgeometry/varc.cpp @@ -124,7 +124,8 @@ VArc VArc::Rotate(const QPointF &originPoint, qreal degrees, const QString &pref const QPointF p1 = VPointF::RotatePF(originPoint, GetP1(), degrees); const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), degrees); - VArc arc(center, GetRadius(), QLineF(center, p1).angle(), QLineF(center, p2).angle()); + VArc arc(center, GetRadius(), QLineF(static_cast(center), p1).angle(), + QLineF(static_cast(center), p2).angle()); arc.setName(name() + prefix); return arc; } @@ -137,7 +138,8 @@ VArc VArc::Flip(const QLineF &axis, const QString &prefix) const const QPointF p1 = VPointF::FlipPF(axis, GetP1()); const QPointF p2 = VPointF::FlipPF(axis, GetP2()); - VArc arc(center, GetRadius(), QLineF(center, p1).angle(), QLineF(center, p2).angle()); + VArc arc(center, GetRadius(), QLineF(static_cast(center), p1).angle(), + QLineF(static_cast(center), p2).angle()); arc.setName(name() + prefix); arc.SetFlipped(true); return arc; @@ -151,7 +153,8 @@ VArc VArc::Move(qreal length, qreal angle, const QString &prefix) const const QPointF p1 = VPointF::MovePF(GetP1(), length, angle); const QPointF p2 = VPointF::MovePF(GetP2(), length, angle); - VArc arc(center, GetRadius(), QLineF(center, p1).angle(), QLineF(center, p2).angle()); + VArc arc(center, GetRadius(), QLineF(static_cast(center), p1).angle(), + QLineF(static_cast(center), p2).angle()); arc.setName(name() + prefix); return arc; } @@ -184,7 +187,7 @@ qreal VArc::GetLength() const QPointF VArc::GetP1() const { QPointF p1 ( GetCenter().x () + d->radius, GetCenter().y () ); - QLineF centerP1(GetCenter(), p1); + QLineF centerP1(static_cast(GetCenter()), p1); centerP1.setAngle(GetStartAngle()); return centerP1.p2(); } @@ -197,7 +200,7 @@ QPointF VArc::GetP1() const QPointF VArc::GetP2 () const { QPointF p2 ( GetCenter().x () + d->radius, GetCenter().y () ); - QLineF centerP2(GetCenter(), p2); + QLineF centerP2(static_cast(GetCenter()), p2); centerP2.setAngle(GetEndAngle()); return centerP2.p2(); } @@ -249,7 +252,7 @@ QVector VArc::GetPoints() const { const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(qDegreesToRadians(sectionAngle.at(i)) * 0.25); - const QPointF center = GetCenter(); + const QPointF center = static_cast(GetCenter()); QLineF lineP1P2(pStart, center); lineP1P2.setAngle(lineP1P2.angle() - 90.0); @@ -318,7 +321,7 @@ QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const qreal n = qRadiansToDegrees(len/d->radius); // n - is angle in degrees - QLineF line(GetCenter(), GetP1()); + QLineF line(static_cast(GetCenter()), GetP1()); line.setAngle(line.angle()+n); arc1 = VArc (GetCenter(), d->radius, d->formulaRadius, GetStartAngle(), GetFormulaF1(), line.angle(), diff --git a/src/libs/vgeometry/vcubicbezier.cpp b/src/libs/vgeometry/vcubicbezier.cpp index fd40ff719..7aedc0e97 100644 --- a/src/libs/vgeometry/vcubicbezier.cpp +++ b/src/libs/vgeometry/vcubicbezier.cpp @@ -156,13 +156,13 @@ void VCubicBezier::SetP4(const VPointF &p) //--------------------------------------------------------------------------------------------------------------------- qreal VCubicBezier::GetStartAngle() const { - return QLineF(GetP1(), GetP2()).angle(); + return QLineF(static_cast(GetP1()), static_cast(GetP2())).angle(); } //--------------------------------------------------------------------------------------------------------------------- qreal VCubicBezier::GetEndAngle() const { - return QLineF(GetP4(), GetP3()).angle(); + return QLineF(static_cast(GetP4()), static_cast(GetP3())).angle(); } //--------------------------------------------------------------------------------------------------------------------- @@ -172,7 +172,8 @@ qreal VCubicBezier::GetEndAngle() const */ qreal VCubicBezier::GetLength() const { - return LengthBezier (GetP1(), GetP2(), GetP3(), GetP4()); + return LengthBezier (static_cast(GetP1()), static_cast(GetP2()), + static_cast(GetP3()), static_cast(GetP4())); } //--------------------------------------------------------------------------------------------------------------------- @@ -182,29 +183,30 @@ qreal VCubicBezier::GetLength() const */ QVector VCubicBezier::GetPoints() const { - return GetCubicBezierPoints(GetP1(), GetP2(), GetP3(), GetP4()); + return GetCubicBezierPoints(static_cast(GetP1()), static_cast(GetP2()), + static_cast(GetP3()), static_cast(GetP4())); } //--------------------------------------------------------------------------------------------------------------------- qreal VCubicBezier::GetC1Length() const { - return QLineF(GetP1(), GetP2()).length(); + return QLineF(static_cast(GetP1()), static_cast(GetP2())).length(); } //--------------------------------------------------------------------------------------------------------------------- qreal VCubicBezier::GetC2Length() const { - return QLineF(GetP4(), GetP3()).length(); + return QLineF(static_cast(GetP4()), static_cast(GetP3())).length(); } //--------------------------------------------------------------------------------------------------------------------- QPointF VCubicBezier::GetControlPoint1() const { - return GetP2(); + return static_cast(GetP2()); } //--------------------------------------------------------------------------------------------------------------------- QPointF VCubicBezier::GetControlPoint2() const { - return GetP3(); + return static_cast(GetP3()); } diff --git a/src/libs/vgeometry/vcubicbezierpath.cpp b/src/libs/vgeometry/vcubicbezierpath.cpp index a187a866f..fbe2b9970 100644 --- a/src/libs/vgeometry/vcubicbezierpath.cpp +++ b/src/libs/vgeometry/vcubicbezierpath.cpp @@ -137,7 +137,7 @@ const VPointF &VCubicBezierPath::at(int indx) const //--------------------------------------------------------------------------------------------------------------------- void VCubicBezierPath::append(const VPointF &point) { - if (d->path.size() > 0 && d->path.last() != point) + if (d->path.size() > 0 && static_cast(d->path.last()) != static_cast(point)) { return; } @@ -181,18 +181,18 @@ VSpline VCubicBezierPath::GetSpline(qint32 index) const const qint32 base = SubSplOffset(index); // Correction the first control point of each next spline curve except for the first. - QPointF p2 = d->path.at(base + 1); + QPointF p2 = static_cast(d->path.at(base + 1)); if (base + 1 > 1) { - const QPointF b = d->path.at(base); - QLineF foot1(b, d->path.at(base - 1)); + const QPointF b = static_cast(d->path.at(base)); + QLineF foot1(b, static_cast(d->path.at(base - 1))); QLineF foot2(b, p2); foot2.setAngle(foot1.angle() + 180); p2 = foot2.p2(); } - VSpline spl(d->path.at(base), p2, d->path.at(base + 2), d->path.at(base + 3)); + VSpline spl(d->path.at(base), p2, static_cast(d->path.at(base + 2)), d->path.at(base + 3)); return spl; } diff --git a/src/libs/vgeometry/vellipticalarc.cpp b/src/libs/vgeometry/vellipticalarc.cpp index ad8186dd9..264ac2b51 100644 --- a/src/libs/vgeometry/vellipticalarc.cpp +++ b/src/libs/vgeometry/vellipticalarc.cpp @@ -129,8 +129,8 @@ VEllipticalArc VEllipticalArc::Rotate(const QPointF &originPoint, qreal degrees, const VPointF center = GetCenter().Rotate(originPoint, degrees); const QPointF p1 = VPointF::RotatePF(originPoint, GetP1(), degrees); const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), degrees); - const qreal f1 = QLineF(center, p1).angle() - GetRotationAngle(); - const qreal f2 = QLineF(center, p2).angle() - GetRotationAngle(); + const qreal f1 = QLineF(static_cast(center), p1).angle() - GetRotationAngle(); + const qreal f2 = QLineF(static_cast(center), p2).angle() - GetRotationAngle(); VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle()); elArc.setName(name() + prefix); return elArc; @@ -142,8 +142,8 @@ VEllipticalArc VEllipticalArc::Flip(const QLineF &axis, const QString &prefix) c const VPointF center = GetCenter().Flip(axis); const QPointF p1 = VPointF::FlipPF(axis, GetP1()); const QPointF p2 = VPointF::FlipPF(axis, GetP2()); - const qreal f1 = QLineF(center, p1).angle() - GetRotationAngle(); - const qreal f2 = QLineF(center, p2).angle() - GetRotationAngle(); + const qreal f1 = QLineF(static_cast(center), p1).angle() - GetRotationAngle(); + const qreal f2 = QLineF(static_cast(center), p2).angle() - GetRotationAngle(); VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle()); elArc.setName(name() + prefix); elArc.SetFlipped(true); @@ -156,8 +156,8 @@ VEllipticalArc VEllipticalArc::Move(qreal length, qreal angle, const QString &pr const VPointF center = GetCenter().Move(length, angle); const QPointF p1 = VPointF::MovePF(GetP1(), length, angle); const QPointF p2 = VPointF::MovePF(GetP2(), length, angle); - const qreal f1 = QLineF(center, p1).angle() - GetRotationAngle(); - const qreal f2 = QLineF(center, p2).angle() - GetRotationAngle(); + const qreal f1 = QLineF(static_cast(center), p1).angle() - GetRotationAngle(); + const qreal f2 = QLineF(static_cast(center), p2).angle() - GetRotationAngle(); VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle()); elArc.setName(name() + prefix); return elArc; @@ -280,7 +280,7 @@ QPointF VEllipticalArc::GetPoint (qreal angle) const QPointF p (GetCenter().x() + x, GetCenter().y() + y); // rotation of point - QLineF line(GetCenter(), p); + QLineF line(static_cast(GetCenter()), p); line.setAngle(line.angle() + GetRotationAngle()); return line.p2(); diff --git a/src/libs/vgeometry/vpointf.h b/src/libs/vgeometry/vpointf.h index 321e7fc61..461ea1187 100644 --- a/src/libs/vgeometry/vpointf.h +++ b/src/libs/vgeometry/vpointf.h @@ -53,15 +53,14 @@ class VPointF:public VGObject public: VPointF (); VPointF (const VPointF &point ); - // cppcheck-suppress noExplicitConstructor - VPointF (const QPointF &point ); + explicit VPointF (const QPointF &point ); VPointF (qreal x, qreal y, const QString &name, qreal mx, qreal my, quint32 idObject = 0, const Draw &mode = Draw::Calculation); VPointF (const QPointF &point, const QString &name, qreal mx, qreal my, quint32 idObject = 0, const Draw &mode = Draw::Calculation); virtual ~VPointF() Q_DECL_OVERRIDE; VPointF &operator=(const VPointF &point); - operator QPointF() const; + explicit operator QPointF() const; VPointF Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const; VPointF Flip(const QLineF &axis, const QString &prefix = QString()) const; VPointF Move(qreal length, qreal angle, const QString &prefix = QString()) const; diff --git a/src/libs/vgeometry/vspline.cpp b/src/libs/vgeometry/vspline.cpp index 4deeb5be3..4660d59cd 100644 --- a/src/libs/vgeometry/vspline.cpp +++ b/src/libs/vgeometry/vspline.cpp @@ -116,8 +116,8 @@ VSpline VSpline::Rotate(const QPointF &originPoint, qreal degrees, const QString const VPointF p1 = GetP1().Rotate(originPoint, degrees); const VPointF p4 = GetP4().Rotate(originPoint, degrees); - const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), degrees); - const QPointF p3 = VPointF::RotatePF(originPoint, GetP3(), degrees); + const QPointF p2 = VPointF::RotatePF(originPoint, static_cast(GetP2()), degrees); + const QPointF p3 = VPointF::RotatePF(originPoint, static_cast(GetP3()), degrees); VSpline spl(p1, p2, p3, p4); spl.setName(name() + prefix); @@ -130,8 +130,8 @@ VSpline VSpline::Flip(const QLineF &axis, const QString &prefix) const const VPointF p1 = GetP1().Flip(axis); const VPointF p4 = GetP4().Flip(axis); - const QPointF p2 = VPointF::FlipPF(axis, GetP2()); - const QPointF p3 = VPointF::FlipPF(axis, GetP3()); + const QPointF p2 = VPointF::FlipPF(axis, static_cast(GetP2())); + const QPointF p3 = VPointF::FlipPF(axis, static_cast(GetP3())); VSpline spl(p1, p2, p3, p4); spl.setName(name() + prefix); @@ -144,8 +144,8 @@ VSpline VSpline::Move(qreal length, qreal angle, const QString &prefix) const const VPointF p1 = GetP1().Move(length, angle); const VPointF p4 = GetP4().Move(length, angle); - const QPointF p2 = VPointF::MovePF(GetP2(), length, angle); - const QPointF p3 = VPointF::MovePF(GetP3(), length, angle); + const QPointF p2 = VPointF::MovePF(static_cast(GetP2()), length, angle); + const QPointF p3 = VPointF::MovePF(static_cast(GetP3()), length, angle); VSpline spl(p1, p2, p3, p4); spl.setName(name() + prefix); @@ -163,7 +163,8 @@ VSpline::~VSpline() */ qreal VSpline::GetLength () const { - return LengthBezier ( GetP1(), GetP2(), GetP3(), GetP4()); + return LengthBezier ( static_cast(GetP1()), static_cast(GetP2()), static_cast(GetP3()), + static_cast(GetP4())); } //--------------------------------------------------------------------------------------------------------------------- @@ -175,8 +176,8 @@ QPointF VSpline::CutSpline(qreal length, VSpline &spl1, VSpline &spl2) const QPointF spl2p3; const QPointF cutPoint = CutSpline (length, spl1p2, spl1p3, spl2p2, spl2p3 ); - spl1 = VSpline(GetP1(), spl1p2, spl1p3, cutPoint); - spl2 = VSpline(cutPoint, spl2p2, spl2p3, GetP4()); + spl1 = VSpline(GetP1(), spl1p2, spl1p3, VPointF(cutPoint)); + spl2 = VSpline(VPointF(cutPoint), spl2p2, spl2p3, GetP4()); return cutPoint; } @@ -187,7 +188,8 @@ QPointF VSpline::CutSpline(qreal length, VSpline &spl1, VSpline &spl2) const */ QVector VSpline::GetPoints () const { - return GetCubicBezierPoints(GetP1(), GetP2(), GetP3(), GetP4()); + return GetCubicBezierPoints(static_cast(GetP1()), static_cast(GetP2()), + static_cast(GetP3()), static_cast(GetP4())); } //--------------------------------------------------------------------------------------------------------------------- @@ -379,8 +381,8 @@ void VSpline::SetC2Length(qreal length, const QString &formula) */ qreal VSpline::GetKasm1() const { - return QLineF(d->p1, GetP2()).length() / VSplineData::GetL(d->p1, d->p4, - d->kCurve); + return QLineF(static_cast(d->p1), static_cast(GetP2())).length() / + VSplineData::GetL(static_cast(d->p1), static_cast(d->p4), d->kCurve); } //--------------------------------------------------------------------------------------------------------------------- @@ -390,8 +392,8 @@ qreal VSpline::GetKasm1() const */ qreal VSpline::GetKasm2() const { - return QLineF(d->p4, GetP3()).length() / VSplineData::GetL(d->p1, d->p4, - d->kCurve); + return QLineF(static_cast(d->p4), static_cast(GetP3())).length() / + VSplineData::GetL(static_cast(d->p1), static_cast(d->p4), d->kCurve); } //--------------------------------------------------------------------------------------------------------------------- @@ -516,10 +518,10 @@ qreal VSpline::ParamT (const QPointF &pBt) const for (int i=0; i< ts.size(); ++i) { const qreal t = ts.at(i); - const QPointF p0 = GetP1(); - const QPointF p1 = GetP2(); - const QPointF p2 = GetP3(); - const QPointF p3 = GetP4(); + const QPointF p0 = static_cast(GetP1()); + const QPointF p1 = static_cast(GetP2()); + const QPointF p2 = static_cast(GetP3()); + const QPointF p3 = static_cast(GetP4()); //The explicit form of the Cubic Bézier curve const qreal pointX = pow(1-t, 3)*p0.x() + 3*pow(1-t, 2)*t*p1.x() + 3*(1-t)*pow(t, 2)*p2.x() + pow(t, 3)*p3.x(); const qreal pointY = pow(1-t, 3)*p0.y() + 3*pow(1-t, 2)*t*p1.y() + 3*(1-t)*pow(t, 2)*p2.y() + pow(t, 3)*p3.y(); @@ -538,11 +540,11 @@ qreal VSpline::ParamT (const QPointF &pBt) const //--------------------------------------------------------------------------------------------------------------------- QPointF VSpline::GetControlPoint1() const { - return GetP2 (); + return static_cast(GetP2 ()); } //--------------------------------------------------------------------------------------------------------------------- QPointF VSpline::GetControlPoint2() const { - return GetP3 (); + return static_cast(GetP3 ()); } diff --git a/src/libs/vgeometry/vspline_p.h b/src/libs/vgeometry/vspline_p.h index 8ff0535d4..b591709a3 100644 --- a/src/libs/vgeometry/vspline_p.h +++ b/src/libs/vgeometry/vspline_p.h @@ -134,7 +134,7 @@ VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qre c2LengthF("0"), kCurve(kCurve) { - const qreal L = GetL(p1, p4, kCurve); + const qreal L = GetL(static_cast(p1), static_cast(p4), kCurve); QLineF p1p2(p1.x(), p1.y(), p1.x() + L * kAsm1, p1.y()); p1p2.setAngle(angle1); @@ -161,7 +161,7 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4) c2LengthF("0"), kCurve(1) { - QLineF p1p2(p1, p2); + QLineF p1p2(static_cast(p1), static_cast(p2)); angle1 = p1p2.angle(); angle1F = QString().number(angle1); @@ -169,7 +169,7 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4) c1Length = p1p2.length(); c1LengthF = QString().number(qApp->fromPixel(c1Length)); - QLineF p4p3(p4, p3); + QLineF p4p3(static_cast(p4), static_cast(p3)); angle2 = p4p3.angle(); angle2F = QString().number(angle2); diff --git a/src/libs/vgeometry/vsplinepath.cpp b/src/libs/vgeometry/vsplinepath.cpp index 7dcaf404c..e4f1ece22 100644 --- a/src/libs/vgeometry/vsplinepath.cpp +++ b/src/libs/vgeometry/vsplinepath.cpp @@ -177,7 +177,7 @@ VSplinePath::~VSplinePath() */ void VSplinePath::append(const VSplinePoint &point) { - if (d->path.size() > 0 && d->path.last().P() == point.P()) //-V807 + if (d->path.size() > 0 && static_cast(d->path.last().P()) == static_cast(point.P())) //-V807 { return; } diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 8e786e279..cd7c99bc9 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -101,7 +101,8 @@ bool FindLabelGeometry(const VPatternLabelData &labelData, const VContainer *pat const auto topLeftPinPoint = pattern->GeometricObject(topLeftPin); const auto bottomRightPinPoint = pattern->GeometricObject(bottomRightPin); - const QRectF labelRect = QRectF(*topLeftPinPoint, *bottomRightPinPoint); + const QRectF labelRect = QRectF(static_cast(*topLeftPinPoint), + static_cast(*bottomRightPinPoint)); labelWidth = qAbs(labelRect.width()); labelHeight = qAbs(labelRect.height()); @@ -139,7 +140,7 @@ bool FindLabelGeometry(const VPatternLabelData &labelData, const VContainer *pat const qreal lWidth = ToPixel(labelWidth, *pattern->GetPatternUnit()); const qreal lHeight = ToPixel(labelHeight, *pattern->GetPatternUnit()); - pos = *centerPinPoint - QRectF(0, 0, lWidth, lHeight).center(); + pos = static_cast(*centerPinPoint) - QRectF(0, 0, lWidth, lHeight).center(); } catch(const VExceptionBadId &) { @@ -170,7 +171,7 @@ bool FindGrainlineGeometry(const VGrainlineData& geom, const VContainer *pattern const auto topPinPoint = pattern->GeometricObject(topPin); const auto bottomPinPoint = pattern->GeometricObject(bottomPin); - QLineF grainline(*bottomPinPoint, *topPinPoint); + QLineF grainline(static_cast(*bottomPinPoint), static_cast(*topPinPoint)); length = grainline.length(); rotationAngle = grainline.angle(); diff --git a/src/libs/vmisc/backport/qmarginsf.h b/src/libs/vmisc/backport/qmarginsf.h index 139b02c74..6ecfb5fd3 100644 --- a/src/libs/vmisc/backport/qmarginsf.h +++ b/src/libs/vmisc/backport/qmarginsf.h @@ -50,7 +50,7 @@ class QMarginsF public: Q_DECL_CONSTEXPR QMarginsF() Q_DECL_NOTHROW; Q_DECL_CONSTEXPR QMarginsF(qreal left, qreal top, qreal right, qreal bottom) Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR QMarginsF(const QMargins &margins) Q_DECL_NOTHROW; + Q_DECL_CONSTEXPR explicit QMarginsF(const QMargins &margins) Q_DECL_NOTHROW; Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW; diff --git a/src/libs/vpatterndb/variables/vlineangle.cpp b/src/libs/vpatterndb/variables/vlineangle.cpp index bbb7f1e26..f2ea17b9d 100644 --- a/src/libs/vpatterndb/variables/vlineangle.cpp +++ b/src/libs/vpatterndb/variables/vlineangle.cpp @@ -93,7 +93,8 @@ void VLineAngle::SetValue(const VPointF *p1, const VPointF *p2) SCASSERT(p1 != nullptr) SCASSERT(p2 != nullptr) //Correct angle. Try avoid results like 6,7563e-15. - const qreal angle = qFloor(QLineF(*p1, *p2).angle() * 100000.) / 100000.; + const qreal angle = qFloor(QLineF(static_cast(*p1), + static_cast(*p2)).angle() * 100000.) / 100000.; VInternalVariable::SetValue(angle); } diff --git a/src/libs/vpatterndb/variables/vlinelength.cpp b/src/libs/vpatterndb/variables/vlinelength.cpp index 8fe836157..fb5c3591d 100644 --- a/src/libs/vpatterndb/variables/vlinelength.cpp +++ b/src/libs/vpatterndb/variables/vlinelength.cpp @@ -91,7 +91,8 @@ void VLengthLine::SetValue(const VPointF *p1, const VPointF *p2) SCASSERT(p1 != nullptr) SCASSERT(p2 != nullptr) - VInternalVariable::SetValue(FromPixel(QLineF(*p1, *p2).length(), d->patternUnit)); + VInternalVariable::SetValue(FromPixel(QLineF(static_cast(*p1), static_cast(*p2)).length(), + d->patternUnit)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/vpiecepath.cpp b/src/libs/vpatterndb/vpiecepath.cpp index 8010af7bc..714bb87ee 100644 --- a/src/libs/vpatterndb/vpiecepath.cpp +++ b/src/libs/vpatterndb/vpiecepath.cpp @@ -42,7 +42,7 @@ VSAPoint CurvePoint(VSAPoint candidate, const VContainer *data, const VPieceNode { if (node.GetTypeTool() == Tool::NodePoint) { - const QPointF p = *data->GeometricObject(node.GetId()); + const QPointF p = static_cast(*data->GeometricObject(node.GetId())); if (VAbstractCurve::IsPointOnCurve(curvePoints, p)) { candidate = VSAPoint(p); @@ -253,7 +253,7 @@ QVector VPiecePath::PathPoints(const VContainer *data) const case (Tool::NodePoint): { const QSharedPointer point = data->GeometricObject(at(i).GetId()); - points.append(*point); + points.append(static_cast(*point)); } break; case (Tool::NodeArc): @@ -681,7 +681,7 @@ QPointF VPiecePath::NodePreviousPoint(const VContainer *data, int i) const switch (node.GetTypeTool()) { case (Tool::NodePoint): - return *data->GeometricObject(node.GetId()); + return static_cast(*data->GeometricObject(node.GetId())); case (Tool::NodeArc): case (Tool::NodeElArc): case (Tool::NodeSpline): @@ -733,7 +733,7 @@ QPointF VPiecePath::NodeNextPoint(const VContainer *data, int i) const switch (node.GetTypeTool()) { case (Tool::NodePoint): - return *data->GeometricObject(node.GetId()); + return static_cast(*data->GeometricObject(node.GetId())); case (Tool::NodeArc): case (Tool::NodeElArc): case (Tool::NodeSpline): diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index ec7f52124..d1143aef7 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -206,7 +206,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click) VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetBasePointId()); - QLineF line = QLineF(*point, scene->getScenePos()); + QLineF line = QLineF(static_cast(*point), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index 6e21c23da..48da2c57f 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -315,7 +315,7 @@ void DialogEndLine::ShowDialog(bool click) VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetBasePointId()); - QLineF line = QLineF(*point, scene->getScenePos()); + QLineF line = QLineF(static_cast(*point), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. const qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; diff --git a/src/libs/vtools/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp index 23316fa33..94c0c7823 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.cpp +++ b/src/libs/vtools/dialogs/tools/dialogheight.cpp @@ -259,12 +259,12 @@ void DialogHeight::PointNameChanged() set.insert(p1LineId); set.insert(p2LineId); - const QSharedPointer basePoint = data->GeometricObject(basePointId); - const QSharedPointer p1Line = data->GeometricObject(p1LineId); - const QSharedPointer p2Line = data->GeometricObject(p2LineId); + const QPointF basePoint = static_cast(*data->GeometricObject(basePointId)); + const QPointF p1Line = static_cast(*data->GeometricObject(p1LineId)); + const QPointF p2Line = static_cast(*data->GeometricObject(p2LineId)); QColor color = okColor; - if (set.size() != 3 || VGObject::ClosestPoint(QLineF(*p1Line, *p2Line), *basePoint) == QPointF()) + if (set.size() != 3 || VGObject::ClosestPoint(QLineF(p1Line, p2Line), basePoint) == QPointF()) { flagError = false; color = errorColor; diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp index 80171a6fa..e74b2c60f 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersect.cpp @@ -230,8 +230,8 @@ void DialogLineIntersect::PointNameChanged() const QSharedPointer p1Line2 = data->GeometricObject(p1Line2Id); const QSharedPointer p2Line2 = data->GeometricObject(p2Line2Id); - QLineF line1(*p1Line1, *p2Line1); - QLineF line2(*p1Line2, *p2Line2); + QLineF line1(static_cast(*p1Line1), static_cast(*p2Line1)); + QLineF line2(static_cast(*p1Line2), static_cast(*p2Line2)); QPointF fPoint; QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); @@ -281,8 +281,8 @@ bool DialogLineIntersect::CheckIntersecion() const QSharedPointer p1L2 = data->GeometricObject(GetP1Line2()); const QSharedPointer p2L2 = data->GeometricObject(GetP2Line2()); - QLineF line1(*p1L1, *p2L1); - QLineF line2(*p1L2, *p2L2); + QLineF line1(static_cast(*p1L1), static_cast(*p2L1)); + QLineF line2(static_cast(*p1L2), static_cast(*p2L2)); QPointF fPoint; QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp index 4b870a558..467b27768 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp @@ -235,7 +235,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click) VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetBasePointId()); - QLineF line = QLineF(*point, scene->getScenePos()); + QLineF line = QLineF(static_cast(*point), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index 06f418a8b..075b8f2a7 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -213,7 +213,7 @@ void DialogRotation::ShowDialog(bool click) VMainGraphicsScene *scene = qobject_cast(qApp->getCurrentScene()); SCASSERT(scene != nullptr) const QSharedPointer point = data->GeometricObject(GetOrigPointId()); - const QLineF line = QLineF(*point, scene->getScenePos()); + const QLineF line = QLineF(static_cast(*point), scene->getScenePos()); //Radius of point circle, but little bigger. Need handle with hover sizes. const qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5; diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index 03a8f4c98..7fe41df49 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -110,7 +110,7 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(const quint32 _id, quint32 orig const Source &typeCreation) { const auto originPoint = *data->GeometricObject(originPointId); - const QPointF fPoint = originPoint; + const QPointF fPoint = static_cast(originPoint); QPointF sPoint; if (axisType == AxisType::VerticalAxis) diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index ec768fe27..127832567 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -111,10 +111,10 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const quint32 _id, quint32 firs const Source &typeCreation) { const auto firstPoint = *data->GeometricObject(firstLinePointId); - const QPointF fPoint = firstPoint; + const QPointF fPoint = static_cast(firstPoint); const auto secondPoint = *data->GeometricObject(secondLinePointId); - const QPointF sPoint = secondPoint; + const QPointF sPoint = static_cast(secondPoint); QVector dest = destination; diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 79582ead6..7a54b5ea8 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -139,7 +139,7 @@ VToolRotation *VToolRotation::Create(const quint32 _id, const quint32 &origin, Q calcAngle = CheckFormula(_id, angle, data); const auto originPoint = *data->GeometricObject(origin); - const QPointF oPoint = originPoint; + const QPointF oPoint = static_cast(originPoint); QVector dest = destination; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp index 0c9dcc0a0..835e8cb18 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp @@ -282,7 +282,7 @@ VSpline VAbstractSpline::CorrectedSpline(const VSpline &spline, const SplinePoin VSpline spl; if (position == SplinePointPosition::FirstPoint) { - QLineF line(spline.GetP1(), pos); + QLineF line(static_cast(spline.GetP1()), pos); if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) { line.setAngle(VisLine::CorrectAngle(line.angle())); @@ -312,7 +312,7 @@ VSpline VAbstractSpline::CorrectedSpline(const VSpline &spline, const SplinePoin } else { - QLineF line(spline.GetP4(), pos); + QLineF line(static_cast(spline.GetP4()), pos); if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) { line.setAngle(VisLine::CorrectAngle(line.angle())); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index 6d3b5063c..b1c41d72c 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -97,9 +97,10 @@ VToolSpline::VToolSpline(VAbstractPattern *doc, VContainer *data, quint32 id, co const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl->GetStartAngleFormula()); const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl->GetC1LengthFormula()); - auto *controlPoint1 = new VControlPointSpline(1, SplinePointPosition::FirstPoint, spl->GetP2(), - spl->GetP1(), *data->GetPatternUnit(), freeAngle1, - freeLength1, this); + auto *controlPoint1 = new VControlPointSpline(1, SplinePointPosition::FirstPoint, + static_cast(spl->GetP2()), + static_cast(spl->GetP1()), *data->GetPatternUnit(), + freeAngle1, freeLength1, this); connect(controlPoint1, &VControlPointSpline::ControlPointChangePosition, this, &VToolSpline::ControlPointChangePosition); connect(this, &VToolSpline::setEnabledPoint, controlPoint1, &VControlPointSpline::setEnabledPoint); @@ -109,9 +110,10 @@ VToolSpline::VToolSpline(VAbstractPattern *doc, VContainer *data, quint32 id, co const bool freeAngle2 = qmu::QmuTokenParser::IsSingle(spl->GetEndAngleFormula()); const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl->GetC2LengthFormula()); - auto *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, spl->GetP3(), - spl->GetP4(), *data->GetPatternUnit(), freeAngle2, - freeLength2, this); + auto *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, + static_cast(spl->GetP3()), + static_cast(spl->GetP4()), *data->GetPatternUnit(), + freeAngle2, freeLength2, this); connect(controlPoint2, &VControlPointSpline::ControlPointChangePosition, this, &VToolSpline::ControlPointChangePosition); connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint); @@ -332,8 +334,8 @@ void VToolSpline::SaveDialog(QDomElement &domElement) controlPoints[0]->blockSignals(true); controlPoints[1]->blockSignals(true); - controlPoints[0]->setPos(spl.GetP2()); - controlPoints[1]->setPos(spl.GetP3()); + controlPoints[0]->setPos(static_cast(spl.GetP2())); + controlPoints[1]->setPos(static_cast(spl.GetP3())); controlPoints[0]->blockSignals(false); controlPoints[1]->blockSignals(false); @@ -430,8 +432,8 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) const QPointF offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta; - const QPointF p2 = spline->GetP2() + offset0; - const QPointF p3 = spline->GetP3() + offset1; + const QPointF p2 = static_cast(spline->GetP2()) + offset0; + const QPointF p3 = static_cast(spline->GetP3()) + offset1; oldPosition = event->scenePos(); // Now mouse here @@ -557,18 +559,20 @@ void VToolSpline::RefreshGeometry() const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl->GetStartAngleFormula()); const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl->GetC1LengthFormula()); - const QPointF splinePoint = *VAbstractTool::data.GeometricObject(spl->GetP1().id()); - controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, spl->GetP2(), splinePoint, freeAngle1, - freeLength1); + const QPointF splinePoint = + static_cast(*VAbstractTool::data.GeometricObject(spl->GetP1().id())); + controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, static_cast(spl->GetP2()), + static_cast(splinePoint), freeAngle1, freeLength1); } { const bool freeAngle2 = qmu::QmuTokenParser::IsSingle(spl->GetEndAngleFormula()); const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl->GetC2LengthFormula()); - const QPointF splinePoint = *VAbstractTool::data.GeometricObject(spl->GetP4().id()); - controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, spl->GetP3(), splinePoint, freeAngle2, - freeLength2); + const QPointF splinePoint = + static_cast(*VAbstractTool::data.GeometricObject(spl->GetP4().id())); + controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, static_cast(spl->GetP3()), + static_cast(splinePoint), freeAngle2, freeLength2); } controlPoints[0]->blockSignals(false); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index cc5970b69..f50aedce2 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -107,9 +107,10 @@ VToolSplinePath::VToolSplinePath(VAbstractPattern *doc, VContainer *data, quint3 const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl.GetStartAngleFormula()); const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl.GetC1LengthFormula()); - auto *controlPoint = new VControlPointSpline(i, SplinePointPosition::FirstPoint, spl.GetP2(), - spl.GetP1(), *data->GetPatternUnit(), freeAngle1, - freeLength1, this); + auto *controlPoint = new VControlPointSpline(i, SplinePointPosition::FirstPoint, + static_cast(spl.GetP2()), + static_cast(spl.GetP1()), *data->GetPatternUnit(), + freeAngle1, freeLength1, this); connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this, &VToolSplinePath::ControlPointChangePosition); connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint); @@ -119,8 +120,9 @@ VToolSplinePath::VToolSplinePath(VAbstractPattern *doc, VContainer *data, quint3 const bool freeAngle2 = qmu::QmuTokenParser::IsSingle(spl.GetEndAngleFormula()); const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl.GetC2LengthFormula()); - controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, spl.GetP3(), spl.GetP4(), - *data->GetPatternUnit(), freeAngle2, freeLength2, this); + controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, static_cast(spl.GetP3()), + static_cast(spl.GetP4()), *data->GetPatternUnit(), freeAngle2, + freeLength2, this); connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this, &VToolSplinePath::ControlPointChangePosition); connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint); @@ -451,8 +453,8 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement) controlPoints[j-2]->blockSignals(true); controlPoints[j-1]->blockSignals(true); - controlPoints[j-2]->setPos(spl.GetP2()); - controlPoints[j-1]->setPos(spl.GetP3()); + controlPoints[j-2]->setPos(static_cast(spl.GetP2())); + controlPoints[j-1]->setPos(static_cast(spl.GetP3())); controlPoints[j-2]->blockSignals(false); controlPoints[j-1]->blockSignals(false); @@ -554,8 +556,8 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event) const QPointF offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta; const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta; - const QPointF p2 = spline.GetP2() + offset0; - const QPointF p3 = spline.GetP3() + offset1; + const QPointF p2 = static_cast(spline.GetP2()) + offset0; + const QPointF p3 = static_cast(spline.GetP3()) + offset1; oldPosition = event->scenePos(); // Now mouse here @@ -691,8 +693,8 @@ void VToolSplinePath::RefreshGeometry() const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl.GetC1LengthFormula()); const auto splinePoint = spl.GetP1(); - controlPoints[j-2]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, spl.GetP2(), splinePoint, - freeAngle1, freeLength1); + controlPoints[j-2]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, static_cast(spl.GetP2()), + static_cast(splinePoint), freeAngle1, freeLength1); } { @@ -700,8 +702,8 @@ void VToolSplinePath::RefreshGeometry() const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl.GetC2LengthFormula()); const auto splinePoint = spl.GetP4(); - controlPoints[j-1]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, spl.GetP3(), splinePoint, - freeAngle2, freeLength2); + controlPoints[j-1]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, static_cast(spl.GetP3()), + static_cast(splinePoint), freeAngle2, freeLength2); } controlPoints[j-2]->blockSignals(false); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index 17af7ee53..d9005ad5c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -167,7 +167,9 @@ VToolTrueDarts *VToolTrueDarts::Create(quint32 _id, QPointF fPoint1; QPointF fPoint2; - VToolTrueDarts::FindPoint(*baseLineP1, *baseLineP2, *dartP1, *dartP2, *dartP3, fPoint1, fPoint2); + VToolTrueDarts::FindPoint(static_cast(*baseLineP1), static_cast(*baseLineP2), + static_cast(*dartP1), static_cast(*dartP2), + static_cast(*dartP3), fPoint1, fPoint2); quint32 id = _id; quint32 p1id = _p1id; quint32 p2id = _p2id; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index 75c244911..a1aaa75e9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -270,7 +270,7 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa { const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); - QLineF line = QLineF(*firstPoint, *secondPoint); + QLineF line = QLineF(static_cast(*firstPoint), static_cast(*secondPoint)); //Declare special variable "CurrentLength" VLengthLine *length = new VLengthLine(firstPoint.data(), firstPointId, secondPoint.data(), diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp index 066e04f23..d29bbd87b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -195,7 +195,8 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const const qreal result = CheckFormula(_id, formula, data); - QPointF fPoint = VToolBisector::FindPoint(*firstPoint, *secondPoint, *thirdPoint, qApp->toPixel(result)); + QPointF fPoint = VToolBisector::FindPoint(static_cast(*firstPoint), static_cast(*secondPoint), + static_cast(*thirdPoint), qApp->toPixel(result)); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index a8c21594d..d6248f9f6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -139,7 +139,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons const qreal angle = CheckFormula(_id, formulaAngle, data); const QSharedPointer curve = data->GeometricObject(curveId); - const QPointF fPoint = FindPoint(*basePoint, angle, curve); + const QPointF fPoint = FindPoint(static_cast(*basePoint), angle, curve); const qreal segLength = curve->GetLengthByPoint(fPoint); quint32 id = _id; VPointF *p = new VPointF(fPoint, pointName, mx, my); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp index 506b5b4d4..8ab7f3e0b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp @@ -159,7 +159,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); - QLineF line = QLineF(*basePoint, QPointF(basePoint->x()+100, basePoint->y())); + QLineF line = QLineF(static_cast(*basePoint), QPointF(basePoint->x()+100, basePoint->y())); line.setAngle(CheckFormula(_id, formulaAngle, data)); //First set angle. line.setLength(qApp->toPixel(CheckFormula(_id, formulaLength, data))); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp index 816718408..6b98bea96 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -150,7 +150,8 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co const QSharedPointer p1Line = data->GeometricObject(p1LineId); const QSharedPointer p2Line = data->GeometricObject(p2LineId); - QPointF pHeight = FindPoint(QLineF(*p1Line, *p2Line), *basePoint); + QPointF pHeight = FindPoint(QLineF(static_cast(*p1Line), static_cast(*p2Line)), + static_cast(*basePoint)); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index 116968089..80784ded4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -124,12 +124,12 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const const Source &typeCreation) { const QSharedPointer basePoint = data->GeometricObject(basePointId); - QLineF axis = QLineF(*basePoint, QPointF(basePoint->x()+100, basePoint->y())); + QLineF axis = QLineF(static_cast(*basePoint), QPointF(basePoint->x()+100, basePoint->y())); axis.setAngle(CheckFormula(_id, formulaAngle, data)); const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); - QLineF line(*firstPoint, *secondPoint); + QLineF line(static_cast(*firstPoint), static_cast(*secondPoint)); QPointF fPoint = FindPoint(axis, line); quint32 id = _id; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp index d974dfc82..6c9af4ef7 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp @@ -72,8 +72,8 @@ VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const qu { this->typeLine = typeLine; Q_ASSERT_X(basePointId != 0, Q_FUNC_INFO, "basePointId == 0"); //-V654 //-V712 - QPointF point1 = *data->GeometricObject(basePointId); - QPointF point2 = *data->GeometricObject(id); + QPointF point1 = static_cast(*data->GeometricObject(basePointId)); + QPointF point2 = static_cast(*data->GeometricObject(id)); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); mainLine->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, @@ -97,8 +97,8 @@ void VToolLinePoint::RefreshGeometry() qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor, LineStyleToPenStyle(typeLine))); VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(id)); - QPointF point = *VDrawTool::data.GeometricObject(id); - QPointF basePoint = *VDrawTool::data.GeometricObject(basePointId); + QPointF point = static_cast(*VDrawTool::data.GeometricObject(id)); + QPointF basePoint = static_cast(*VDrawTool::data.GeometricObject(basePointId)); mainLine->setLine(QLineF(basePoint - point, QPointF())); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index d21c5aa20..ee7b83de1 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -158,7 +158,8 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin const qreal result = CheckFormula(_id, formula, data); - QPointF fPoint = VToolNormal::FindPoint(*firstPoint, *secondPoint, qApp->toPixel(result), angle); + QPointF fPoint = VToolNormal::FindPoint(static_cast(*firstPoint), static_cast(*secondPoint), + qApp->toPixel(result), angle); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp index 2203e4a64..5d7a17377 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -206,7 +206,9 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu const qreal result = CheckFormula(_id, formula, data); - QPointF fPoint = VToolShoulderPoint::FindPoint(*firstPoint, *secondPoint, *shoulderPoint, qApp->toPixel(result)); + QPointF fPoint = VToolShoulderPoint::FindPoint(static_cast(*firstPoint), + static_cast(*secondPoint), + static_cast(*shoulderPoint), qApp->toPixel(result)); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index e8564722f..c82fc100c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -108,7 +108,7 @@ void VToolBasePoint::setDialog() DialogSinglePoint *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr) const QSharedPointer p = VAbstractTool::data.GeometricObject(id); - dialogTool->SetData(p->name(), *p); + dialogTool->SetData(p->name(), static_cast(*p)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index b4fdcfd2b..6d47ebadc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -153,8 +153,8 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 const QSharedPointer p1Line2 = data->GeometricObject(p1Line2Id); const QSharedPointer p2Line2 = data->GeometricObject(p2Line2Id); - QLineF line1(*p1Line1, *p2Line1); - QLineF line2(*p1Line2, *p2Line2); + QLineF line1(static_cast(*p1Line1), static_cast(*p2Line1)); + QLineF line2(static_cast(*p1Line2), static_cast(*p2Line2)); QPointF fPoint; QLineF::IntersectType intersect = line1.intersect(line2, &fPoint); if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index edf32f773..8f530f62c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -108,7 +108,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const quint32 _ const VArc arc = *data->GeometricObject(arcId); const VPointF tPoint = *data->GeometricObject(tangentPointId); - const QPointF point = VToolPointFromArcAndTangent::FindPoint(tPoint, &arc, crossPoint); + const QPointF point = VToolPointFromArcAndTangent::FindPoint(static_cast(tPoint), &arc, crossPoint); quint32 id = _id; if (typeCreation == Source::FromGui) { @@ -142,7 +142,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const quint32 _ QPointF VToolPointFromArcAndTangent::FindPoint(const QPointF &p, const VArc *arc, const CrossCirclesPoint pType) { QPointF p1, p2; - const QPointF center = arc->GetCenter(); + const QPointF center = static_cast(arc->GetCenter()); const qreal radius = arc->GetRadius(); const int res = VGObject::ContactPoints (p, center, radius, p1, p2); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index 1e451b514..bb223a351 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -116,8 +116,8 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(const qui const VPointF cPoint = *data->GeometricObject(circleCenterId); const VPointF tPoint = *data->GeometricObject(tangentPointId); - const QPointF point = VToolPointFromCircleAndTangent::FindPoint(tPoint, cPoint, radius, - crossPoint); + const QPointF point = VToolPointFromCircleAndTangent::FindPoint(static_cast(tPoint), + static_cast(cPoint), radius, crossPoint); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index 933add83e..3040f2e06 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -213,7 +213,8 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad const qreal result = CheckFormula(_id, radius, data); - QPointF fPoint = VToolPointOfContact::FindPoint(qApp->toPixel(result), *centerP, *firstP, *secondP); + QPointF fPoint = VToolPointOfContact::FindPoint(qApp->toPixel(result), static_cast(*centerP), + static_cast(*firstP), static_cast(*secondP)); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index 9a66530d3..76d4d18d8 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -143,8 +143,8 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(const quint32 QPointF VToolPointOfIntersectionArcs::FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType) { QPointF p1, p2; - const QPointF centerArc1 = arc1->GetCenter(); - const QPointF centerArc2 = arc2->GetCenter(); + const QPointF centerArc1 = static_cast(arc1->GetCenter()); + const QPointF centerArc2 = static_cast(arc2->GetCenter()); const int res = VGObject::IntersectionCircles(centerArc1, arc1->GetRadius(), centerArc2, arc2->GetRadius(), p1, p2); QLineF r1Arc1(centerArc1, p1); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index 8153b9302..597600b03 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -127,7 +127,8 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(const q const VPointF c1Point = *data->GeometricObject(firstCircleCenterId); const VPointF c2Point = *data->GeometricObject(secondCircleCenterId); - const QPointF point = FindPoint(c1Point, c2Point, calcC1Radius, calcC2Radius, crossPoint); + const QPointF point = FindPoint(static_cast(c1Point), static_cast(c2Point), calcC1Radius, + calcC2Radius, crossPoint); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 277b1934f..efb7659f0 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -273,7 +273,7 @@ void VToolSinglePoint::RefreshPointGeometry(const VPointF &point) QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); - this->setPos(point); + this->setPos(static_cast(point)); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); namePoint->blockSignals(true); QFont font = namePoint->font(); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index e0c71cfab..04d9e0fdc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -151,7 +151,8 @@ VToolTriangle* VToolTriangle::Create(const quint32 _id, const QString &pointName const QSharedPointer firstPoint = data->GeometricObject(firstPointId); const QSharedPointer secondPoint = data->GeometricObject(secondPointId); - QPointF point = FindPoint(*axisP1, *axisP2, *firstPoint, *secondPoint); + QPointF point = FindPoint(static_cast(*axisP1), static_cast(*axisP2), + static_cast(*firstPoint), static_cast(*secondPoint)); quint32 id = _id; if (typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index d52fa3c20..bd41caa13 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -76,7 +76,7 @@ VToolLine::VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint3 //Line const QSharedPointer first = data->GeometricObject(firstPoint); const QSharedPointer second = data->GeometricObject(secondPoint); - this->setLine(QLineF(*first, *second)); + this->setLine(QLineF(static_cast(*first), static_cast(*second))); this->setFlag(QGraphicsItem::ItemStacksBehindParent, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus this->setAcceptHoverEvents(true); @@ -542,6 +542,6 @@ void VToolLine::RefreshGeometry() { const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); - this->setLine(QLineF(*first, *second)); + this->setLine(QLineF(static_cast(*first), static_cast(*second))); this->setPen(QPen(CorrectColor(lineColor), pen().widthF(), LineStyleToPenStyle(typeLine))); } diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index 714e692fe..fc8409ec2 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -299,7 +299,7 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point) QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); - this->setPos(point); + this->setPos(static_cast(point)); namePoint->blockSignals(true); namePoint->setText(point.name()); diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index adc856fa2..5e6324ce1 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -1303,7 +1303,8 @@ VPieceItem::MoveTypes VToolSeamAllowance::FindLabelGeometry(const VPatternLabelD const auto topLeftPinPoint = VAbstractTool::data.GeometricObject(topLeftPin); const auto bottomRightPinPoint = VAbstractTool::data.GeometricObject(bottomRightPin); - const QRectF labelRect = QRectF(*topLeftPinPoint, *bottomRightPinPoint); + const QRectF labelRect = QRectF(static_cast(*topLeftPinPoint), + static_cast(*bottomRightPinPoint)); labelWidth = FromPixel(qAbs(labelRect.width()), *VDataTool::data.GetPatternUnit()); labelHeight = FromPixel(qAbs(labelRect.height()), *VDataTool::data.GetPatternUnit()); @@ -1353,7 +1354,7 @@ VPieceItem::MoveTypes VToolSeamAllowance::FindLabelGeometry(const VPatternLabelD const qreal lWidth = ToPixel(labelWidth, *VDataTool::data.GetPatternUnit()); const qreal lHeight = ToPixel(labelHeight, *VDataTool::data.GetPatternUnit()); - pos = *centerPinPoint - QRectF(0, 0, lWidth, lHeight).center(); + pos = static_cast(*centerPinPoint) - QRectF(0, 0, lWidth, lHeight).center(); restrictions &= ~ VPieceItem::IsMovable; } catch(const VExceptionBadId &) @@ -1383,7 +1384,7 @@ VPieceItem::MoveTypes VToolSeamAllowance::FindGrainlineGeometry(const VGrainline const auto topPinPoint = VAbstractTool::data.GeometricObject(topPin); const auto bottomPinPoint = VAbstractTool::data.GeometricObject(bottomPin); - QLineF grainline(*bottomPinPoint, *topPinPoint); + QLineF grainline(static_cast(*bottomPinPoint), static_cast(*topPinPoint)); length = FromPixel(grainline.length(), *VDataTool::data.GetPatternUnit()); rotationAngle = grainline.angle(); diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index d9829a213..c84bd431b 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -311,7 +311,7 @@ void BiasRotatePoint(VPointF *point, qreal dx, qreal dy, const QPointF &pRotate, { point->setX(point->x()+dx); point->setY(point->y()+dy); - QLineF line(pRotate, *point); + QLineF line(pRotate, static_cast(*point)); line.setAngle(line.angle()+angle); point->setX(line.p2().x()); point->setY(line.p2().y()); @@ -352,8 +352,8 @@ void UnionInitParameters(const VToolUnionDetailsInitData &initData, const VPiece point4.setX(point4.x()+dx); point4.setY(point4.y()+dy); - const QLineF p4p3 = QLineF(point4, point3); - const QLineF p1p2 = QLineF(point1, point2); + const QLineF p4p3 = QLineF(static_cast(point4), static_cast(point3)); + const QLineF p1p2 = QLineF(static_cast(point1), static_cast(point2)); angle = p4p3.angleTo(p1p2); } @@ -368,7 +368,8 @@ quint32 AddNodePoint(const VPieceNode &node, const VToolUnionDetailsInitData &in if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - BiasRotatePoint(point.data(), dx, dy, *initData.data->GeometricObject(pRotate), angle); + BiasRotatePoint(point.data(), dx, dy, static_cast(*initData.data->GeometricObject(pRotate)), + angle); } QScopedPointer point1(new VPointF(*point)); @@ -391,7 +392,8 @@ quint32 AddPin(quint32 id, const VToolUnionDetailsInitData &initData, quint32 id if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - BiasRotatePoint(point.data(), dx, dy, *initData.data->GeometricObject(pRotate), angle); + BiasRotatePoint(point.data(), dx, dy, static_cast(*initData.data->GeometricObject(pRotate)), + angle); } QScopedPointer point1(new VPointF(*point)); @@ -417,15 +419,15 @@ quint32 AddNodeArc(const VPieceNode &node, const VToolUnionDetailsInitData &init if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *initData.data->GeometricObject(pRotate); + const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); BiasRotatePoint(center.data(), dx, dy, p, angle); } - QLineF l1(*center, p1); - QLineF l2(*center, p2); + QLineF l1(static_cast(*center), static_cast(p1)); + QLineF l2(static_cast(*center), static_cast(p2)); center->setMode(Draw::Modeling); VPointF *tmpCenter = center.take(); const quint32 idCenter = initData.data->AddGObject(tmpCenter); @@ -459,15 +461,15 @@ quint32 AddNodeElArc(const VPieceNode &node, const VToolUnionDetailsInitData &in if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *initData.data->GeometricObject(pRotate); + const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); BiasRotatePoint(center.data(), dx, dy, p, angle); } - QLineF l1(*center, p1); - QLineF l2(*center, p2); + QLineF l1(static_cast(*center), static_cast(p1)); + QLineF l2(static_cast(*center), static_cast(p2)); center->setMode(Draw::Modeling); VPointF *tmpCenter = center.take(); quint32 idCenter = initData.data->AddGObject(tmpCenter); @@ -506,7 +508,7 @@ quint32 AddNodeSpline(const VPieceNode &node, const VToolUnionDetailsInitData &i if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *initData.data->GeometricObject(pRotate); + const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -514,7 +516,7 @@ quint32 AddNodeSpline(const VPieceNode &node, const VToolUnionDetailsInitData &i BiasRotatePoint(p4.data(), dx, dy, p, angle); } - VSpline *spl = new VSpline(*p1, p2, p3, *p4, 0, Draw::Modeling); + VSpline *spl = new VSpline(*p1, static_cast(p2), static_cast(p3), *p4, 0, Draw::Modeling); const quint32 idObject = initData.data->AddGObject(spl); children.append(idObject); @@ -545,7 +547,7 @@ quint32 AddNodeSplinePath(const VPieceNode &node, const VToolUnionDetailsInitDat QScopedPointer p4(new VPointF(spline.GetP4())); if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *initData.data->GeometricObject(pRotate); + const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -553,7 +555,7 @@ quint32 AddNodeSplinePath(const VPieceNode &node, const VToolUnionDetailsInitDat BiasRotatePoint(p4.data(), dx, dy, p, angle); } - VSpline spl = VSpline(*p1, p2, p3, *p4); + VSpline spl = VSpline(*p1, static_cast(p2), static_cast(p3), *p4); if (i==1) { const qreal angle1 = spl.GetStartAngle()+180; @@ -798,7 +800,7 @@ void UpdateNodePoint(VContainer *data, const VPieceNode &node, QVector point->setMode(Draw::Modeling); if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - BiasRotatePoint(point.data(), dx, dy, *data->GeometricObject(pRotate), angle); + BiasRotatePoint(point.data(), dx, dy, static_cast(*data->GeometricObject(pRotate)), angle); } data->UpdateGObject(TakeNextId(children), point.take()); } @@ -814,15 +816,15 @@ void UpdateNodeArc(VContainer *data, const VPieceNode &node, QVector &c if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *data->GeometricObject(pRotate); + const QPointF p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); BiasRotatePoint(center.data(), dx, dy, p, angle); } - QLineF l1(*center, p1); - QLineF l2(*center, p2); + QLineF l1(static_cast(*center), static_cast(p1)); + QLineF l2(static_cast(*center), static_cast(p2)); QScopedPointer arc1(new VArc(*center, arc->GetRadius(), arc->GetFormulaRadius(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), QString().setNum(l2.angle()))); @@ -841,15 +843,15 @@ void UpdateNodeElArc(VContainer *data, const VPieceNode &node, QVector if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *data->GeometricObject(pRotate); + const QPointF p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); BiasRotatePoint(center.data(), dx, dy, p, angle); } - QLineF l1(*center, p1); - QLineF l2(*center, p2); + QLineF l1(static_cast(*center), static_cast(p1)); + QLineF l2(static_cast(*center), static_cast(p2)); QScopedPointer arc1(new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(), arc->GetFormulaRadius1(), arc->GetFormulaRadius2(), @@ -873,7 +875,7 @@ void UpdateNodeSpline(VContainer *data, const VPieceNode &node, QVector if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = *data->GeometricObject(pRotate); + const QPointF p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -881,7 +883,8 @@ void UpdateNodeSpline(VContainer *data, const VPieceNode &node, QVector BiasRotatePoint(p4.data(), dx, dy, p, angle); } - QScopedPointer spl(new VSpline(*p1, p2, p3, *p4, 0, Draw::Modeling)); + QScopedPointer spl(new VSpline(*p1, static_cast(p2), static_cast(p3), *p4, 0, + Draw::Modeling)); data->UpdateGObject(TakeNextId(children), spl.take()); } @@ -905,7 +908,7 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVectorGeometricObject(pRotate); + const QPointF p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -913,7 +916,7 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVector(p2), static_cast(p3), *p4); if (i==1) { const qreal angle1 = spl.GetStartAngle()+180; @@ -1263,7 +1266,8 @@ void UpdateUnitedDetailPins(quint32 id, const VToolUnionDetailsInitData &initDat point->setMode(Draw::Modeling); if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - BiasRotatePoint(point.data(), dx, dy, *initData.data->GeometricObject(pRotate), angle); + BiasRotatePoint(point.data(), dx, dy, + static_cast(*initData.data->GeometricObject(pRotate)), angle); } initData.data->UpdateGObject(TakeNextId(children), point.take()); } diff --git a/src/libs/vtools/visualization/line/operation/visoperation.cpp b/src/libs/vtools/visualization/line/operation/visoperation.cpp index a9566bb1d..39bdd5147 100644 --- a/src/libs/vtools/visualization/line/operation/visoperation.cpp +++ b/src/libs/vtools/visualization/line/operation/visoperation.cpp @@ -120,14 +120,14 @@ void VisOperation::RefreshFlippedObjects(const QPointF &firstPoint, const QPoint ++iPoint; QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor2); - DrawPoint(point, *p, supportColor2); + DrawPoint(point, static_cast(*p), supportColor2); ++iPoint; point = GetPoint(static_cast(iPoint), supportColor); if (object1Id != NULL_ID) { - DrawPoint(point, p->Flip(QLineF(firstPoint, secondPoint)), supportColor); + DrawPoint(point, static_cast(p->Flip(QLineF(firstPoint, secondPoint))), supportColor); } break; } diff --git a/src/libs/vtools/visualization/line/operation/vistoolflippingbyaxis.cpp b/src/libs/vtools/visualization/line/operation/vistoolflippingbyaxis.cpp index 2b20e984f..f3c4dcb9c 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolflippingbyaxis.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolflippingbyaxis.cpp @@ -56,7 +56,7 @@ void VisToolFlippingByAxis::RefreshGeometry() if (object1Id != NULL_ID) { - firstPoint = *Visualization::data->GeometricObject(object1Id); + firstPoint = static_cast(*Visualization::data->GeometricObject(object1Id)); DrawPoint(point1, firstPoint, supportColor2); if (m_axisType == AxisType::VerticalAxis) diff --git a/src/libs/vtools/visualization/line/operation/vistoolflippingbyline.cpp b/src/libs/vtools/visualization/line/operation/vistoolflippingbyline.cpp index ce808d1b0..6af7965d2 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolflippingbyline.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolflippingbyline.cpp @@ -58,7 +58,7 @@ void VisToolFlippingByLine::RefreshGeometry() if (object1Id != NULL_ID) { - firstPoint = *Visualization::data->GeometricObject(object1Id); + firstPoint = static_cast(*Visualization::data->GeometricObject(object1Id)); DrawPoint(point1, firstPoint, supportColor2); if (object2Id == NULL_ID) @@ -67,7 +67,7 @@ void VisToolFlippingByLine::RefreshGeometry() } else { - secondPoint = *Visualization::data->GeometricObject(object2Id); + secondPoint = static_cast(*Visualization::data->GeometricObject(object2Id)); DrawPoint(point2, secondPoint, supportColor2); } diff --git a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp index c4bd41362..3478123e8 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp @@ -234,7 +234,7 @@ QVector VisToolMove::CreateOriginObjects(int &iPoint, int &iCur ++iPoint; QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor2); - DrawPoint(point, *p, supportColor2); + DrawPoint(point, static_cast(*p), supportColor2); originObjects.append(point); break; @@ -289,7 +289,7 @@ void VisToolMove::CreateMovedObjects(int &iPoint, int &iCurve, qreal length, qre ++iPoint; QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor); - DrawPoint(point, p->Move(length, angle), supportColor); + DrawPoint(point, static_cast(p->Move(length, angle)), supportColor); break; } case GOType::Arc: diff --git a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp index af122dc62..f6ec72c55 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp @@ -91,29 +91,30 @@ void VisToolRotation::RefreshGeometry() if (object1Id != NULL_ID) { origin = Visualization::data->GeometricObject(object1Id); - DrawPoint(point, *origin, supportColor2); + DrawPoint(point, static_cast(*origin), supportColor2); QLineF rLine; if (VFuzzyComparePossibleNulls(angle, INT_MIN)) { - rLine = QLineF(*origin, Visualization::scenePos); + rLine = QLineF(static_cast(*origin), Visualization::scenePos); if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) { rLine.setAngle(CorrectAngle(rLine.angle())); } - rLine.setP2(Ray(*origin, rLine.angle())); + rLine.setP2(Ray(static_cast(*origin), rLine.angle())); tempAngle = rLine.angle(); } else { - rLine = QLineF(*origin, Ray(*origin, angle)); + rLine = QLineF(static_cast(*origin), Ray(static_cast(*origin), angle)); tempAngle = angle; } DrawLine(this, rLine, supportColor2, Qt::DashLine); - DrawLine(xAxis, QLineF(*origin, Ray(*origin, 0)), supportColor2, Qt::DashLine); + DrawLine(xAxis, QLineF(static_cast(*origin), Ray(static_cast(*origin), 0)), supportColor2, + Qt::DashLine); VArc arc(*origin, ToPixel(DefPointRadius/*mm*/*2, Unit::Mm), 0, tempAngle); DrawPath(angleArc, arc.GetPath(PathDirection::Hide), supportColor2, Qt::SolidLine, Qt::RoundCap); @@ -140,45 +141,46 @@ void VisToolRotation::RefreshGeometry() ++iPoint; QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor2); - DrawPoint(point, *p, supportColor2); + DrawPoint(point, static_cast(*p), supportColor2); ++iPoint; point = GetPoint(static_cast(iPoint), supportColor); if (object1Id != NULL_ID) { - DrawPoint(point, p->Rotate(*origin, tempAngle), supportColor); + DrawPoint(point, static_cast(p->Rotate(static_cast(*origin), tempAngle)), + supportColor); } break; } case GOType::Arc: { - iCurve = AddCurve(tempAngle, *origin, id, iCurve); + iCurve = AddCurve(tempAngle, static_cast(*origin), id, iCurve); break; } case GOType::EllipticalArc: { - iCurve = AddCurve(tempAngle, *origin, id, iCurve); + iCurve = AddCurve(tempAngle, static_cast(*origin), id, iCurve); break; } case GOType::Spline: { - iCurve = AddCurve(tempAngle, *origin, id, iCurve); + iCurve = AddCurve(tempAngle, static_cast(*origin), id, iCurve); break; } case GOType::SplinePath: { - iCurve = AddCurve(tempAngle, *origin, id, iCurve); + iCurve = AddCurve(tempAngle, static_cast(*origin), id, iCurve); break; } case GOType::CubicBezier: { - iCurve = AddCurve(tempAngle, *origin, id, iCurve); + iCurve = AddCurve(tempAngle, static_cast(*origin), id, iCurve); break; } case GOType::CubicBezierPath: { - iCurve = AddCurve(tempAngle, *origin, id, iCurve); + iCurve = AddCurve(tempAngle, static_cast(*origin), id, iCurve); break; } case GOType::Unknown: diff --git a/src/libs/vtools/visualization/line/vistoolalongline.cpp b/src/libs/vtools/visualization/line/vistoolalongline.cpp index 7b3e5c3f4..677270660 100644 --- a/src/libs/vtools/visualization/line/vistoolalongline.cpp +++ b/src/libs/vtools/visualization/line/vistoolalongline.cpp @@ -79,22 +79,22 @@ void VisToolAlongLine::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(lineP1, *first, supportColor); + DrawPoint(lineP1, static_cast(*first), supportColor); if (object2Id <= NULL_ID) { - DrawLine(line, QLineF(*first, Visualization::scenePos), supportColor); + DrawLine(line, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(object2Id); - DrawPoint(lineP2, *second, supportColor); + DrawPoint(lineP2, static_cast(*second), supportColor); - DrawLine(line, QLineF(*first, *second), supportColor); + DrawLine(line, QLineF(static_cast(*first), static_cast(*second)), supportColor); if (not qFuzzyIsNull(length)) { - QLineF mainLine = VGObject::BuildLine(*first, length, line->line().angle()); + QLineF mainLine = VGObject::BuildLine(static_cast(*first), length, line->line().angle()); DrawLine(this, mainLine, mainColor, lineStyle); DrawPoint(point, mainLine.p2(), mainColor); diff --git a/src/libs/vtools/visualization/line/vistoolbisector.cpp b/src/libs/vtools/visualization/line/vistoolbisector.cpp index 2a72d7b2b..2f836e110 100644 --- a/src/libs/vtools/visualization/line/vistoolbisector.cpp +++ b/src/libs/vtools/visualization/line/vistoolbisector.cpp @@ -85,43 +85,49 @@ void VisToolBisector::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(line1P1, *first, supportColor); + DrawPoint(line1P1, static_cast(*first), supportColor); if (object2Id <= NULL_ID) { - DrawLine(line1, QLineF(*first, Visualization::scenePos), supportColor); + DrawLine(line1, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(object2Id); - DrawPoint(line1P2, *second, supportColor); + DrawPoint(line1P2, static_cast(*second), supportColor); - DrawLine(line1, QLineF(*first, *second), supportColor); + DrawLine(line1, QLineF(static_cast(*first), static_cast(*second)), supportColor); if (object3Id <= NULL_ID) { - DrawLine(line2, QLineF(*second, Visualization::scenePos), supportColor); + DrawLine(line2, QLineF(static_cast(*second), Visualization::scenePos), supportColor); } else { const QSharedPointer third = Visualization::data->GeometricObject(object3Id); - DrawPoint(line2P2, *third, supportColor); + DrawPoint(line2P2, static_cast(*third), supportColor); - DrawLine(line2, QLineF(*second, *third), supportColor); + DrawLine(line2, QLineF(static_cast(*second), static_cast(*third)), supportColor); if (not qFuzzyIsNull(length)) { - qreal angle = VToolBisector::BisectorAngle(*first, *second, *third); - QLineF mainLine = VGObject::BuildLine(*second, length, angle); + qreal angle = VToolBisector::BisectorAngle(static_cast(*first), + static_cast(*second), + static_cast(*third)); + QLineF mainLine = VGObject::BuildLine(static_cast(*second), length, angle); DrawLine(this, mainLine, mainColor, lineStyle); DrawPoint(point, mainLine.p2(), mainColor); } else { - qreal angle = VToolBisector::BisectorAngle(*first, *second, *third); - QPointF endRay = Ray(*second, angle); - QLineF mainLine = VGObject::BuildLine(*second, QLineF(*second, endRay).length(), angle); + qreal angle = VToolBisector::BisectorAngle(static_cast(*first), + static_cast(*second), + static_cast(*third)); + QPointF endRay = Ray(static_cast(*second), angle); + QLineF mainLine = VGObject::BuildLine(static_cast(*second), + QLineF(static_cast(*second), endRay).length(), + angle); DrawLine(this, mainLine, mainColor, lineStyle); } } diff --git a/src/libs/vtools/visualization/line/vistoolcurveintersectaxis.cpp b/src/libs/vtools/visualization/line/vistoolcurveintersectaxis.cpp index 029149e82..98aa251d2 100644 --- a/src/libs/vtools/visualization/line/vistoolcurveintersectaxis.cpp +++ b/src/libs/vtools/visualization/line/vistoolcurveintersectaxis.cpp @@ -78,17 +78,17 @@ void VisToolCurveIntersectAxis::RefreshGeometry() const QSharedPointer first = Visualization::data->GeometricObject(axisPointId); if (VFuzzyComparePossibleNulls(angle, -1)) { - axis = Axis(*first, Visualization::scenePos); + axis = Axis(static_cast(*first), Visualization::scenePos); } else { - axis = Axis(*first, angle); + axis = Axis(static_cast(*first), angle); } - DrawPoint(basePoint, *first, mainColor); + DrawPoint(basePoint, static_cast(*first), mainColor); DrawLine(axisLine, axis, supportColor, Qt::DashLine); - QPointF p = VToolCurveIntersectAxis::FindPoint(*first, axis.angle(), curve); - QLineF axis_line(*first, p); + QPointF p = VToolCurveIntersectAxis::FindPoint(static_cast(*first), axis.angle(), curve); + QLineF axis_line(static_cast(*first), p); DrawLine(this, axis_line, mainColor, lineStyle); DrawPoint(point, p, mainColor); diff --git a/src/libs/vtools/visualization/line/vistoolendline.cpp b/src/libs/vtools/visualization/line/vistoolendline.cpp index 8cbd95ab0..cb875f437 100644 --- a/src/libs/vtools/visualization/line/vistoolendline.cpp +++ b/src/libs/vtools/visualization/line/vistoolendline.cpp @@ -68,17 +68,17 @@ void VisToolEndLine::RefreshGeometry() { if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) { - line = QLineF(*first, Visualization::scenePos); + line = QLineF(static_cast(*first), Visualization::scenePos); line.setAngle(CorrectAngle(line.angle())); } else { - line = QLineF(*first, Visualization::scenePos); + line = QLineF(static_cast(*first), Visualization::scenePos); } } else { - line = VGObject::BuildLine(*first, length, angle); + line = VGObject::BuildLine(static_cast(*first), length, angle); DrawPoint(point, line.p2(), mainColor); } DrawLine(this, line, mainColor, lineStyle); diff --git a/src/libs/vtools/visualization/line/vistoolheight.cpp b/src/libs/vtools/visualization/line/vistoolheight.cpp index 141f0dd5a..a2988d29d 100644 --- a/src/libs/vtools/visualization/line/vistoolheight.cpp +++ b/src/libs/vtools/visualization/line/vistoolheight.cpp @@ -66,37 +66,37 @@ void VisToolHeight::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(base_point, *first, supportColor); + DrawPoint(base_point, static_cast(*first), supportColor); if (lineP1Id <= NULL_ID) { - DrawLine(this, QLineF(*first, Visualization::scenePos), mainColor); + DrawLine(this, QLineF(static_cast(*first), Visualization::scenePos), mainColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(lineP1Id); - DrawPoint(lineP1, *second, supportColor); + DrawPoint(lineP1, static_cast(*second), supportColor); QLineF base_line; if (lineP2Id <= NULL_ID) { - base_line = QLineF(*second, Visualization::scenePos); + base_line = QLineF(static_cast(*second), Visualization::scenePos); DrawLine(line, base_line, supportColor); } else { const QSharedPointer third = Visualization::data->GeometricObject(lineP2Id); - DrawPoint(lineP2, *third, supportColor); + DrawPoint(lineP2, static_cast(*third), supportColor); - base_line = QLineF(*second, *third); + base_line = QLineF(static_cast(*second), static_cast(*third)); } DrawLine(line, base_line, supportColor); - QPointF height = VToolHeight::FindPoint(base_line, *first); + QPointF height = VToolHeight::FindPoint(base_line, static_cast(*first)); DrawPoint(point, height, mainColor); - QLineF height_line(*first, height); + QLineF height_line(static_cast(*first), height); DrawLine(this, height_line, mainColor, lineStyle); ShowIntersection(height_line, base_line); diff --git a/src/libs/vtools/visualization/line/vistoolline.cpp b/src/libs/vtools/visualization/line/vistoolline.cpp index 31fae46fc..7b120c306 100644 --- a/src/libs/vtools/visualization/line/vistoolline.cpp +++ b/src/libs/vtools/visualization/line/vistoolline.cpp @@ -59,12 +59,12 @@ void VisToolLine::RefreshGeometry() const QSharedPointer first = Visualization::data->GeometricObject(object1Id); if (point2Id == NULL_ID) { - line = QLineF(*first, Visualization::scenePos); + line = QLineF(static_cast(*first), Visualization::scenePos); } else { const QSharedPointer second = Visualization::data->GeometricObject(point2Id); - line = QLineF(*first, *second); + line = QLineF(static_cast(*first), static_cast(*second)); } DrawLine(this, line, mainColor, lineStyle); } diff --git a/src/libs/vtools/visualization/line/vistoollineintersect.cpp b/src/libs/vtools/visualization/line/vistoollineintersect.cpp index 485d23f9b..d416ecd63 100644 --- a/src/libs/vtools/visualization/line/vistoollineintersect.cpp +++ b/src/libs/vtools/visualization/line/vistoollineintersect.cpp @@ -66,18 +66,18 @@ void VisToolLineIntersect::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(line1P1, *first, supportColor); + DrawPoint(line1P1, static_cast(*first), supportColor); if (line1P2Id <= NULL_ID) { - DrawLine(line1, QLineF(*first, Visualization::scenePos), supportColor); + DrawLine(line1, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(line1P2Id); - DrawPoint(line1P2, *second, supportColor); + DrawPoint(line1P2, static_cast(*second), supportColor); - DrawLine(line1, QLineF(*first, *second), supportColor); + DrawLine(line1, QLineF(static_cast(*first), static_cast(*second)), supportColor); if (line2P1Id <= NULL_ID) { @@ -86,14 +86,14 @@ void VisToolLineIntersect::RefreshGeometry() else { const QSharedPointer third = Visualization::data->GeometricObject(line2P1Id); - DrawPoint(line2P1, *third, supportColor); + DrawPoint(line2P1, static_cast(*third), supportColor); if (line2P2Id <= NULL_ID) { - DrawLine(this, QLineF(*third, Visualization::scenePos), supportColor); + DrawLine(this, QLineF(static_cast(*third), Visualization::scenePos), supportColor); - QLineF l1(*first, *second); - QLineF l2(*third, Visualization::scenePos); + QLineF l1(static_cast(*first), static_cast(*second)); + QLineF l2(static_cast(*third), Visualization::scenePos); QPointF fPoint; QLineF::IntersectType intersect = l1.intersect(l2, &fPoint); if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) @@ -104,12 +104,12 @@ void VisToolLineIntersect::RefreshGeometry() else { const QSharedPointer forth = Visualization::data->GeometricObject(line2P2Id); - DrawPoint(line2P2, *forth, supportColor); + DrawPoint(line2P2, static_cast(*forth), supportColor); - DrawLine(this, QLineF(*third, *forth), supportColor); + DrawLine(this, QLineF(static_cast(*third), static_cast(*forth)), supportColor); - QLineF l1(*first, *second); - QLineF l2(*third, *forth); + QLineF l1(static_cast(*first), static_cast(*second)); + QLineF l2(static_cast(*third), static_cast(*forth)); QPointF fPoint; QLineF::IntersectType intersect = l1.intersect(l2, &fPoint); if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) diff --git a/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp b/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp index 418fb3c6a..daa3489bf 100644 --- a/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp +++ b/src/libs/vtools/visualization/line/vistoollineintersectaxis.cpp @@ -69,18 +69,18 @@ void VisToolLineIntersectAxis::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(lineP1, *first, supportColor); + DrawPoint(lineP1, static_cast(*first), supportColor); if (point2Id <= NULL_ID) { - DrawLine(baseLine, QLineF(*first, Visualization::scenePos), supportColor); + DrawLine(baseLine, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(point2Id); - DrawPoint(lineP2, *second, supportColor); + DrawPoint(lineP2, static_cast(*second), supportColor); - const QLineF base_line(*first, *second); + const QLineF base_line(static_cast(*first), static_cast(*second)); DrawLine(baseLine, base_line, supportColor); if (axisPointId > NULL_ID) @@ -89,17 +89,17 @@ void VisToolLineIntersectAxis::RefreshGeometry() const QSharedPointer third = Visualization::data->GeometricObject(axisPointId); if (VFuzzyComparePossibleNulls(angle, -1)) { - axis = Axis(*third, Visualization::scenePos); + axis = Axis(static_cast(*third), Visualization::scenePos); } else { - axis = Axis(*third, angle); + axis = Axis(static_cast(*third), angle); } - DrawPoint(basePoint, *third, mainColor); + DrawPoint(basePoint, static_cast(*third), mainColor); DrawLine(axisLine, axis, supportColor, Qt::DashLine); QPointF p = VToolLineIntersectAxis::FindPoint(axis, base_line); - QLineF axis_line(*third, p); + QLineF axis_line(static_cast(*third), p); DrawLine(this, axis_line, mainColor, lineStyle); DrawPoint(point, p, mainColor); diff --git a/src/libs/vtools/visualization/line/vistoolnormal.cpp b/src/libs/vtools/visualization/line/vistoolnormal.cpp index 0337ca683..168f38eb2 100644 --- a/src/libs/vtools/visualization/line/vistoolnormal.cpp +++ b/src/libs/vtools/visualization/line/vistoolnormal.cpp @@ -67,11 +67,11 @@ void VisToolNormal::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(lineP1, *first, supportColor); + DrawPoint(lineP1, static_cast(*first), supportColor); if (object2Id <= NULL_ID) { - QLineF line_mouse(*first, Visualization::scenePos); + QLineF line_mouse(static_cast(*first), Visualization::scenePos); DrawLine(line, line_mouse, supportColor); QLineF normal = line_mouse.normalVector(); @@ -81,9 +81,9 @@ void VisToolNormal::RefreshGeometry() else { const QSharedPointer second = Visualization::data->GeometricObject(object2Id); - DrawPoint(lineP2, *second, supportColor); + DrawPoint(lineP2, static_cast(*second), supportColor); - QLineF line_mouse(*first, *second); + QLineF line_mouse(static_cast(*first), static_cast(*second)); DrawLine(line, line_mouse, supportColor); if (qFuzzyIsNull(length)) @@ -94,8 +94,9 @@ void VisToolNormal::RefreshGeometry() } else { - QPointF fPoint = VToolNormal::FindPoint(*first, *second, length, angle); - QLineF mainLine = QLineF(*first, fPoint); + QPointF fPoint = VToolNormal::FindPoint(static_cast(*first), static_cast(*second), + length, angle); + QLineF mainLine = QLineF(static_cast(*first), fPoint); DrawLine(this, mainLine, mainColor, lineStyle); DrawPoint(point, mainLine.p2(), mainColor); diff --git a/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp b/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp index e612c52b6..fad152448 100644 --- a/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp @@ -67,16 +67,17 @@ void VisToolPointFromArcAndTangent::RefreshGeometry() if (object1Id > NULL_ID)// tangent point { const QSharedPointer tan = Visualization::data->GeometricObject(object1Id); - DrawPoint(tangent, *tan, supportColor); + DrawPoint(tangent, static_cast(*tan), supportColor); if (arcId > NULL_ID)// circle center { const QSharedPointer arc = Visualization::data->GeometricObject(arcId); DrawPath(arcPath, arc->GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap); - FindRays(*tan, arc.data()); + FindRays(static_cast(*tan), arc.data()); - const QPointF fPoint = VToolPointFromArcAndTangent::FindPoint(*tan, arc.data(), crossPoint); + const QPointF fPoint = VToolPointFromArcAndTangent::FindPoint(static_cast(*tan), arc.data(), + crossPoint); DrawPoint(point, fPoint, mainColor); } } @@ -98,7 +99,7 @@ void VisToolPointFromArcAndTangent::setCrossPoint(const CrossCirclesPoint &value void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc) { QPointF p1, p2; - const QPointF center = arc->GetCenter(); + const QPointF center = static_cast(arc->GetCenter()); const qreal radius = arc->GetRadius(); const int res = VGObject::ContactPoints (p, center, radius, p1, p2); diff --git a/src/libs/vtools/visualization/line/vistoolpointfromcircleandtangent.cpp b/src/libs/vtools/visualization/line/vistoolpointfromcircleandtangent.cpp index 3bc2345af..1f5fbcb00 100644 --- a/src/libs/vtools/visualization/line/vistoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointfromcircleandtangent.cpp @@ -64,21 +64,23 @@ void VisToolPointFromCircleAndTangent::RefreshGeometry() if (object1Id > NULL_ID)// tangent point { const QSharedPointer tan = Visualization::data->GeometricObject(object1Id); - DrawPoint(tangent, *tan, supportColor); + DrawPoint(tangent, static_cast(*tan), supportColor); if (object2Id > NULL_ID)// circle center { const QSharedPointer center = Visualization::data->GeometricObject(object2Id); - DrawPoint(cCenter, *center, supportColor); + DrawPoint(cCenter, static_cast(*center), supportColor); if (cRadius > 0) { cPath->setRect(PointRect(cRadius)); - DrawPoint(cPath, *center, Qt::darkGreen, Qt::DashLine); + DrawPoint(cPath, static_cast(*center), Qt::darkGreen, Qt::DashLine); - FindRays(*tan, *center, cRadius); + FindRays(static_cast(*tan), static_cast(*center), cRadius); - const QPointF fPoint = VToolPointFromCircleAndTangent::FindPoint(*tan, *center, cRadius, crossPoint); + const QPointF fPoint = VToolPointFromCircleAndTangent::FindPoint(static_cast(*tan), + static_cast(*center), + cRadius, crossPoint); DrawPoint(point, fPoint, mainColor); } } diff --git a/src/libs/vtools/visualization/line/vistoolpointofcontact.cpp b/src/libs/vtools/visualization/line/vistoolpointofcontact.cpp index 39d46e927..598117425 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofcontact.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofcontact.cpp @@ -65,17 +65,17 @@ void VisToolPointOfContact::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(lineP1, *first, supportColor); + DrawPoint(lineP1, static_cast(*first), supportColor); if (lineP2Id <= NULL_ID) { - DrawLine(this, QLineF(*first, Visualization::scenePos), supportColor); + DrawLine(this, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(lineP2Id); - DrawPoint(lineP2, *second, supportColor); - DrawLine(this, QLineF(*first, *second), supportColor); + DrawPoint(lineP2, static_cast(*second), supportColor); + DrawLine(this, QLineF(static_cast(*first), static_cast(*second)), supportColor); if (radiusId <= NULL_ID) { @@ -84,15 +84,17 @@ void VisToolPointOfContact::RefreshGeometry() else { const QSharedPointer third = Visualization::data->GeometricObject(radiusId); - DrawPoint(arc_point, *third, supportColor); + DrawPoint(arc_point, static_cast(*third), supportColor); if (not qFuzzyIsNull(radius)) { - QPointF fPoint = VToolPointOfContact::FindPoint(radius, *third, *first, *second); + QPointF fPoint = VToolPointOfContact::FindPoint(radius, static_cast(*third), + static_cast(*first), + static_cast(*second)); DrawPoint(point, fPoint, mainColor); circle->setRect(PointRect(radius)); - DrawPoint(circle, *third, supportColor, Qt::DashLine); + DrawPoint(circle, static_cast(*third), supportColor, Qt::DashLine); } } } diff --git a/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp b/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp index 2c3c6afbd..9b333e399 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofintersection.cpp @@ -69,9 +69,9 @@ void VisToolPointOfIntersection::RefreshGeometry() else { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(axisP1, *first, supportColor); + DrawPoint(axisP1, static_cast(*first), supportColor); - axisL1 = Axis(*first, 90); + axisL1 = Axis(static_cast(*first), 90); DrawLine(this, axisL1, supportColor, Qt::DashLine); QLineF axisL2; @@ -83,8 +83,8 @@ void VisToolPointOfIntersection::RefreshGeometry() else { const QSharedPointer second = Visualization::data->GeometricObject(point2Id); - DrawPoint(axisP2, *second, supportColor); - axisL2 = Axis(*second, 180); + DrawPoint(axisP2, static_cast(*second), supportColor); + axisL2 = Axis(static_cast(*second), 180); ShowIntersection(axisL1, axisL2, mainColor); } DrawLine(axis2, axisL2, supportColor, Qt::DashLine); diff --git a/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp b/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp index b70fb4393..f40af28f8 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofintersectioncircles.cpp @@ -69,23 +69,24 @@ void VisToolPointOfIntersectionCircles::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(c1Center, *first, supportColor); + DrawPoint(c1Center, static_cast(*first), supportColor); if (object2Id > NULL_ID) { const QSharedPointer second = Visualization::data->GeometricObject(object2Id); - DrawPoint(c2Center, *second, supportColor); + DrawPoint(c2Center, static_cast(*second), supportColor); if (c1Radius > 0 && c2Radius > 0) { c1Path->setRect(PointRect(c1Radius)); - DrawPoint(c1Path, *first, Qt::darkGreen, Qt::DashLine); + DrawPoint(c1Path, static_cast(*first), Qt::darkGreen, Qt::DashLine); c2Path->setRect(PointRect(c2Radius)); - DrawPoint(c2Path, *second, Qt::darkRed, Qt::DashLine); + DrawPoint(c2Path, static_cast(*second), Qt::darkRed, Qt::DashLine); - const QPointF fPoint = VToolPointOfIntersectionCircles::FindPoint(*first, *second, c1Radius, - c2Radius, crossPoint); + const QPointF fPoint = VToolPointOfIntersectionCircles::FindPoint(static_cast(*first), + static_cast(*second), + c1Radius, c2Radius, crossPoint); DrawPoint(point, fPoint, mainColor); } } diff --git a/src/libs/vtools/visualization/line/vistoolshoulderpoint.cpp b/src/libs/vtools/visualization/line/vistoolshoulderpoint.cpp index 352d4574c..a99df407b 100644 --- a/src/libs/vtools/visualization/line/vistoolshoulderpoint.cpp +++ b/src/libs/vtools/visualization/line/vistoolshoulderpoint.cpp @@ -69,44 +69,48 @@ void VisToolShoulderPoint::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(line1P1, *first, supportColor); + DrawPoint(line1P1, static_cast(*first), supportColor); if (lineP1Id <= NULL_ID) { - DrawLine(line1, QLineF(*first, Visualization::scenePos), supportColor); + DrawLine(line1, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(lineP1Id); - DrawPoint(line1P2, *second, supportColor); + DrawPoint(line1P2, static_cast(*second), supportColor); - DrawLine(line1, QLineF(*first, *second), supportColor); + DrawLine(line1, QLineF(static_cast(*first), static_cast(*second)), supportColor); if (lineP2Id <= NULL_ID) { - DrawLine(line2, QLineF(*second, Visualization::scenePos), supportColor); + DrawLine(line2, QLineF(static_cast(*second), Visualization::scenePos), supportColor); } else { const QSharedPointer third = Visualization::data->GeometricObject(lineP2Id); - DrawPoint(line2P2, *third, supportColor); + DrawPoint(line2P2, static_cast(*third), supportColor); - DrawLine(line2, QLineF(*second, *third), supportColor); + DrawLine(line2, QLineF(static_cast(*second), static_cast(*third)), supportColor); if (not qFuzzyIsNull(length)) { - QPointF fPoint = VToolShoulderPoint::FindPoint(*second, *third, *first, length); - QLineF mainLine = QLineF(*second, fPoint); + QPointF fPoint = VToolShoulderPoint::FindPoint(static_cast(*second), + static_cast(*third), + static_cast(*first), length); + QLineF mainLine = QLineF(static_cast(*second), fPoint); DrawLine(this, mainLine, mainColor, lineStyle); DrawPoint(point, mainLine.p2(), mainColor); - DrawLine(line3, QLineF(*first, mainLine.p2()), supportColor, Qt::DashLine); + DrawLine(line3, QLineF(static_cast(*first), mainLine.p2()), supportColor, Qt::DashLine); } else { - qreal angle = QLineF(*second, *third).angle(); - QPointF endRay = Ray(*second, angle); - QLineF mainLine = VGObject::BuildLine(*second, QLineF(*second, endRay).length(), angle); + qreal angle = QLineF(static_cast(*second), static_cast(*third)).angle(); + QPointF endRay = Ray(static_cast(*second), angle); + QLineF mainLine = VGObject::BuildLine(static_cast(*second), + QLineF(static_cast(*second), endRay).length(), + angle); DrawLine(this, mainLine, mainColor, lineStyle); } } diff --git a/src/libs/vtools/visualization/line/vistooltriangle.cpp b/src/libs/vtools/visualization/line/vistooltriangle.cpp index d4e117e8a..f7fa9d1b2 100644 --- a/src/libs/vtools/visualization/line/vistooltriangle.cpp +++ b/src/libs/vtools/visualization/line/vistooltriangle.cpp @@ -72,18 +72,18 @@ void VisToolTriangle::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(axisP1, *first, supportColor); + DrawPoint(axisP1, static_cast(*first), supportColor); if (object2Id <= NULL_ID) { - DrawAimedAxis(axis, QLineF(*first, Visualization::scenePos), supportColor); + DrawAimedAxis(axis, QLineF(static_cast(*first), Visualization::scenePos), supportColor); } else { const QSharedPointer second = Visualization::data->GeometricObject(object2Id); - DrawPoint(axisP2, *second, supportColor); + DrawPoint(axisP2, static_cast(*second), supportColor); - DrawAimedAxis(axis, QLineF(*first, *second), supportColor); + DrawAimedAxis(axis, QLineF(static_cast(*first), static_cast(*second)), supportColor); if (hypotenuseP1Id <= NULL_ID) { @@ -92,30 +92,37 @@ void VisToolTriangle::RefreshGeometry() else { const QSharedPointer third = Visualization::data->GeometricObject(hypotenuseP1Id); - DrawPoint(hypotenuseP1, *third, supportColor); + DrawPoint(hypotenuseP1, static_cast(*third), supportColor); if (hypotenuseP2Id <= NULL_ID) { - DrawLine(this, QLineF(*third, Visualization::scenePos), supportColor, Qt::DashLine); + DrawLine(this, QLineF(static_cast(*third), Visualization::scenePos), supportColor, + Qt::DashLine); - QPointF trPoint = VToolTriangle::FindPoint(*first, *second, *third, Visualization::scenePos); + QPointF trPoint = VToolTriangle::FindPoint(static_cast(*first), + static_cast(*second), + static_cast(*third), Visualization::scenePos); DrawPoint(point, trPoint, mainColor); - DrawLine(foot1, QLineF(*third, trPoint), supportColor, Qt::DashLine); + DrawLine(foot1, QLineF(static_cast(*third), trPoint), supportColor, Qt::DashLine); DrawLine(foot2, QLineF(Visualization::scenePos, trPoint), supportColor, Qt::DashLine); } else { const QSharedPointer forth = Visualization::data->GeometricObject(hypotenuseP2Id); - DrawPoint(hypotenuseP2, *forth, supportColor); + DrawPoint(hypotenuseP2, static_cast(*forth), supportColor); - DrawLine(this, QLineF(*third, *forth), supportColor, Qt::DashLine); + DrawLine(this, QLineF(static_cast(*third), static_cast(*forth)), supportColor, + Qt::DashLine); - QPointF trPoint = VToolTriangle::FindPoint(*first, *second, *third, *forth); + QPointF trPoint = VToolTriangle::FindPoint(static_cast(*first), + static_cast(*second), + static_cast(*third), + static_cast(*forth)); DrawPoint(point, trPoint, mainColor); - DrawLine(foot1, QLineF(*third, trPoint), supportColor, Qt::DashLine); - DrawLine(foot2, QLineF(*forth, trPoint), supportColor, Qt::DashLine); + DrawLine(foot1, QLineF(static_cast(*third), trPoint), supportColor, Qt::DashLine); + DrawLine(foot2, QLineF(static_cast(*forth), trPoint), supportColor, Qt::DashLine); } } } diff --git a/src/libs/vtools/visualization/line/vistooltruedarts.cpp b/src/libs/vtools/visualization/line/vistooltruedarts.cpp index e421dd963..e3379ab32 100644 --- a/src/libs/vtools/visualization/line/vistooltruedarts.cpp +++ b/src/libs/vtools/visualization/line/vistooltruedarts.cpp @@ -86,51 +86,54 @@ void VisToolTrueDarts::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer blP1 = Visualization::data->GeometricObject(object1Id); - DrawPoint(baseLineP1, *blP1, supportColor); + DrawPoint(baseLineP1, static_cast(*blP1), supportColor); if (baseLineP2Id <= NULL_ID) { - DrawLine(this, QLineF(*blP1, Visualization::scenePos), supportColor, Qt::DashLine); + DrawLine(this, QLineF(static_cast(*blP1), Visualization::scenePos), supportColor, Qt::DashLine); } else { const QSharedPointer blP2 = Visualization::data->GeometricObject(baseLineP2Id); - DrawPoint(baseLineP2, *blP2, supportColor); - DrawLine(this, QLineF(*blP1, *blP2), supportColor, Qt::DashLine); + DrawPoint(baseLineP2, static_cast(*blP2), supportColor); + DrawLine(this, QLineF(static_cast(*blP1), static_cast(*blP2)), supportColor, + Qt::DashLine); if (dartP1Id > NULL_ID) { const QSharedPointer d1 = Visualization::data->GeometricObject(dartP1Id); - DrawPoint(dartP1, *d1, supportColor); + DrawPoint(dartP1, static_cast(*d1), supportColor); if (dartP2Id <= NULL_ID) { - DrawLine(p1d2, QLineF(*d1, Visualization::scenePos), supportColor); + DrawLine(p1d2, QLineF(static_cast(*d1), Visualization::scenePos), supportColor); } else { const QSharedPointer d2 = Visualization::data->GeometricObject(dartP2Id); - DrawPoint(dartP2, *d2, supportColor); - DrawLine(p1d2, QLineF(*d1, *d2), supportColor); + DrawPoint(dartP2, static_cast(*d2), supportColor); + DrawLine(p1d2, QLineF(static_cast(*d1), static_cast(*d2)), supportColor); if (dartP3Id <= NULL_ID) { - DrawLine(d2p2, QLineF(*d2, Visualization::scenePos), supportColor); + DrawLine(d2p2, QLineF(static_cast(*d2), Visualization::scenePos), supportColor); } else { const QSharedPointer d3 = Visualization::data->GeometricObject(dartP3Id); - DrawPoint(dartP3, *d3, supportColor); - DrawLine(d2p2, QLineF(*d2, *d3), supportColor); + DrawPoint(dartP3, static_cast(*d3), supportColor); + DrawLine(d2p2, QLineF(static_cast(*d2), static_cast(*d3)), supportColor); QPointF p1; QPointF p2; - VToolTrueDarts::FindPoint(*blP1, *blP2, *d1, *d2, *d3, p1, p2); + VToolTrueDarts::FindPoint(static_cast(*blP1), static_cast(*blP2), + static_cast(*d1), static_cast(*d2), + static_cast(*d3), p1, p2); - DrawLine(lineblP1P1, QLineF(*blP1, p1), supportColor); - DrawLine(lineblP2P2, QLineF(*blP2, p2), supportColor); - DrawLine(p1d2, QLineF(p1, *d2), supportColor); - DrawLine(d2p2, QLineF(*d2, p2), supportColor); + DrawLine(lineblP1P1, QLineF(static_cast(*blP1), p1), supportColor); + DrawLine(lineblP2P2, QLineF(static_cast(*blP2), p2), supportColor); + DrawLine(p1d2, QLineF(p1, static_cast(*d2)), supportColor); + DrawLine(d2p2, QLineF(static_cast(*d2), p2), supportColor); DrawPoint(point1, p1, mainColor); DrawPoint(point2, p2, mainColor); diff --git a/src/libs/vtools/visualization/path/vistoolarc.cpp b/src/libs/vtools/visualization/path/vistoolarc.cpp index 66af87d4d..1f53dfd94 100644 --- a/src/libs/vtools/visualization/path/vistoolarc.cpp +++ b/src/libs/vtools/visualization/path/vistoolarc.cpp @@ -59,7 +59,7 @@ void VisToolArc::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(arcCenter, *first, supportColor); + DrawPoint(arcCenter, static_cast(*first), supportColor); if (not qFuzzyIsNull(radius) && f1 >= 0 && f2 >= 0) { diff --git a/src/libs/vtools/visualization/path/vistoolarcwithlength.cpp b/src/libs/vtools/visualization/path/vistoolarcwithlength.cpp index bdad14a8a..52ce6cce3 100644 --- a/src/libs/vtools/visualization/path/vistoolarcwithlength.cpp +++ b/src/libs/vtools/visualization/path/vistoolarcwithlength.cpp @@ -59,7 +59,7 @@ void VisToolArcWithLength::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(arcCenter, *first, supportColor); + DrawPoint(arcCenter, static_cast(*first), supportColor); if (not qFuzzyIsNull(radius) && f1 >= 0 && not qFuzzyIsNull(length)) { diff --git a/src/libs/vtools/visualization/path/vistoolcubicbezier.cpp b/src/libs/vtools/visualization/path/vistoolcubicbezier.cpp index 99600de23..10d297b85 100644 --- a/src/libs/vtools/visualization/path/vistoolcubicbezier.cpp +++ b/src/libs/vtools/visualization/path/vistoolcubicbezier.cpp @@ -77,17 +77,18 @@ void VisToolCubicBezier::RefreshGeometry() if (object1Id > NULL_ID) { const auto first = Visualization::data->GeometricObject(object1Id); - DrawPoint(point1, *first, Qt::DashLine); + DrawPoint(point1, static_cast(*first), Qt::DashLine); if (object2Id <= NULL_ID) { - DrawLine(helpLine1, QLineF(*first, Visualization::scenePos), mainColor, Qt::DashLine); + DrawLine(helpLine1, QLineF(static_cast(*first), Visualization::scenePos), mainColor, Qt::DashLine); } else { const auto second = Visualization::data->GeometricObject(object2Id); - DrawPoint(point2, *second, supportColor); - DrawLine(helpLine1, QLineF(*first, *second), mainColor, Qt::DashLine); + DrawPoint(point2, static_cast(*second), supportColor); + DrawLine(helpLine1, QLineF(static_cast(*first), static_cast(*second)), mainColor, + Qt::DashLine); if (object3Id <= NULL_ID) { @@ -98,19 +99,21 @@ void VisToolCubicBezier::RefreshGeometry() else { const auto third = Visualization::data->GeometricObject(object3Id); - DrawPoint(point3, *third, supportColor); + DrawPoint(point3, static_cast(*third), supportColor); if (object4Id <= NULL_ID) { VCubicBezier spline(*first, *second, *third, VPointF(Visualization::scenePos)); DrawPath(this, spline.GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap); - DrawLine(helpLine2, QLineF(*third, Visualization::scenePos), mainColor, Qt::DashLine); + DrawLine(helpLine2, QLineF(static_cast(*third), Visualization::scenePos), mainColor, + Qt::DashLine); } else { const auto fourth = Visualization::data->GeometricObject(object4Id); - DrawPoint(point4, *fourth, supportColor); - DrawLine(helpLine2, QLineF(*fourth, *third), mainColor, Qt::DashLine); + DrawPoint(point4, static_cast(*fourth), supportColor); + DrawLine(helpLine2, QLineF(static_cast(*fourth), static_cast(*third)), mainColor, + Qt::DashLine); VCubicBezier spline(*first, *second, *third, *fourth); DrawPath(this, spline.GetPath(PathDirection::Show), mainColor, Qt::SolidLine, Qt::RoundCap); diff --git a/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp b/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp index dda866ddd..c20993fef 100644 --- a/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp +++ b/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp @@ -78,7 +78,7 @@ void VisToolCubicBezierPath::RefreshGeometry() for (int i = 0; i < size; ++i) { QGraphicsEllipseItem *point = this->getPoint(mainPoints, static_cast(i), 1/*zValue*/); - DrawPoint(point, pathPoints.at(i), supportColor); + DrawPoint(point, static_cast(pathPoints.at(i)), supportColor); } if (mode == Mode::Creation) @@ -106,16 +106,18 @@ void VisToolCubicBezierPath::RefreshGeometry() const VSpline spl = path.GetSpline(i); QGraphicsLineItem *ctrlLine1 = this->getLine(static_cast(preLastPoint)); - DrawLine(ctrlLine1, QLineF(spl.GetP1(), spl.GetP2()), mainColor, Qt::DashLine); + DrawLine(ctrlLine1, QLineF(static_cast(spl.GetP1()), static_cast(spl.GetP2())), + mainColor, Qt::DashLine); QGraphicsEllipseItem *p2 = this->getPoint(ctrlPoints, static_cast(preLastPoint)); - DrawPoint(p2, spl.GetP2(), Qt::green); + DrawPoint(p2, static_cast(spl.GetP2()), Qt::green); QGraphicsLineItem *ctrlLine2 = this->getLine(static_cast(lastPoint)); - DrawLine(ctrlLine2, QLineF(spl.GetP4(), spl.GetP3()), mainColor, Qt::DashLine); + DrawLine(ctrlLine2, QLineF(static_cast(spl.GetP4()), static_cast(spl.GetP3())), + mainColor, Qt::DashLine); QGraphicsEllipseItem *p3 = this->getPoint(ctrlPoints, static_cast(lastPoint)); - DrawPoint(p3, spl.GetP3(), Qt::green); + DrawPoint(p3, static_cast(spl.GetP3()), Qt::green); } } @@ -193,8 +195,8 @@ void VisToolCubicBezierPath::Creating(const QVector &pathPoints, int po const VPointF p1 = pathPoints.last(); if (pathPoints.size() >= 4) { - QLineF p1p2(p1, Visualization::scenePos); - QLineF prP3p1(pathPoints.at(size-2), p1); + QLineF p1p2(static_cast(p1), Visualization::scenePos); + QLineF prP3p1(static_cast(pathPoints.at(size-2)), static_cast(p1)); p1p2.setAngle(prP3p1.angle()); const QPointF p2 = p1p2.p2(); @@ -210,24 +212,25 @@ void VisToolCubicBezierPath::Creating(const QVector &pathPoints, int po } else { - DrawLine(helpLine1, QLineF(p1, Visualization::scenePos), mainColor, Qt::DashLine); + DrawLine(helpLine1, QLineF(static_cast(p1), Visualization::scenePos), mainColor, Qt::DashLine); } break; } case 1: { const VPointF p1 = pathPoints.at(subSplPoints + pointsLeft-1); - QPointF p2 = pathPoints.at(subSplPoints + pointsLeft); + QPointF p2 = static_cast(pathPoints.at(subSplPoints + pointsLeft)); if (subSplCount >= 1) { - QLineF p1p2(p1, p2); - QLineF prP3p1(pathPoints.at(subSplPoints + pointsLeft-2), p1); + QLineF p1p2(static_cast(p1), p2); + QLineF prP3p1(static_cast(pathPoints.at(subSplPoints + pointsLeft-2)), + static_cast(p1)); p1p2.setAngle(prP3p1.angle()); p2 = p1p2.p2(); } - DrawLine(helpLine1, QLineF(p1, p2), mainColor, Qt::DashLine); + DrawLine(helpLine1, QLineF(static_cast(p1), p2), mainColor, Qt::DashLine); VSpline spline(p1, p2, Visualization::scenePos, VPointF(Visualization::scenePos)); DrawPath(newCurveSegment, spline.GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap); @@ -240,18 +243,19 @@ void VisToolCubicBezierPath::Creating(const QVector &pathPoints, int po case 2: { const VPointF p1 = pathPoints.at(subSplPoints + pointsLeft-2); - QPointF p2 = pathPoints.at(subSplPoints + pointsLeft-1); - const QPointF p3 = pathPoints.at(subSplPoints + pointsLeft); + QPointF p2 = static_cast(pathPoints.at(subSplPoints + pointsLeft-1)); + const QPointF p3 = static_cast(pathPoints.at(subSplPoints + pointsLeft)); if (subSplCount >= 1) { - QLineF p1p2(p1, p2); - QLineF prP3p1(pathPoints.at(subSplPoints + pointsLeft-3), p1); + QLineF p1p2(static_cast(p1), p2); + QLineF prP3p1(static_cast(pathPoints.at(subSplPoints + pointsLeft-3)), + static_cast(p1)); p1p2.setAngle(prP3p1.angle()); p2 = p1p2.p2(); } - DrawLine(helpLine1, QLineF(p1, p2), mainColor, Qt::DashLine); + DrawLine(helpLine1, QLineF(static_cast(p1), p2), mainColor, Qt::DashLine); DrawLine(helpLine2, QLineF(p3, Visualization::scenePos), mainColor, Qt::DashLine); VSpline spline(p1, p2, p3, VPointF(Visualization::scenePos)); diff --git a/src/libs/vtools/visualization/path/vistoolcutspline.cpp b/src/libs/vtools/visualization/path/vistoolcutspline.cpp index 7120ade02..1ae8f2ddb 100644 --- a/src/libs/vtools/visualization/path/vistoolcutspline.cpp +++ b/src/libs/vtools/visualization/path/vistoolcutspline.cpp @@ -79,8 +79,8 @@ void VisToolCutSpline::RefreshGeometry() QPointF spl2p3; const QPointF p = spl->CutSpline (length, spl1p2, spl1p3, spl2p2, spl2p3 ); - const VSpline sp1 = VSpline(spl->GetP1(), spl1p2, spl1p3, p); - const VSpline sp2 = VSpline(p, spl2p2, spl2p3, spl->GetP4()); + const VSpline sp1 = VSpline(spl->GetP1(), spl1p2, spl1p3, VPointF(p)); + const VSpline sp2 = VSpline(VPointF(p), spl2p2, spl2p3, spl->GetP4()); DrawPoint(point, p, mainColor); diff --git a/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp b/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp index 253bdbb25..b449a3b06 100644 --- a/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp +++ b/src/libs/vtools/visualization/path/vistoolcutsplinepath.cpp @@ -80,7 +80,7 @@ void VisToolCutSplinePath::RefreshGeometry() SCASSERT(spPath1 != nullptr) SCASSERT(spPath2 != nullptr) - DrawPoint(point, *p, mainColor); + DrawPoint(point, static_cast(*p), mainColor); delete p; DrawPath(splPath1, spPath1->GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap); diff --git a/src/libs/vtools/visualization/path/vistoolellipticalarc.cpp b/src/libs/vtools/visualization/path/vistoolellipticalarc.cpp index 381db5763..17acc8d6d 100644 --- a/src/libs/vtools/visualization/path/vistoolellipticalarc.cpp +++ b/src/libs/vtools/visualization/path/vistoolellipticalarc.cpp @@ -56,7 +56,7 @@ void VisToolEllipticalArc::RefreshGeometry() if (object1Id > NULL_ID) { const QSharedPointer first = Visualization::data->GeometricObject(object1Id); - DrawPoint(arcCenter, *first, supportColor); + DrawPoint(arcCenter, static_cast(*first), supportColor); if (not qFuzzyIsNull(radius1) && not qFuzzyIsNull(radius2) && f1 >= 0 && f2 >= 0 && rotationAngle >= 0) { diff --git a/src/libs/vtools/visualization/path/vistoolspline.cpp b/src/libs/vtools/visualization/path/vistoolspline.cpp index 0fdb61045..dbb13d0da 100644 --- a/src/libs/vtools/visualization/path/vistoolspline.cpp +++ b/src/libs/vtools/visualization/path/vistoolspline.cpp @@ -91,24 +91,25 @@ void VisToolSpline::RefreshGeometry() if (object1Id > NULL_ID) { const auto first = Visualization::data->GeometricObject(object1Id); - DrawPoint(point1, *first, supportColor); + DrawPoint(point1, static_cast(*first), supportColor); if (mode == Mode::Creation) { if (isLeftMousePressed && not p2Selected) { p2 = Visualization::scenePos; - controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, p2, *first); + controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, p2, + static_cast(*first)); if (not controlPoints[0]->isVisible()) { - if (QLineF(*first, p2).length() > radius) + if (QLineF(static_cast(*first), p2).length() > radius) { controlPoints[0]->show(); } else { - p2 = *first; + p2 = static_cast(*first); } } } @@ -126,26 +127,27 @@ void VisToolSpline::RefreshGeometry() else { const auto second = Visualization::data->GeometricObject(object4Id); - DrawPoint(point4, *second, supportColor); + DrawPoint(point4, static_cast(*second), supportColor); if (mode == Mode::Creation) { if (isLeftMousePressed && not p3Selected) { - QLineF ctrlLine (*second, Visualization::scenePos); + QLineF ctrlLine (static_cast(*second), Visualization::scenePos); ctrlLine.setAngle(ctrlLine.angle()+180); p3 = ctrlLine.p2(); - controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, p3, *second); + controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, p3, + static_cast(*second)); if (not controlPoints[1]->isVisible()) { - if (QLineF(*second, p3).length() > radius) + if (QLineF(static_cast(*second), p3).length() > radius) { controlPoints[1]->show(); } else { - p3 = *second; + p3 = static_cast(*second); } } } diff --git a/src/libs/vtools/visualization/path/vistoolsplinepath.cpp b/src/libs/vtools/visualization/path/vistoolsplinepath.cpp index 9f060ca27..3ce58b1ed 100644 --- a/src/libs/vtools/visualization/path/vistoolsplinepath.cpp +++ b/src/libs/vtools/visualization/path/vistoolsplinepath.cpp @@ -78,7 +78,7 @@ void VisToolSplinePath::RefreshGeometry() for (int i = 0; i < size; ++i) { QGraphicsEllipseItem *point = this->getPoint(static_cast(i)); - DrawPoint(point, pathPoints.at(i).P(), supportColor); + DrawPoint(point, static_cast(pathPoints.at(i).P()), supportColor); } if (mode == Mode::Creation) @@ -92,14 +92,16 @@ void VisToolSplinePath::RefreshGeometry() VSpline spl = path.GetSpline(i); - ctrlPoints[preLastPoint]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, spl.GetP2(), - spl.GetP1()); - ctrlPoints[lastPoint]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, spl.GetP3(), - spl.GetP4()); + ctrlPoints[preLastPoint]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, + static_cast(spl.GetP2()), + static_cast(spl.GetP1())); + ctrlPoints[lastPoint]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, + static_cast(spl.GetP3()), + static_cast(spl.GetP4())); } } - Creating(pathPoints.at(size-1).P(), size); + Creating(static_cast(pathPoints.at(size-1).P()), size); } if (size > 1) @@ -270,7 +272,7 @@ void VisToolSplinePath::Creating(const QPointF &pSpl, int size) else { const VSpline spl = path.GetSpline(size - 1); - VSpline preSpl(spl.GetP1(), spl.GetP2(), ctrlLine.p2(), VPointF(pSpl)); + VSpline preSpl(spl.GetP1(), static_cast(spl.GetP2()), ctrlLine.p2(), VPointF(pSpl)); path[size-1].SetAngle2(spline.GetStartAngle(), spline.GetStartAngleFormula()); if (ctrlPoint != pSpl) diff --git a/src/libs/vwidgets/vsimplepoint.cpp b/src/libs/vwidgets/vsimplepoint.cpp index e8170f3b2..87c751f33 100644 --- a/src/libs/vwidgets/vsimplepoint.cpp +++ b/src/libs/vwidgets/vsimplepoint.cpp @@ -144,7 +144,7 @@ void VSimplePoint::RefreshGeometry(const VPointF &point) QRectF rec = QRectF(0, 0, radius*2, radius*2); rec.translate(-rec.center().x(), -rec.center().y()); this->setRect(rec); - this->setPos(point); + this->setPos(static_cast(point)); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); namePoint->blockSignals(true); QFont font = namePoint->font(); diff --git a/src/test/ValentinaTest/tst_varc.cpp b/src/test/ValentinaTest/tst_varc.cpp index 20d35574b..377d81aa6 100644 --- a/src/test/ValentinaTest/tst_varc.cpp +++ b/src/test/ValentinaTest/tst_varc.cpp @@ -181,7 +181,7 @@ void TST_VArc::TestGetPoints() for (int i=0; i < points.size(); ++i) { - QLineF rLine(center, points.at(i)); + QLineF rLine(static_cast(center), points.at(i)); const qreal value = qAbs(rLine.length() - radius); const QString errorMsg = QString("Broken the first rule. All points should be on the same distance from " "the center. Error ='%1'.").arg(value); @@ -199,7 +199,7 @@ void TST_VArc::TestGetPoints() else {// sector square gSquere = (M_PI * radius * radius) / 360.0 * arc.AngleArc(); - points.append(center); + points.append(static_cast(center)); } // calculated square @@ -305,7 +305,7 @@ void TST_VArc::TestFlip() QFETCH(QLineF, axis); QFETCH(QString, prefix); - VArc originArc(center, radius, startAngle, endAngle); + VArc originArc(VPointF(center), radius, startAngle, endAngle); const VArc res = originArc.Flip(axis, prefix); const QString errorMsg = QString("The name doesn't contain the prefix '%1'.").arg(prefix); diff --git a/src/test/ValentinaTest/tst_vellipticalarc.cpp b/src/test/ValentinaTest/tst_vellipticalarc.cpp index 794af45ef..c4168be69 100644 --- a/src/test/ValentinaTest/tst_vellipticalarc.cpp +++ b/src/test/ValentinaTest/tst_vellipticalarc.cpp @@ -300,13 +300,13 @@ void TST_VEllipticalArc::TestGetPoints2() const qreal c = qSqrt(qAbs(radius2*radius2 - radius1*radius1)); // distance from the center to the focus - QPointF focus1 = center; - QPointF focus2 = center; + QPointF focus1 = static_cast(center); + QPointF focus2 = static_cast(center); if (radius1 < radius2) { focus1.setY(focus1.ry() + c); - QLineF line(center, focus1); + QLineF line(static_cast(center), focus1); line.setAngle(line.angle() + rotationAngle); focus1 = line.p2(); @@ -318,7 +318,7 @@ void TST_VEllipticalArc::TestGetPoints2() else { focus1.setX(focus1.rx() + c); - QLineF line(center, focus1); + QLineF line(static_cast(center), focus1); line.setAngle(line.angle() + rotationAngle); focus1 = line.p2(); @@ -329,7 +329,7 @@ void TST_VEllipticalArc::TestGetPoints2() } QPointF ellipsePoint(center.x() + radius1, center.y()); - QLineF line(center, ellipsePoint); + QLineF line(static_cast(center), ellipsePoint); line.setAngle(line.angle() + rotationAngle); ellipsePoint = line.p2(); @@ -464,7 +464,7 @@ void TST_VEllipticalArc::TestFlip_data() QTest::addColumn("axis"); QTest::addColumn("prefix"); - const VEllipticalArc elArc(QPointF(), 10., 20.0, 1., 91., 0.); + const VEllipticalArc elArc(VPointF(), 10., 20.0, 1., 91., 0.); QLineF axis(QPointF(600, 30), QPointF(600, 1800)); diff --git a/src/test/ValentinaTest/tst_vspline.cpp b/src/test/ValentinaTest/tst_vspline.cpp index 364274b87..59dcf3a08 100644 --- a/src/test/ValentinaTest/tst_vspline.cpp +++ b/src/test/ValentinaTest/tst_vspline.cpp @@ -326,7 +326,7 @@ void TST_VSpline::CompareThreeWays() VPointF p4(681.33729132409951, 1815.7969526662778, "p4", 5.0000125984251973, 9.9999874015748045); VSpline spl1(p1, p4, 229.381, 41.6325, 0.96294100000000005, 1.00054, 1); - VSpline spl2(spl1.GetP1(), spl1.GetP2(), spl1.GetP3(), spl1.GetP4(), 1); + VSpline spl2(spl1.GetP1(), static_cast(spl1.GetP2()), static_cast(spl1.GetP3()), spl1.GetP4(), 1); VSpline spl3(spl1.GetP1(), spl1.GetP4(), spl1.GetStartAngle(), "", spl2.GetEndAngle(), "", spl2.GetC1Length(), "", spl2.GetC2Length(), "", 1);