Refactoring. Avoid implicit conversions.
--HG-- branch : develop
This commit is contained in:
parent
b506b1d177
commit
f9aa896477
|
@ -1524,7 +1524,8 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par
|
||||||
Q_UNUSED(e)
|
Q_UNUSED(e)
|
||||||
return;// Just ignore
|
return;// Just ignore
|
||||||
}
|
}
|
||||||
data->UpdateGObject(id, new VPointF(*point, point->name(), mx, my, idObject, Draw::Modeling));
|
data->UpdateGObject(id, new VPointF(static_cast<QPointF>(*point), point->name(), mx, my, idObject,
|
||||||
|
Draw::Modeling));
|
||||||
VNodePoint::Create(this, data, sceneDetail, id, idObject, parse, Source::FromFile, "", idTool);
|
VNodePoint::Create(this, data, sceneDetail, id, idObject, parse, Source::FromFile, "", idTool);
|
||||||
}
|
}
|
||||||
catch (const VExceptionBadId &e)
|
catch (const VExceptionBadId &e)
|
||||||
|
|
|
@ -101,7 +101,7 @@ QPointF VAbstractCubicBezier::CutSpline(qreal length, QPointF &spl1p2, QPointF &
|
||||||
|
|
||||||
const qreal parT = GetParmT(length);
|
const qreal parT = GetParmT(length);
|
||||||
|
|
||||||
QLineF seg1_2 ( GetP1 (), GetControlPoint1 () );
|
QLineF seg1_2 ( static_cast<QPointF>(GetP1 ()), GetControlPoint1 () );
|
||||||
seg1_2.setLength(seg1_2.length () * parT);
|
seg1_2.setLength(seg1_2.length () * parT);
|
||||||
const QPointF p12 = seg1_2.p2();
|
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);
|
seg12_23.setLength(seg12_23.length () * parT);
|
||||||
const QPointF p123 = seg12_23.p2();
|
const QPointF p123 = seg12_23.p2();
|
||||||
|
|
||||||
QLineF seg3_4 ( GetControlPoint2 (), GetP4 () );
|
QLineF seg3_4 ( GetControlPoint2 (), static_cast<QPointF>(GetP4 ()) );
|
||||||
seg3_4.setLength(seg3_4.length () * parT);
|
seg3_4.setLength(seg3_4.length () * parT);
|
||||||
const QPointF p34 = seg3_4.p2();
|
const QPointF p34 = seg3_4.p2();
|
||||||
|
|
||||||
|
@ -551,7 +551,7 @@ qreal VAbstractCubicBezier::LengthT(qreal t) const
|
||||||
qDebug()<<"Wrong value t.";
|
qDebug()<<"Wrong value t.";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
QLineF seg1_2 ( GetP1 (), GetControlPoint1 () );
|
QLineF seg1_2 ( static_cast<QPointF>(GetP1 ()), GetControlPoint1 () );
|
||||||
seg1_2.setLength(seg1_2.length () * t);
|
seg1_2.setLength(seg1_2.length () * t);
|
||||||
const QPointF p12 = seg1_2.p2();
|
const QPointF p12 = seg1_2.p2();
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ qreal VAbstractCubicBezier::LengthT(qreal t) const
|
||||||
seg12_23.setLength(seg12_23.length () * t);
|
seg12_23.setLength(seg12_23.length () * t);
|
||||||
const QPointF p123 = seg12_23.p2();
|
const QPointF p123 = seg12_23.p2();
|
||||||
|
|
||||||
QLineF seg3_4 ( GetControlPoint2 (), GetP4 () );
|
QLineF seg3_4 ( GetControlPoint2 (), static_cast<QPointF>(GetP4 ()) );
|
||||||
seg3_4.setLength(seg3_4.length () * t);
|
seg3_4.setLength(seg3_4.length () * t);
|
||||||
const QPointF p34 = seg3_4.p2();
|
const QPointF p34 = seg3_4.p2();
|
||||||
|
|
||||||
|
@ -575,5 +575,5 @@ qreal VAbstractCubicBezier::LengthT(qreal t) const
|
||||||
seg123_234.setLength(seg123_234.length () * t);
|
seg123_234.setLength(seg123_234.length () * t);
|
||||||
const QPointF p1234 = seg123_234.p2();
|
const QPointF p1234 = seg123_234.p2();
|
||||||
|
|
||||||
return LengthBezier ( GetP1(), p12, p123, p1234);
|
return LengthBezier ( static_cast<QPointF>(GetP1()), p12, p123, p1234);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 p1 = VPointF::RotatePF(originPoint, GetP1(), degrees);
|
||||||
const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), 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<QPointF>(center), p1).angle(),
|
||||||
|
QLineF(static_cast<QPointF>(center), p2).angle());
|
||||||
arc.setName(name() + prefix);
|
arc.setName(name() + prefix);
|
||||||
return arc;
|
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 p1 = VPointF::FlipPF(axis, GetP1());
|
||||||
const QPointF p2 = VPointF::FlipPF(axis, GetP2());
|
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<QPointF>(center), p1).angle(),
|
||||||
|
QLineF(static_cast<QPointF>(center), p2).angle());
|
||||||
arc.setName(name() + prefix);
|
arc.setName(name() + prefix);
|
||||||
arc.SetFlipped(true);
|
arc.SetFlipped(true);
|
||||||
return arc;
|
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 p1 = VPointF::MovePF(GetP1(), length, angle);
|
||||||
const QPointF p2 = VPointF::MovePF(GetP2(), 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<QPointF>(center), p1).angle(),
|
||||||
|
QLineF(static_cast<QPointF>(center), p2).angle());
|
||||||
arc.setName(name() + prefix);
|
arc.setName(name() + prefix);
|
||||||
return arc;
|
return arc;
|
||||||
}
|
}
|
||||||
|
@ -184,7 +187,7 @@ qreal VArc::GetLength() const
|
||||||
QPointF VArc::GetP1() const
|
QPointF VArc::GetP1() const
|
||||||
{
|
{
|
||||||
QPointF p1 ( GetCenter().x () + d->radius, GetCenter().y () );
|
QPointF p1 ( GetCenter().x () + d->radius, GetCenter().y () );
|
||||||
QLineF centerP1(GetCenter(), p1);
|
QLineF centerP1(static_cast<QPointF>(GetCenter()), p1);
|
||||||
centerP1.setAngle(GetStartAngle());
|
centerP1.setAngle(GetStartAngle());
|
||||||
return centerP1.p2();
|
return centerP1.p2();
|
||||||
}
|
}
|
||||||
|
@ -197,7 +200,7 @@ QPointF VArc::GetP1() const
|
||||||
QPointF VArc::GetP2 () const
|
QPointF VArc::GetP2 () const
|
||||||
{
|
{
|
||||||
QPointF p2 ( GetCenter().x () + d->radius, GetCenter().y () );
|
QPointF p2 ( GetCenter().x () + d->radius, GetCenter().y () );
|
||||||
QLineF centerP2(GetCenter(), p2);
|
QLineF centerP2(static_cast<QPointF>(GetCenter()), p2);
|
||||||
centerP2.setAngle(GetEndAngle());
|
centerP2.setAngle(GetEndAngle());
|
||||||
return centerP2.p2();
|
return centerP2.p2();
|
||||||
}
|
}
|
||||||
|
@ -249,7 +252,7 @@ QVector<QPointF> VArc::GetPoints() const
|
||||||
{
|
{
|
||||||
const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(qDegreesToRadians(sectionAngle.at(i)) * 0.25);
|
const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(qDegreesToRadians(sectionAngle.at(i)) * 0.25);
|
||||||
|
|
||||||
const QPointF center = GetCenter();
|
const QPointF center = static_cast<QPointF>(GetCenter());
|
||||||
|
|
||||||
QLineF lineP1P2(pStart, center);
|
QLineF lineP1P2(pStart, center);
|
||||||
lineP1P2.setAngle(lineP1P2.angle() - 90.0);
|
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
|
qreal n = qRadiansToDegrees(len/d->radius); // n - is angle in degrees
|
||||||
|
|
||||||
QLineF line(GetCenter(), GetP1());
|
QLineF line(static_cast<QPointF>(GetCenter()), GetP1());
|
||||||
line.setAngle(line.angle()+n);
|
line.setAngle(line.angle()+n);
|
||||||
|
|
||||||
arc1 = VArc (GetCenter(), d->radius, d->formulaRadius, GetStartAngle(), GetFormulaF1(), line.angle(),
|
arc1 = VArc (GetCenter(), d->radius, d->formulaRadius, GetStartAngle(), GetFormulaF1(), line.angle(),
|
||||||
|
|
|
@ -156,13 +156,13 @@ void VCubicBezier::SetP4(const VPointF &p)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VCubicBezier::GetStartAngle() const
|
qreal VCubicBezier::GetStartAngle() const
|
||||||
{
|
{
|
||||||
return QLineF(GetP1(), GetP2()).angle();
|
return QLineF(static_cast<QPointF>(GetP1()), static_cast<QPointF>(GetP2())).angle();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VCubicBezier::GetEndAngle() const
|
qreal VCubicBezier::GetEndAngle() const
|
||||||
{
|
{
|
||||||
return QLineF(GetP4(), GetP3()).angle();
|
return QLineF(static_cast<QPointF>(GetP4()), static_cast<QPointF>(GetP3())).angle();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -172,7 +172,8 @@ qreal VCubicBezier::GetEndAngle() const
|
||||||
*/
|
*/
|
||||||
qreal VCubicBezier::GetLength() const
|
qreal VCubicBezier::GetLength() const
|
||||||
{
|
{
|
||||||
return LengthBezier (GetP1(), GetP2(), GetP3(), GetP4());
|
return LengthBezier (static_cast<QPointF>(GetP1()), static_cast<QPointF>(GetP2()),
|
||||||
|
static_cast<QPointF>(GetP3()), static_cast<QPointF>(GetP4()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -182,29 +183,30 @@ qreal VCubicBezier::GetLength() const
|
||||||
*/
|
*/
|
||||||
QVector<QPointF> VCubicBezier::GetPoints() const
|
QVector<QPointF> VCubicBezier::GetPoints() const
|
||||||
{
|
{
|
||||||
return GetCubicBezierPoints(GetP1(), GetP2(), GetP3(), GetP4());
|
return GetCubicBezierPoints(static_cast<QPointF>(GetP1()), static_cast<QPointF>(GetP2()),
|
||||||
|
static_cast<QPointF>(GetP3()), static_cast<QPointF>(GetP4()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VCubicBezier::GetC1Length() const
|
qreal VCubicBezier::GetC1Length() const
|
||||||
{
|
{
|
||||||
return QLineF(GetP1(), GetP2()).length();
|
return QLineF(static_cast<QPointF>(GetP1()), static_cast<QPointF>(GetP2())).length();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VCubicBezier::GetC2Length() const
|
qreal VCubicBezier::GetC2Length() const
|
||||||
{
|
{
|
||||||
return QLineF(GetP4(), GetP3()).length();
|
return QLineF(static_cast<QPointF>(GetP4()), static_cast<QPointF>(GetP3())).length();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPointF VCubicBezier::GetControlPoint1() const
|
QPointF VCubicBezier::GetControlPoint1() const
|
||||||
{
|
{
|
||||||
return GetP2();
|
return static_cast<QPointF>(GetP2());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPointF VCubicBezier::GetControlPoint2() const
|
QPointF VCubicBezier::GetControlPoint2() const
|
||||||
{
|
{
|
||||||
return GetP3();
|
return static_cast<QPointF>(GetP3());
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ const VPointF &VCubicBezierPath::at(int indx) const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VCubicBezierPath::append(const VPointF &point)
|
void VCubicBezierPath::append(const VPointF &point)
|
||||||
{
|
{
|
||||||
if (d->path.size() > 0 && d->path.last() != point)
|
if (d->path.size() > 0 && static_cast<QPointF>(d->path.last()) != static_cast<QPointF>(point))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -181,18 +181,18 @@ VSpline VCubicBezierPath::GetSpline(qint32 index) const
|
||||||
const qint32 base = SubSplOffset(index);
|
const qint32 base = SubSplOffset(index);
|
||||||
|
|
||||||
// Correction the first control point of each next spline curve except for the first.
|
// 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<QPointF>(d->path.at(base + 1));
|
||||||
if (base + 1 > 1)
|
if (base + 1 > 1)
|
||||||
{
|
{
|
||||||
const QPointF b = d->path.at(base);
|
const QPointF b = static_cast<QPointF>(d->path.at(base));
|
||||||
QLineF foot1(b, d->path.at(base - 1));
|
QLineF foot1(b, static_cast<QPointF>(d->path.at(base - 1)));
|
||||||
QLineF foot2(b, p2);
|
QLineF foot2(b, p2);
|
||||||
|
|
||||||
foot2.setAngle(foot1.angle() + 180);
|
foot2.setAngle(foot1.angle() + 180);
|
||||||
p2 = foot2.p2();
|
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<QPointF>(d->path.at(base + 2)), d->path.at(base + 3));
|
||||||
return spl;
|
return spl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,8 +129,8 @@ VEllipticalArc VEllipticalArc::Rotate(const QPointF &originPoint, qreal degrees,
|
||||||
const VPointF center = GetCenter().Rotate(originPoint, degrees);
|
const VPointF center = GetCenter().Rotate(originPoint, degrees);
|
||||||
const QPointF p1 = VPointF::RotatePF(originPoint, GetP1(), degrees);
|
const QPointF p1 = VPointF::RotatePF(originPoint, GetP1(), degrees);
|
||||||
const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), degrees);
|
const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), degrees);
|
||||||
const qreal f1 = QLineF(center, p1).angle() - GetRotationAngle();
|
const qreal f1 = QLineF(static_cast<QPointF>(center), p1).angle() - GetRotationAngle();
|
||||||
const qreal f2 = QLineF(center, p2).angle() - GetRotationAngle();
|
const qreal f2 = QLineF(static_cast<QPointF>(center), p2).angle() - GetRotationAngle();
|
||||||
VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle());
|
VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle());
|
||||||
elArc.setName(name() + prefix);
|
elArc.setName(name() + prefix);
|
||||||
return elArc;
|
return elArc;
|
||||||
|
@ -142,8 +142,8 @@ VEllipticalArc VEllipticalArc::Flip(const QLineF &axis, const QString &prefix) c
|
||||||
const VPointF center = GetCenter().Flip(axis);
|
const VPointF center = GetCenter().Flip(axis);
|
||||||
const QPointF p1 = VPointF::FlipPF(axis, GetP1());
|
const QPointF p1 = VPointF::FlipPF(axis, GetP1());
|
||||||
const QPointF p2 = VPointF::FlipPF(axis, GetP2());
|
const QPointF p2 = VPointF::FlipPF(axis, GetP2());
|
||||||
const qreal f1 = QLineF(center, p1).angle() - GetRotationAngle();
|
const qreal f1 = QLineF(static_cast<QPointF>(center), p1).angle() - GetRotationAngle();
|
||||||
const qreal f2 = QLineF(center, p2).angle() - GetRotationAngle();
|
const qreal f2 = QLineF(static_cast<QPointF>(center), p2).angle() - GetRotationAngle();
|
||||||
VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle());
|
VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle());
|
||||||
elArc.setName(name() + prefix);
|
elArc.setName(name() + prefix);
|
||||||
elArc.SetFlipped(true);
|
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 VPointF center = GetCenter().Move(length, angle);
|
||||||
const QPointF p1 = VPointF::MovePF(GetP1(), length, angle);
|
const QPointF p1 = VPointF::MovePF(GetP1(), length, angle);
|
||||||
const QPointF p2 = VPointF::MovePF(GetP2(), length, angle);
|
const QPointF p2 = VPointF::MovePF(GetP2(), length, angle);
|
||||||
const qreal f1 = QLineF(center, p1).angle() - GetRotationAngle();
|
const qreal f1 = QLineF(static_cast<QPointF>(center), p1).angle() - GetRotationAngle();
|
||||||
const qreal f2 = QLineF(center, p2).angle() - GetRotationAngle();
|
const qreal f2 = QLineF(static_cast<QPointF>(center), p2).angle() - GetRotationAngle();
|
||||||
VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle());
|
VEllipticalArc elArc(center, GetRadius1(), GetRadius2(), f1, f2, GetRotationAngle());
|
||||||
elArc.setName(name() + prefix);
|
elArc.setName(name() + prefix);
|
||||||
return elArc;
|
return elArc;
|
||||||
|
@ -280,7 +280,7 @@ QPointF VEllipticalArc::GetPoint (qreal angle) const
|
||||||
|
|
||||||
QPointF p (GetCenter().x() + x, GetCenter().y() + y);
|
QPointF p (GetCenter().x() + x, GetCenter().y() + y);
|
||||||
// rotation of point
|
// rotation of point
|
||||||
QLineF line(GetCenter(), p);
|
QLineF line(static_cast<QPointF>(GetCenter()), p);
|
||||||
line.setAngle(line.angle() + GetRotationAngle());
|
line.setAngle(line.angle() + GetRotationAngle());
|
||||||
|
|
||||||
return line.p2();
|
return line.p2();
|
||||||
|
|
|
@ -53,15 +53,14 @@ class VPointF:public VGObject
|
||||||
public:
|
public:
|
||||||
VPointF ();
|
VPointF ();
|
||||||
VPointF (const VPointF &point );
|
VPointF (const VPointF &point );
|
||||||
// cppcheck-suppress noExplicitConstructor
|
explicit VPointF (const QPointF &point );
|
||||||
VPointF (const QPointF &point );
|
|
||||||
VPointF (qreal x, qreal y, const QString &name, qreal mx, qreal my, quint32 idObject = 0,
|
VPointF (qreal x, qreal y, const QString &name, qreal mx, qreal my, quint32 idObject = 0,
|
||||||
const Draw &mode = Draw::Calculation);
|
const Draw &mode = Draw::Calculation);
|
||||||
VPointF (const QPointF &point, const QString &name, qreal mx, qreal my, quint32 idObject = 0,
|
VPointF (const QPointF &point, const QString &name, qreal mx, qreal my, quint32 idObject = 0,
|
||||||
const Draw &mode = Draw::Calculation);
|
const Draw &mode = Draw::Calculation);
|
||||||
virtual ~VPointF() Q_DECL_OVERRIDE;
|
virtual ~VPointF() Q_DECL_OVERRIDE;
|
||||||
VPointF &operator=(const VPointF &point);
|
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 Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix = QString()) const;
|
||||||
VPointF Flip(const QLineF &axis, 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;
|
VPointF Move(qreal length, qreal angle, const QString &prefix = QString()) const;
|
||||||
|
|
|
@ -116,8 +116,8 @@ VSpline VSpline::Rotate(const QPointF &originPoint, qreal degrees, const QString
|
||||||
const VPointF p1 = GetP1().Rotate(originPoint, degrees);
|
const VPointF p1 = GetP1().Rotate(originPoint, degrees);
|
||||||
const VPointF p4 = GetP4().Rotate(originPoint, degrees);
|
const VPointF p4 = GetP4().Rotate(originPoint, degrees);
|
||||||
|
|
||||||
const QPointF p2 = VPointF::RotatePF(originPoint, GetP2(), degrees);
|
const QPointF p2 = VPointF::RotatePF(originPoint, static_cast<QPointF>(GetP2()), degrees);
|
||||||
const QPointF p3 = VPointF::RotatePF(originPoint, GetP3(), degrees);
|
const QPointF p3 = VPointF::RotatePF(originPoint, static_cast<QPointF>(GetP3()), degrees);
|
||||||
|
|
||||||
VSpline spl(p1, p2, p3, p4);
|
VSpline spl(p1, p2, p3, p4);
|
||||||
spl.setName(name() + prefix);
|
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 p1 = GetP1().Flip(axis);
|
||||||
const VPointF p4 = GetP4().Flip(axis);
|
const VPointF p4 = GetP4().Flip(axis);
|
||||||
|
|
||||||
const QPointF p2 = VPointF::FlipPF(axis, GetP2());
|
const QPointF p2 = VPointF::FlipPF(axis, static_cast<QPointF>(GetP2()));
|
||||||
const QPointF p3 = VPointF::FlipPF(axis, GetP3());
|
const QPointF p3 = VPointF::FlipPF(axis, static_cast<QPointF>(GetP3()));
|
||||||
|
|
||||||
VSpline spl(p1, p2, p3, p4);
|
VSpline spl(p1, p2, p3, p4);
|
||||||
spl.setName(name() + prefix);
|
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 p1 = GetP1().Move(length, angle);
|
||||||
const VPointF p4 = GetP4().Move(length, angle);
|
const VPointF p4 = GetP4().Move(length, angle);
|
||||||
|
|
||||||
const QPointF p2 = VPointF::MovePF(GetP2(), length, angle);
|
const QPointF p2 = VPointF::MovePF(static_cast<QPointF>(GetP2()), length, angle);
|
||||||
const QPointF p3 = VPointF::MovePF(GetP3(), length, angle);
|
const QPointF p3 = VPointF::MovePF(static_cast<QPointF>(GetP3()), length, angle);
|
||||||
|
|
||||||
VSpline spl(p1, p2, p3, p4);
|
VSpline spl(p1, p2, p3, p4);
|
||||||
spl.setName(name() + prefix);
|
spl.setName(name() + prefix);
|
||||||
|
@ -163,7 +163,8 @@ VSpline::~VSpline()
|
||||||
*/
|
*/
|
||||||
qreal VSpline::GetLength () const
|
qreal VSpline::GetLength () const
|
||||||
{
|
{
|
||||||
return LengthBezier ( GetP1(), GetP2(), GetP3(), GetP4());
|
return LengthBezier ( static_cast<QPointF>(GetP1()), static_cast<QPointF>(GetP2()), static_cast<QPointF>(GetP3()),
|
||||||
|
static_cast<QPointF>(GetP4()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -175,8 +176,8 @@ QPointF VSpline::CutSpline(qreal length, VSpline &spl1, VSpline &spl2) const
|
||||||
QPointF spl2p3;
|
QPointF spl2p3;
|
||||||
const QPointF cutPoint = CutSpline (length, spl1p2, spl1p3, spl2p2, spl2p3 );
|
const QPointF cutPoint = CutSpline (length, spl1p2, spl1p3, spl2p2, spl2p3 );
|
||||||
|
|
||||||
spl1 = VSpline(GetP1(), spl1p2, spl1p3, cutPoint);
|
spl1 = VSpline(GetP1(), spl1p2, spl1p3, VPointF(cutPoint));
|
||||||
spl2 = VSpline(cutPoint, spl2p2, spl2p3, GetP4());
|
spl2 = VSpline(VPointF(cutPoint), spl2p2, spl2p3, GetP4());
|
||||||
return cutPoint;
|
return cutPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +188,8 @@ QPointF VSpline::CutSpline(qreal length, VSpline &spl1, VSpline &spl2) const
|
||||||
*/
|
*/
|
||||||
QVector<QPointF> VSpline::GetPoints () const
|
QVector<QPointF> VSpline::GetPoints () const
|
||||||
{
|
{
|
||||||
return GetCubicBezierPoints(GetP1(), GetP2(), GetP3(), GetP4());
|
return GetCubicBezierPoints(static_cast<QPointF>(GetP1()), static_cast<QPointF>(GetP2()),
|
||||||
|
static_cast<QPointF>(GetP3()), static_cast<QPointF>(GetP4()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -379,8 +381,8 @@ void VSpline::SetC2Length(qreal length, const QString &formula)
|
||||||
*/
|
*/
|
||||||
qreal VSpline::GetKasm1() const
|
qreal VSpline::GetKasm1() const
|
||||||
{
|
{
|
||||||
return QLineF(d->p1, GetP2()).length() / VSplineData::GetL(d->p1, d->p4,
|
return QLineF(static_cast<QPointF>(d->p1), static_cast<QPointF>(GetP2())).length() /
|
||||||
d->kCurve);
|
VSplineData::GetL(static_cast<QPointF>(d->p1), static_cast<QPointF>(d->p4), d->kCurve);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -390,8 +392,8 @@ qreal VSpline::GetKasm1() const
|
||||||
*/
|
*/
|
||||||
qreal VSpline::GetKasm2() const
|
qreal VSpline::GetKasm2() const
|
||||||
{
|
{
|
||||||
return QLineF(d->p4, GetP3()).length() / VSplineData::GetL(d->p1, d->p4,
|
return QLineF(static_cast<QPointF>(d->p4), static_cast<QPointF>(GetP3())).length() /
|
||||||
d->kCurve);
|
VSplineData::GetL(static_cast<QPointF>(d->p1), static_cast<QPointF>(d->p4), d->kCurve);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -516,10 +518,10 @@ qreal VSpline::ParamT (const QPointF &pBt) const
|
||||||
for (int i=0; i< ts.size(); ++i)
|
for (int i=0; i< ts.size(); ++i)
|
||||||
{
|
{
|
||||||
const qreal t = ts.at(i);
|
const qreal t = ts.at(i);
|
||||||
const QPointF p0 = GetP1();
|
const QPointF p0 = static_cast<QPointF>(GetP1());
|
||||||
const QPointF p1 = GetP2();
|
const QPointF p1 = static_cast<QPointF>(GetP2());
|
||||||
const QPointF p2 = GetP3();
|
const QPointF p2 = static_cast<QPointF>(GetP3());
|
||||||
const QPointF p3 = GetP4();
|
const QPointF p3 = static_cast<QPointF>(GetP4());
|
||||||
//The explicit form of the Cubic Bézier curve
|
//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 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();
|
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
|
QPointF VSpline::GetControlPoint1() const
|
||||||
{
|
{
|
||||||
return GetP2 ();
|
return static_cast<QPointF>(GetP2 ());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPointF VSpline::GetControlPoint2() const
|
QPointF VSpline::GetControlPoint2() const
|
||||||
{
|
{
|
||||||
return GetP3 ();
|
return static_cast<QPointF>(GetP3 ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qre
|
||||||
c2LengthF("0"),
|
c2LengthF("0"),
|
||||||
kCurve(kCurve)
|
kCurve(kCurve)
|
||||||
{
|
{
|
||||||
const qreal L = GetL(p1, p4, kCurve);
|
const qreal L = GetL(static_cast<QPointF>(p1), static_cast<QPointF>(p4), kCurve);
|
||||||
|
|
||||||
QLineF p1p2(p1.x(), p1.y(), p1.x() + L * kAsm1, p1.y());
|
QLineF p1p2(p1.x(), p1.y(), p1.x() + L * kAsm1, p1.y());
|
||||||
p1p2.setAngle(angle1);
|
p1p2.setAngle(angle1);
|
||||||
|
@ -161,7 +161,7 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4)
|
||||||
c2LengthF("0"),
|
c2LengthF("0"),
|
||||||
kCurve(1)
|
kCurve(1)
|
||||||
{
|
{
|
||||||
QLineF p1p2(p1, p2);
|
QLineF p1p2(static_cast<QPointF>(p1), static_cast<QPointF>(p2));
|
||||||
|
|
||||||
angle1 = p1p2.angle();
|
angle1 = p1p2.angle();
|
||||||
angle1F = QString().number(angle1);
|
angle1F = QString().number(angle1);
|
||||||
|
@ -169,7 +169,7 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4)
|
||||||
c1Length = p1p2.length();
|
c1Length = p1p2.length();
|
||||||
c1LengthF = QString().number(qApp->fromPixel(c1Length));
|
c1LengthF = QString().number(qApp->fromPixel(c1Length));
|
||||||
|
|
||||||
QLineF p4p3(p4, p3);
|
QLineF p4p3(static_cast<QPointF>(p4), static_cast<QPointF>(p3));
|
||||||
|
|
||||||
angle2 = p4p3.angle();
|
angle2 = p4p3.angle();
|
||||||
angle2F = QString().number(angle2);
|
angle2F = QString().number(angle2);
|
||||||
|
|
|
@ -177,7 +177,7 @@ VSplinePath::~VSplinePath()
|
||||||
*/
|
*/
|
||||||
void VSplinePath::append(const VSplinePoint &point)
|
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<QPointF>(d->path.last().P()) == static_cast<QPointF>(point.P())) //-V807
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,8 @@ bool FindLabelGeometry(const VPatternLabelData &labelData, const VContainer *pat
|
||||||
const auto topLeftPinPoint = pattern->GeometricObject<VPointF>(topLeftPin);
|
const auto topLeftPinPoint = pattern->GeometricObject<VPointF>(topLeftPin);
|
||||||
const auto bottomRightPinPoint = pattern->GeometricObject<VPointF>(bottomRightPin);
|
const auto bottomRightPinPoint = pattern->GeometricObject<VPointF>(bottomRightPin);
|
||||||
|
|
||||||
const QRectF labelRect = QRectF(*topLeftPinPoint, *bottomRightPinPoint);
|
const QRectF labelRect = QRectF(static_cast<QPointF>(*topLeftPinPoint),
|
||||||
|
static_cast<QPointF>(*bottomRightPinPoint));
|
||||||
labelWidth = qAbs(labelRect.width());
|
labelWidth = qAbs(labelRect.width());
|
||||||
labelHeight = qAbs(labelRect.height());
|
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 lWidth = ToPixel(labelWidth, *pattern->GetPatternUnit());
|
||||||
const qreal lHeight = ToPixel(labelHeight, *pattern->GetPatternUnit());
|
const qreal lHeight = ToPixel(labelHeight, *pattern->GetPatternUnit());
|
||||||
|
|
||||||
pos = *centerPinPoint - QRectF(0, 0, lWidth, lHeight).center();
|
pos = static_cast<QPointF>(*centerPinPoint) - QRectF(0, 0, lWidth, lHeight).center();
|
||||||
}
|
}
|
||||||
catch(const VExceptionBadId &)
|
catch(const VExceptionBadId &)
|
||||||
{
|
{
|
||||||
|
@ -170,7 +171,7 @@ bool FindGrainlineGeometry(const VGrainlineData& geom, const VContainer *pattern
|
||||||
const auto topPinPoint = pattern->GeometricObject<VPointF>(topPin);
|
const auto topPinPoint = pattern->GeometricObject<VPointF>(topPin);
|
||||||
const auto bottomPinPoint = pattern->GeometricObject<VPointF>(bottomPin);
|
const auto bottomPinPoint = pattern->GeometricObject<VPointF>(bottomPin);
|
||||||
|
|
||||||
QLineF grainline(*bottomPinPoint, *topPinPoint);
|
QLineF grainline(static_cast<QPointF>(*bottomPinPoint), static_cast<QPointF>(*topPinPoint));
|
||||||
length = grainline.length();
|
length = grainline.length();
|
||||||
rotationAngle = grainline.angle();
|
rotationAngle = grainline.angle();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class QMarginsF
|
||||||
public:
|
public:
|
||||||
Q_DECL_CONSTEXPR QMarginsF() Q_DECL_NOTHROW;
|
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(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;
|
Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,8 @@ void VLineAngle::SetValue(const VPointF *p1, const VPointF *p2)
|
||||||
SCASSERT(p1 != nullptr)
|
SCASSERT(p1 != nullptr)
|
||||||
SCASSERT(p2 != nullptr)
|
SCASSERT(p2 != nullptr)
|
||||||
//Correct angle. Try avoid results like 6,7563e-15.
|
//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<QPointF>(*p1),
|
||||||
|
static_cast<QPointF>(*p2)).angle() * 100000.) / 100000.;
|
||||||
VInternalVariable::SetValue(angle);
|
VInternalVariable::SetValue(angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,8 @@ void VLengthLine::SetValue(const VPointF *p1, const VPointF *p2)
|
||||||
SCASSERT(p1 != nullptr)
|
SCASSERT(p1 != nullptr)
|
||||||
SCASSERT(p2 != nullptr)
|
SCASSERT(p2 != nullptr)
|
||||||
|
|
||||||
VInternalVariable::SetValue(FromPixel(QLineF(*p1, *p2).length(), d->patternUnit));
|
VInternalVariable::SetValue(FromPixel(QLineF(static_cast<QPointF>(*p1), static_cast<QPointF>(*p2)).length(),
|
||||||
|
d->patternUnit));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -42,7 +42,7 @@ VSAPoint CurvePoint(VSAPoint candidate, const VContainer *data, const VPieceNode
|
||||||
{
|
{
|
||||||
if (node.GetTypeTool() == Tool::NodePoint)
|
if (node.GetTypeTool() == Tool::NodePoint)
|
||||||
{
|
{
|
||||||
const QPointF p = *data->GeometricObject<VPointF>(node.GetId());
|
const QPointF p = static_cast<QPointF>(*data->GeometricObject<VPointF>(node.GetId()));
|
||||||
if (VAbstractCurve::IsPointOnCurve(curvePoints, p))
|
if (VAbstractCurve::IsPointOnCurve(curvePoints, p))
|
||||||
{
|
{
|
||||||
candidate = VSAPoint(p);
|
candidate = VSAPoint(p);
|
||||||
|
@ -253,7 +253,7 @@ QVector<QPointF> VPiecePath::PathPoints(const VContainer *data) const
|
||||||
case (Tool::NodePoint):
|
case (Tool::NodePoint):
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(at(i).GetId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(at(i).GetId());
|
||||||
points.append(*point);
|
points.append(static_cast<QPointF>(*point));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
|
@ -681,7 +681,7 @@ QPointF VPiecePath::NodePreviousPoint(const VContainer *data, int i) const
|
||||||
switch (node.GetTypeTool())
|
switch (node.GetTypeTool())
|
||||||
{
|
{
|
||||||
case (Tool::NodePoint):
|
case (Tool::NodePoint):
|
||||||
return *data->GeometricObject<VPointF>(node.GetId());
|
return static_cast<QPointF>(*data->GeometricObject<VPointF>(node.GetId()));
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
case (Tool::NodeElArc):
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
|
@ -733,7 +733,7 @@ QPointF VPiecePath::NodeNextPoint(const VContainer *data, int i) const
|
||||||
switch (node.GetTypeTool())
|
switch (node.GetTypeTool())
|
||||||
{
|
{
|
||||||
case (Tool::NodePoint):
|
case (Tool::NodePoint):
|
||||||
return *data->GeometricObject<VPointF>(node.GetId());
|
return static_cast<QPointF>(*data->GeometricObject<VPointF>(node.GetId()));
|
||||||
case (Tool::NodeArc):
|
case (Tool::NodeArc):
|
||||||
case (Tool::NodeElArc):
|
case (Tool::NodeElArc):
|
||||||
case (Tool::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
|
|
|
@ -206,7 +206,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
||||||
QLineF line = QLineF(*point, scene->getScenePos());
|
QLineF line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
||||||
|
|
|
@ -315,7 +315,7 @@ void DialogEndLine::ShowDialog(bool click)
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
||||||
QLineF line = QLineF(*point, scene->getScenePos());
|
QLineF line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
const qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
const qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
||||||
|
|
|
@ -259,12 +259,12 @@ void DialogHeight::PointNameChanged()
|
||||||
set.insert(p1LineId);
|
set.insert(p1LineId);
|
||||||
set.insert(p2LineId);
|
set.insert(p2LineId);
|
||||||
|
|
||||||
const QSharedPointer<VPointF> basePoint = data->GeometricObject<VPointF>(basePointId);
|
const QPointF basePoint = static_cast<QPointF>(*data->GeometricObject<VPointF>(basePointId));
|
||||||
const QSharedPointer<VPointF> p1Line = data->GeometricObject<VPointF>(p1LineId);
|
const QPointF p1Line = static_cast<QPointF>(*data->GeometricObject<VPointF>(p1LineId));
|
||||||
const QSharedPointer<VPointF> p2Line = data->GeometricObject<VPointF>(p2LineId);
|
const QPointF p2Line = static_cast<QPointF>(*data->GeometricObject<VPointF>(p2LineId));
|
||||||
|
|
||||||
QColor color = okColor;
|
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;
|
flagError = false;
|
||||||
color = errorColor;
|
color = errorColor;
|
||||||
|
|
|
@ -230,8 +230,8 @@ void DialogLineIntersect::PointNameChanged()
|
||||||
const QSharedPointer<VPointF> p1Line2 = data->GeometricObject<VPointF>(p1Line2Id);
|
const QSharedPointer<VPointF> p1Line2 = data->GeometricObject<VPointF>(p1Line2Id);
|
||||||
const QSharedPointer<VPointF> p2Line2 = data->GeometricObject<VPointF>(p2Line2Id);
|
const QSharedPointer<VPointF> p2Line2 = data->GeometricObject<VPointF>(p2Line2Id);
|
||||||
|
|
||||||
QLineF line1(*p1Line1, *p2Line1);
|
QLineF line1(static_cast<QPointF>(*p1Line1), static_cast<QPointF>(*p2Line1));
|
||||||
QLineF line2(*p1Line2, *p2Line2);
|
QLineF line2(static_cast<QPointF>(*p1Line2), static_cast<QPointF>(*p2Line2));
|
||||||
QPointF fPoint;
|
QPointF fPoint;
|
||||||
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
||||||
|
|
||||||
|
@ -281,8 +281,8 @@ bool DialogLineIntersect::CheckIntersecion()
|
||||||
const QSharedPointer<VPointF> p1L2 = data->GeometricObject<VPointF>(GetP1Line2());
|
const QSharedPointer<VPointF> p1L2 = data->GeometricObject<VPointF>(GetP1Line2());
|
||||||
const QSharedPointer<VPointF> p2L2 = data->GeometricObject<VPointF>(GetP2Line2());
|
const QSharedPointer<VPointF> p2L2 = data->GeometricObject<VPointF>(GetP2Line2());
|
||||||
|
|
||||||
QLineF line1(*p1L1, *p2L1);
|
QLineF line1(static_cast<QPointF>(*p1L1), static_cast<QPointF>(*p2L1));
|
||||||
QLineF line2(*p1L2, *p2L2);
|
QLineF line2(static_cast<QPointF>(*p1L2), static_cast<QPointF>(*p2L2));
|
||||||
QPointF fPoint;
|
QPointF fPoint;
|
||||||
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
||||||
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
||||||
|
|
|
@ -235,7 +235,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
||||||
QLineF line = QLineF(*point, scene->getScenePos());
|
QLineF line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
||||||
|
|
|
@ -213,7 +213,7 @@ void DialogRotation::ShowDialog(bool click)
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetOrigPointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetOrigPointId());
|
||||||
const QLineF line = QLineF(*point, scene->getScenePos());
|
const QLineF line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
const qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
const qreal radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm)*1.5;
|
||||||
|
|
|
@ -110,7 +110,7 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(const quint32 _id, quint32 orig
|
||||||
const Source &typeCreation)
|
const Source &typeCreation)
|
||||||
{
|
{
|
||||||
const auto originPoint = *data->GeometricObject<VPointF>(originPointId);
|
const auto originPoint = *data->GeometricObject<VPointF>(originPointId);
|
||||||
const QPointF fPoint = originPoint;
|
const QPointF fPoint = static_cast<QPointF>(originPoint);
|
||||||
|
|
||||||
QPointF sPoint;
|
QPointF sPoint;
|
||||||
if (axisType == AxisType::VerticalAxis)
|
if (axisType == AxisType::VerticalAxis)
|
||||||
|
|
|
@ -111,10 +111,10 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const quint32 _id, quint32 firs
|
||||||
const Source &typeCreation)
|
const Source &typeCreation)
|
||||||
{
|
{
|
||||||
const auto firstPoint = *data->GeometricObject<VPointF>(firstLinePointId);
|
const auto firstPoint = *data->GeometricObject<VPointF>(firstLinePointId);
|
||||||
const QPointF fPoint = firstPoint;
|
const QPointF fPoint = static_cast<QPointF>(firstPoint);
|
||||||
|
|
||||||
const auto secondPoint = *data->GeometricObject<VPointF>(secondLinePointId);
|
const auto secondPoint = *data->GeometricObject<VPointF>(secondLinePointId);
|
||||||
const QPointF sPoint = secondPoint;
|
const QPointF sPoint = static_cast<QPointF>(secondPoint);
|
||||||
|
|
||||||
QVector<DestinationItem> dest = destination;
|
QVector<DestinationItem> dest = destination;
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ VToolRotation *VToolRotation::Create(const quint32 _id, const quint32 &origin, Q
|
||||||
calcAngle = CheckFormula(_id, angle, data);
|
calcAngle = CheckFormula(_id, angle, data);
|
||||||
|
|
||||||
const auto originPoint = *data->GeometricObject<VPointF>(origin);
|
const auto originPoint = *data->GeometricObject<VPointF>(origin);
|
||||||
const QPointF oPoint = originPoint;
|
const QPointF oPoint = static_cast<QPointF>(originPoint);
|
||||||
|
|
||||||
QVector<DestinationItem> dest = destination;
|
QVector<DestinationItem> dest = destination;
|
||||||
|
|
||||||
|
|
|
@ -282,7 +282,7 @@ VSpline VAbstractSpline::CorrectedSpline(const VSpline &spline, const SplinePoin
|
||||||
VSpline spl;
|
VSpline spl;
|
||||||
if (position == SplinePointPosition::FirstPoint)
|
if (position == SplinePointPosition::FirstPoint)
|
||||||
{
|
{
|
||||||
QLineF line(spline.GetP1(), pos);
|
QLineF line(static_cast<QPointF>(spline.GetP1()), pos);
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
line.setAngle(VisLine::CorrectAngle(line.angle()));
|
line.setAngle(VisLine::CorrectAngle(line.angle()));
|
||||||
|
@ -312,7 +312,7 @@ VSpline VAbstractSpline::CorrectedSpline(const VSpline &spline, const SplinePoin
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QLineF line(spline.GetP4(), pos);
|
QLineF line(static_cast<QPointF>(spline.GetP4()), pos);
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
line.setAngle(VisLine::CorrectAngle(line.angle()));
|
line.setAngle(VisLine::CorrectAngle(line.angle()));
|
||||||
|
|
|
@ -97,9 +97,10 @@ VToolSpline::VToolSpline(VAbstractPattern *doc, VContainer *data, quint32 id, co
|
||||||
const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl->GetStartAngleFormula());
|
const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl->GetStartAngleFormula());
|
||||||
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl->GetC1LengthFormula());
|
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl->GetC1LengthFormula());
|
||||||
|
|
||||||
auto *controlPoint1 = new VControlPointSpline(1, SplinePointPosition::FirstPoint, spl->GetP2(),
|
auto *controlPoint1 = new VControlPointSpline(1, SplinePointPosition::FirstPoint,
|
||||||
spl->GetP1(), *data->GetPatternUnit(), freeAngle1,
|
static_cast<QPointF>(spl->GetP2()),
|
||||||
freeLength1, this);
|
static_cast<QPointF>(spl->GetP1()), *data->GetPatternUnit(),
|
||||||
|
freeAngle1, freeLength1, this);
|
||||||
connect(controlPoint1, &VControlPointSpline::ControlPointChangePosition, this,
|
connect(controlPoint1, &VControlPointSpline::ControlPointChangePosition, this,
|
||||||
&VToolSpline::ControlPointChangePosition);
|
&VToolSpline::ControlPointChangePosition);
|
||||||
connect(this, &VToolSpline::setEnabledPoint, controlPoint1, &VControlPointSpline::setEnabledPoint);
|
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 freeAngle2 = qmu::QmuTokenParser::IsSingle(spl->GetEndAngleFormula());
|
||||||
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl->GetC2LengthFormula());
|
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl->GetC2LengthFormula());
|
||||||
|
|
||||||
auto *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, spl->GetP3(),
|
auto *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint,
|
||||||
spl->GetP4(), *data->GetPatternUnit(), freeAngle2,
|
static_cast<QPointF>(spl->GetP3()),
|
||||||
freeLength2, this);
|
static_cast<QPointF>(spl->GetP4()), *data->GetPatternUnit(),
|
||||||
|
freeAngle2, freeLength2, this);
|
||||||
connect(controlPoint2, &VControlPointSpline::ControlPointChangePosition, this,
|
connect(controlPoint2, &VControlPointSpline::ControlPointChangePosition, this,
|
||||||
&VToolSpline::ControlPointChangePosition);
|
&VToolSpline::ControlPointChangePosition);
|
||||||
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
||||||
|
@ -332,8 +334,8 @@ void VToolSpline::SaveDialog(QDomElement &domElement)
|
||||||
controlPoints[0]->blockSignals(true);
|
controlPoints[0]->blockSignals(true);
|
||||||
controlPoints[1]->blockSignals(true);
|
controlPoints[1]->blockSignals(true);
|
||||||
|
|
||||||
controlPoints[0]->setPos(spl.GetP2());
|
controlPoints[0]->setPos(static_cast<QPointF>(spl.GetP2()));
|
||||||
controlPoints[1]->setPos(spl.GetP3());
|
controlPoints[1]->setPos(static_cast<QPointF>(spl.GetP3()));
|
||||||
|
|
||||||
controlPoints[0]->blockSignals(false);
|
controlPoints[0]->blockSignals(false);
|
||||||
controlPoints[1]->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 offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta;
|
||||||
const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta;
|
const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta;
|
||||||
|
|
||||||
const QPointF p2 = spline->GetP2() + offset0;
|
const QPointF p2 = static_cast<QPointF>(spline->GetP2()) + offset0;
|
||||||
const QPointF p3 = spline->GetP3() + offset1;
|
const QPointF p3 = static_cast<QPointF>(spline->GetP3()) + offset1;
|
||||||
|
|
||||||
oldPosition = event->scenePos(); // Now mouse here
|
oldPosition = event->scenePos(); // Now mouse here
|
||||||
|
|
||||||
|
@ -557,18 +559,20 @@ void VToolSpline::RefreshGeometry()
|
||||||
const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl->GetStartAngleFormula());
|
const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl->GetStartAngleFormula());
|
||||||
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl->GetC1LengthFormula());
|
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl->GetC1LengthFormula());
|
||||||
|
|
||||||
const QPointF splinePoint = *VAbstractTool::data.GeometricObject<VPointF>(spl->GetP1().id());
|
const QPointF splinePoint =
|
||||||
controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, spl->GetP2(), splinePoint, freeAngle1,
|
static_cast<QPointF>(*VAbstractTool::data.GeometricObject<VPointF>(spl->GetP1().id()));
|
||||||
freeLength1);
|
controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, static_cast<QPointF>(spl->GetP2()),
|
||||||
|
static_cast<QPointF>(splinePoint), freeAngle1, freeLength1);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const bool freeAngle2 = qmu::QmuTokenParser::IsSingle(spl->GetEndAngleFormula());
|
const bool freeAngle2 = qmu::QmuTokenParser::IsSingle(spl->GetEndAngleFormula());
|
||||||
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl->GetC2LengthFormula());
|
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl->GetC2LengthFormula());
|
||||||
|
|
||||||
const QPointF splinePoint = *VAbstractTool::data.GeometricObject<VPointF>(spl->GetP4().id());
|
const QPointF splinePoint =
|
||||||
controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, spl->GetP3(), splinePoint, freeAngle2,
|
static_cast<QPointF>(*VAbstractTool::data.GeometricObject<VPointF>(spl->GetP4().id()));
|
||||||
freeLength2);
|
controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, static_cast<QPointF>(spl->GetP3()),
|
||||||
|
static_cast<QPointF>(splinePoint), freeAngle2, freeLength2);
|
||||||
}
|
}
|
||||||
|
|
||||||
controlPoints[0]->blockSignals(false);
|
controlPoints[0]->blockSignals(false);
|
||||||
|
|
|
@ -107,9 +107,10 @@ VToolSplinePath::VToolSplinePath(VAbstractPattern *doc, VContainer *data, quint3
|
||||||
const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl.GetStartAngleFormula());
|
const bool freeAngle1 = qmu::QmuTokenParser::IsSingle(spl.GetStartAngleFormula());
|
||||||
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl.GetC1LengthFormula());
|
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl.GetC1LengthFormula());
|
||||||
|
|
||||||
auto *controlPoint = new VControlPointSpline(i, SplinePointPosition::FirstPoint, spl.GetP2(),
|
auto *controlPoint = new VControlPointSpline(i, SplinePointPosition::FirstPoint,
|
||||||
spl.GetP1(), *data->GetPatternUnit(), freeAngle1,
|
static_cast<QPointF>(spl.GetP2()),
|
||||||
freeLength1, this);
|
static_cast<QPointF>(spl.GetP1()), *data->GetPatternUnit(),
|
||||||
|
freeAngle1, freeLength1, this);
|
||||||
connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this,
|
connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this,
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
&VToolSplinePath::ControlPointChangePosition);
|
||||||
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
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 freeAngle2 = qmu::QmuTokenParser::IsSingle(spl.GetEndAngleFormula());
|
||||||
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl.GetC2LengthFormula());
|
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl.GetC2LengthFormula());
|
||||||
|
|
||||||
controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, spl.GetP3(), spl.GetP4(),
|
controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, static_cast<QPointF>(spl.GetP3()),
|
||||||
*data->GetPatternUnit(), freeAngle2, freeLength2, this);
|
static_cast<QPointF>(spl.GetP4()), *data->GetPatternUnit(), freeAngle2,
|
||||||
|
freeLength2, this);
|
||||||
connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this,
|
connect(controlPoint, &VControlPointSpline::ControlPointChangePosition, this,
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
&VToolSplinePath::ControlPointChangePosition);
|
||||||
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
||||||
|
@ -451,8 +453,8 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement)
|
||||||
controlPoints[j-2]->blockSignals(true);
|
controlPoints[j-2]->blockSignals(true);
|
||||||
controlPoints[j-1]->blockSignals(true);
|
controlPoints[j-1]->blockSignals(true);
|
||||||
|
|
||||||
controlPoints[j-2]->setPos(spl.GetP2());
|
controlPoints[j-2]->setPos(static_cast<QPointF>(spl.GetP2()));
|
||||||
controlPoints[j-1]->setPos(spl.GetP3());
|
controlPoints[j-1]->setPos(static_cast<QPointF>(spl.GetP3()));
|
||||||
|
|
||||||
controlPoints[j-2]->blockSignals(false);
|
controlPoints[j-2]->blockSignals(false);
|
||||||
controlPoints[j-1]->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 offset0 = ((1-weight)/(3*t*(1-t)*(1-t))) * delta;
|
||||||
const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta;
|
const QPointF offset1 = (weight/(3*t*t*(1-t))) * delta;
|
||||||
|
|
||||||
const QPointF p2 = spline.GetP2() + offset0;
|
const QPointF p2 = static_cast<QPointF>(spline.GetP2()) + offset0;
|
||||||
const QPointF p3 = spline.GetP3() + offset1;
|
const QPointF p3 = static_cast<QPointF>(spline.GetP3()) + offset1;
|
||||||
|
|
||||||
oldPosition = event->scenePos(); // Now mouse here
|
oldPosition = event->scenePos(); // Now mouse here
|
||||||
|
|
||||||
|
@ -691,8 +693,8 @@ void VToolSplinePath::RefreshGeometry()
|
||||||
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl.GetC1LengthFormula());
|
const bool freeLength1 = qmu::QmuTokenParser::IsSingle(spl.GetC1LengthFormula());
|
||||||
|
|
||||||
const auto splinePoint = spl.GetP1();
|
const auto splinePoint = spl.GetP1();
|
||||||
controlPoints[j-2]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, spl.GetP2(), splinePoint,
|
controlPoints[j-2]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, static_cast<QPointF>(spl.GetP2()),
|
||||||
freeAngle1, freeLength1);
|
static_cast<QPointF>(splinePoint), freeAngle1, freeLength1);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -700,8 +702,8 @@ void VToolSplinePath::RefreshGeometry()
|
||||||
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl.GetC2LengthFormula());
|
const bool freeLength2 = qmu::QmuTokenParser::IsSingle(spl.GetC2LengthFormula());
|
||||||
|
|
||||||
const auto splinePoint = spl.GetP4();
|
const auto splinePoint = spl.GetP4();
|
||||||
controlPoints[j-1]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, spl.GetP3(), splinePoint,
|
controlPoints[j-1]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, static_cast<QPointF>(spl.GetP3()),
|
||||||
freeAngle2, freeLength2);
|
static_cast<QPointF>(splinePoint), freeAngle2, freeLength2);
|
||||||
}
|
}
|
||||||
|
|
||||||
controlPoints[j-2]->blockSignals(false);
|
controlPoints[j-2]->blockSignals(false);
|
||||||
|
|
|
@ -167,7 +167,9 @@ VToolTrueDarts *VToolTrueDarts::Create(quint32 _id,
|
||||||
|
|
||||||
QPointF fPoint1;
|
QPointF fPoint1;
|
||||||
QPointF fPoint2;
|
QPointF fPoint2;
|
||||||
VToolTrueDarts::FindPoint(*baseLineP1, *baseLineP2, *dartP1, *dartP2, *dartP3, fPoint1, fPoint2);
|
VToolTrueDarts::FindPoint(static_cast<QPointF>(*baseLineP1), static_cast<QPointF>(*baseLineP2),
|
||||||
|
static_cast<QPointF>(*dartP1), static_cast<QPointF>(*dartP2),
|
||||||
|
static_cast<QPointF>(*dartP3), fPoint1, fPoint2);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
quint32 p1id = _p1id;
|
quint32 p1id = _p1id;
|
||||||
quint32 p2id = _p2id;
|
quint32 p2id = _p2id;
|
||||||
|
|
|
@ -270,7 +270,7 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(firstPointId);
|
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(firstPointId);
|
||||||
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(secondPointId);
|
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(secondPointId);
|
||||||
QLineF line = QLineF(*firstPoint, *secondPoint);
|
QLineF line = QLineF(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint));
|
||||||
|
|
||||||
//Declare special variable "CurrentLength"
|
//Declare special variable "CurrentLength"
|
||||||
VLengthLine *length = new VLengthLine(firstPoint.data(), firstPointId, secondPoint.data(),
|
VLengthLine *length = new VLengthLine(firstPoint.data(), firstPointId, secondPoint.data(),
|
||||||
|
|
|
@ -195,7 +195,8 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const
|
||||||
|
|
||||||
const qreal result = CheckFormula(_id, formula, data);
|
const qreal result = CheckFormula(_id, formula, data);
|
||||||
|
|
||||||
QPointF fPoint = VToolBisector::FindPoint(*firstPoint, *secondPoint, *thirdPoint, qApp->toPixel(result));
|
QPointF fPoint = VToolBisector::FindPoint(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint),
|
||||||
|
static_cast<QPointF>(*thirdPoint), qApp->toPixel(result));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,7 +139,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons
|
||||||
const qreal angle = CheckFormula(_id, formulaAngle, data);
|
const qreal angle = CheckFormula(_id, formulaAngle, data);
|
||||||
const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(curveId);
|
const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(curveId);
|
||||||
|
|
||||||
const QPointF fPoint = FindPoint(*basePoint, angle, curve);
|
const QPointF fPoint = FindPoint(static_cast<QPointF>(*basePoint), angle, curve);
|
||||||
const qreal segLength = curve->GetLengthByPoint(fPoint);
|
const qreal segLength = curve->GetLengthByPoint(fPoint);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
VPointF *p = new VPointF(fPoint, pointName, mx, my);
|
VPointF *p = new VPointF(fPoint, pointName, mx, my);
|
||||||
|
|
|
@ -159,7 +159,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName,
|
||||||
const Source &typeCreation)
|
const Source &typeCreation)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> basePoint = data->GeometricObject<VPointF>(basePointId);
|
const QSharedPointer<VPointF> basePoint = data->GeometricObject<VPointF>(basePointId);
|
||||||
QLineF line = QLineF(*basePoint, QPointF(basePoint->x()+100, basePoint->y()));
|
QLineF line = QLineF(static_cast<QPointF>(*basePoint), QPointF(basePoint->x()+100, basePoint->y()));
|
||||||
|
|
||||||
line.setAngle(CheckFormula(_id, formulaAngle, data)); //First set angle.
|
line.setAngle(CheckFormula(_id, formulaAngle, data)); //First set angle.
|
||||||
line.setLength(qApp->toPixel(CheckFormula(_id, formulaLength, data)));
|
line.setLength(qApp->toPixel(CheckFormula(_id, formulaLength, data)));
|
||||||
|
|
|
@ -150,7 +150,8 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co
|
||||||
const QSharedPointer<VPointF> p1Line = data->GeometricObject<VPointF>(p1LineId);
|
const QSharedPointer<VPointF> p1Line = data->GeometricObject<VPointF>(p1LineId);
|
||||||
const QSharedPointer<VPointF> p2Line = data->GeometricObject<VPointF>(p2LineId);
|
const QSharedPointer<VPointF> p2Line = data->GeometricObject<VPointF>(p2LineId);
|
||||||
|
|
||||||
QPointF pHeight = FindPoint(QLineF(*p1Line, *p2Line), *basePoint);
|
QPointF pHeight = FindPoint(QLineF(static_cast<QPointF>(*p1Line), static_cast<QPointF>(*p2Line)),
|
||||||
|
static_cast<QPointF>(*basePoint));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,12 +124,12 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const
|
||||||
const Source &typeCreation)
|
const Source &typeCreation)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> basePoint = data->GeometricObject<VPointF>(basePointId);
|
const QSharedPointer<VPointF> basePoint = data->GeometricObject<VPointF>(basePointId);
|
||||||
QLineF axis = QLineF(*basePoint, QPointF(basePoint->x()+100, basePoint->y()));
|
QLineF axis = QLineF(static_cast<QPointF>(*basePoint), QPointF(basePoint->x()+100, basePoint->y()));
|
||||||
axis.setAngle(CheckFormula(_id, formulaAngle, data));
|
axis.setAngle(CheckFormula(_id, formulaAngle, data));
|
||||||
|
|
||||||
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(firstPointId);
|
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(firstPointId);
|
||||||
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(secondPointId);
|
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(secondPointId);
|
||||||
QLineF line(*firstPoint, *secondPoint);
|
QLineF line(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint));
|
||||||
|
|
||||||
QPointF fPoint = FindPoint(axis, line);
|
QPointF fPoint = FindPoint(axis, line);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
|
|
|
@ -72,8 +72,8 @@ VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const qu
|
||||||
{
|
{
|
||||||
this->typeLine = typeLine;
|
this->typeLine = typeLine;
|
||||||
Q_ASSERT_X(basePointId != 0, Q_FUNC_INFO, "basePointId == 0"); //-V654 //-V712
|
Q_ASSERT_X(basePointId != 0, Q_FUNC_INFO, "basePointId == 0"); //-V654 //-V712
|
||||||
QPointF point1 = *data->GeometricObject<VPointF>(basePointId);
|
QPointF point1 = static_cast<QPointF>(*data->GeometricObject<VPointF>(basePointId));
|
||||||
QPointF point2 = *data->GeometricObject<VPointF>(id);
|
QPointF point2 = static_cast<QPointF>(*data->GeometricObject<VPointF>(id));
|
||||||
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);
|
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);
|
||||||
mainLine->setPen(QPen(CorrectColor(lineColor),
|
mainLine->setPen(QPen(CorrectColor(lineColor),
|
||||||
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||||
|
@ -97,8 +97,8 @@ void VToolLinePoint::RefreshGeometry()
|
||||||
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||||
LineStyleToPenStyle(typeLine)));
|
LineStyleToPenStyle(typeLine)));
|
||||||
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||||
QPointF point = *VDrawTool::data.GeometricObject<VPointF>(id);
|
QPointF point = static_cast<QPointF>(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||||
QPointF basePoint = *VDrawTool::data.GeometricObject<VPointF>(basePointId);
|
QPointF basePoint = static_cast<QPointF>(*VDrawTool::data.GeometricObject<VPointF>(basePointId));
|
||||||
mainLine->setLine(QLineF(basePoint - point, QPointF()));
|
mainLine->setLine(QLineF(basePoint - point, QPointF()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,8 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin
|
||||||
|
|
||||||
const qreal result = CheckFormula(_id, formula, data);
|
const qreal result = CheckFormula(_id, formula, data);
|
||||||
|
|
||||||
QPointF fPoint = VToolNormal::FindPoint(*firstPoint, *secondPoint, qApp->toPixel(result), angle);
|
QPointF fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint),
|
||||||
|
qApp->toPixel(result), angle);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,7 +206,9 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu
|
||||||
|
|
||||||
const qreal result = CheckFormula(_id, formula, data);
|
const qreal result = CheckFormula(_id, formula, data);
|
||||||
|
|
||||||
QPointF fPoint = VToolShoulderPoint::FindPoint(*firstPoint, *secondPoint, *shoulderPoint, qApp->toPixel(result));
|
QPointF fPoint = VToolShoulderPoint::FindPoint(static_cast<QPointF>(*firstPoint),
|
||||||
|
static_cast<QPointF>(*secondPoint),
|
||||||
|
static_cast<QPointF>(*shoulderPoint), qApp->toPixel(result));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,7 @@ void VToolBasePoint::setDialog()
|
||||||
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetData(p->name(), *p);
|
dialogTool->SetData(p->name(), static_cast<QPointF>(*p));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -153,8 +153,8 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32
|
||||||
const QSharedPointer<VPointF> p1Line2 = data->GeometricObject<VPointF>(p1Line2Id);
|
const QSharedPointer<VPointF> p1Line2 = data->GeometricObject<VPointF>(p1Line2Id);
|
||||||
const QSharedPointer<VPointF> p2Line2 = data->GeometricObject<VPointF>(p2Line2Id);
|
const QSharedPointer<VPointF> p2Line2 = data->GeometricObject<VPointF>(p2Line2Id);
|
||||||
|
|
||||||
QLineF line1(*p1Line1, *p2Line1);
|
QLineF line1(static_cast<QPointF>(*p1Line1), static_cast<QPointF>(*p2Line1));
|
||||||
QLineF line2(*p1Line2, *p2Line2);
|
QLineF line2(static_cast<QPointF>(*p1Line2), static_cast<QPointF>(*p2Line2));
|
||||||
QPointF fPoint;
|
QPointF fPoint;
|
||||||
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
QLineF::IntersectType intersect = line1.intersect(line2, &fPoint);
|
||||||
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
||||||
|
|
|
@ -108,7 +108,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const quint32 _
|
||||||
const VArc arc = *data->GeometricObject<VArc>(arcId);
|
const VArc arc = *data->GeometricObject<VArc>(arcId);
|
||||||
const VPointF tPoint = *data->GeometricObject<VPointF>(tangentPointId);
|
const VPointF tPoint = *data->GeometricObject<VPointF>(tangentPointId);
|
||||||
|
|
||||||
const QPointF point = VToolPointFromArcAndTangent::FindPoint(tPoint, &arc, crossPoint);
|
const QPointF point = VToolPointFromArcAndTangent::FindPoint(static_cast<QPointF>(tPoint), &arc, crossPoint);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
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 VToolPointFromArcAndTangent::FindPoint(const QPointF &p, const VArc *arc, const CrossCirclesPoint pType)
|
||||||
{
|
{
|
||||||
QPointF p1, p2;
|
QPointF p1, p2;
|
||||||
const QPointF center = arc->GetCenter();
|
const QPointF center = static_cast<QPointF>(arc->GetCenter());
|
||||||
const qreal radius = arc->GetRadius();
|
const qreal radius = arc->GetRadius();
|
||||||
const int res = VGObject::ContactPoints (p, center, radius, p1, p2);
|
const int res = VGObject::ContactPoints (p, center, radius, p1, p2);
|
||||||
|
|
||||||
|
|
|
@ -116,8 +116,8 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(const qui
|
||||||
const VPointF cPoint = *data->GeometricObject<VPointF>(circleCenterId);
|
const VPointF cPoint = *data->GeometricObject<VPointF>(circleCenterId);
|
||||||
const VPointF tPoint = *data->GeometricObject<VPointF>(tangentPointId);
|
const VPointF tPoint = *data->GeometricObject<VPointF>(tangentPointId);
|
||||||
|
|
||||||
const QPointF point = VToolPointFromCircleAndTangent::FindPoint(tPoint, cPoint, radius,
|
const QPointF point = VToolPointFromCircleAndTangent::FindPoint(static_cast<QPointF>(tPoint),
|
||||||
crossPoint);
|
static_cast<QPointF>(cPoint), radius, crossPoint);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -213,7 +213,8 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad
|
||||||
|
|
||||||
const qreal result = CheckFormula(_id, radius, data);
|
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<QPointF>(*centerP),
|
||||||
|
static_cast<QPointF>(*firstP), static_cast<QPointF>(*secondP));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,8 +143,8 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(const quint32
|
||||||
QPointF VToolPointOfIntersectionArcs::FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType)
|
QPointF VToolPointOfIntersectionArcs::FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType)
|
||||||
{
|
{
|
||||||
QPointF p1, p2;
|
QPointF p1, p2;
|
||||||
const QPointF centerArc1 = arc1->GetCenter();
|
const QPointF centerArc1 = static_cast<QPointF>(arc1->GetCenter());
|
||||||
const QPointF centerArc2 = arc2->GetCenter();
|
const QPointF centerArc2 = static_cast<QPointF>(arc2->GetCenter());
|
||||||
const int res = VGObject::IntersectionCircles(centerArc1, arc1->GetRadius(), centerArc2, arc2->GetRadius(), p1, p2);
|
const int res = VGObject::IntersectionCircles(centerArc1, arc1->GetRadius(), centerArc2, arc2->GetRadius(), p1, p2);
|
||||||
|
|
||||||
QLineF r1Arc1(centerArc1, p1);
|
QLineF r1Arc1(centerArc1, p1);
|
||||||
|
|
|
@ -127,7 +127,8 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(const q
|
||||||
const VPointF c1Point = *data->GeometricObject<VPointF>(firstCircleCenterId);
|
const VPointF c1Point = *data->GeometricObject<VPointF>(firstCircleCenterId);
|
||||||
const VPointF c2Point = *data->GeometricObject<VPointF>(secondCircleCenterId);
|
const VPointF c2Point = *data->GeometricObject<VPointF>(secondCircleCenterId);
|
||||||
|
|
||||||
const QPointF point = FindPoint(c1Point, c2Point, calcC1Radius, calcC2Radius, crossPoint);
|
const QPointF point = FindPoint(static_cast<QPointF>(c1Point), static_cast<QPointF>(c2Point), calcC1Radius,
|
||||||
|
calcC2Radius, crossPoint);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -273,7 +273,7 @@ void VToolSinglePoint::RefreshPointGeometry(const VPointF &point)
|
||||||
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
||||||
rec.translate(-rec.center().x(), -rec.center().y());
|
rec.translate(-rec.center().x(), -rec.center().y());
|
||||||
this->setRect(rec);
|
this->setRect(rec);
|
||||||
this->setPos(point);
|
this->setPos(static_cast<QPointF>(point));
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
namePoint->blockSignals(true);
|
namePoint->blockSignals(true);
|
||||||
QFont font = namePoint->font();
|
QFont font = namePoint->font();
|
||||||
|
|
|
@ -151,7 +151,8 @@ VToolTriangle* VToolTriangle::Create(const quint32 _id, const QString &pointName
|
||||||
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(firstPointId);
|
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(firstPointId);
|
||||||
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(secondPointId);
|
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(secondPointId);
|
||||||
|
|
||||||
QPointF point = FindPoint(*axisP1, *axisP2, *firstPoint, *secondPoint);
|
QPointF point = FindPoint(static_cast<QPointF>(*axisP1), static_cast<QPointF>(*axisP2),
|
||||||
|
static_cast<QPointF>(*firstPoint), static_cast<QPointF>(*secondPoint));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,7 @@ VToolLine::VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint3
|
||||||
//Line
|
//Line
|
||||||
const QSharedPointer<VPointF> first = data->GeometricObject<VPointF>(firstPoint);
|
const QSharedPointer<VPointF> first = data->GeometricObject<VPointF>(firstPoint);
|
||||||
const QSharedPointer<VPointF> second = data->GeometricObject<VPointF>(secondPoint);
|
const QSharedPointer<VPointF> second = data->GeometricObject<VPointF>(secondPoint);
|
||||||
this->setLine(QLineF(*first, *second));
|
this->setLine(QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)));
|
||||||
this->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
this->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
|
@ -542,6 +542,6 @@ void VToolLine::RefreshGeometry()
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = VAbstractTool::data.GeometricObject<VPointF>(firstPoint);
|
const QSharedPointer<VPointF> first = VAbstractTool::data.GeometricObject<VPointF>(firstPoint);
|
||||||
const QSharedPointer<VPointF> second = VAbstractTool::data.GeometricObject<VPointF>(secondPoint);
|
const QSharedPointer<VPointF> second = VAbstractTool::data.GeometricObject<VPointF>(secondPoint);
|
||||||
this->setLine(QLineF(*first, *second));
|
this->setLine(QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)));
|
||||||
this->setPen(QPen(CorrectColor(lineColor), pen().widthF(), LineStyleToPenStyle(typeLine)));
|
this->setPen(QPen(CorrectColor(lineColor), pen().widthF(), LineStyleToPenStyle(typeLine)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,7 +299,7 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point)
|
||||||
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
||||||
rec.translate(-rec.center().x(), -rec.center().y());
|
rec.translate(-rec.center().x(), -rec.center().y());
|
||||||
this->setRect(rec);
|
this->setRect(rec);
|
||||||
this->setPos(point);
|
this->setPos(static_cast<QPointF>(point));
|
||||||
|
|
||||||
namePoint->blockSignals(true);
|
namePoint->blockSignals(true);
|
||||||
namePoint->setText(point.name());
|
namePoint->setText(point.name());
|
||||||
|
|
|
@ -1303,7 +1303,8 @@ VPieceItem::MoveTypes VToolSeamAllowance::FindLabelGeometry(const VPatternLabelD
|
||||||
const auto topLeftPinPoint = VAbstractTool::data.GeometricObject<VPointF>(topLeftPin);
|
const auto topLeftPinPoint = VAbstractTool::data.GeometricObject<VPointF>(topLeftPin);
|
||||||
const auto bottomRightPinPoint = VAbstractTool::data.GeometricObject<VPointF>(bottomRightPin);
|
const auto bottomRightPinPoint = VAbstractTool::data.GeometricObject<VPointF>(bottomRightPin);
|
||||||
|
|
||||||
const QRectF labelRect = QRectF(*topLeftPinPoint, *bottomRightPinPoint);
|
const QRectF labelRect = QRectF(static_cast<QPointF>(*topLeftPinPoint),
|
||||||
|
static_cast<QPointF>(*bottomRightPinPoint));
|
||||||
labelWidth = FromPixel(qAbs(labelRect.width()), *VDataTool::data.GetPatternUnit());
|
labelWidth = FromPixel(qAbs(labelRect.width()), *VDataTool::data.GetPatternUnit());
|
||||||
labelHeight = FromPixel(qAbs(labelRect.height()), *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 lWidth = ToPixel(labelWidth, *VDataTool::data.GetPatternUnit());
|
||||||
const qreal lHeight = ToPixel(labelHeight, *VDataTool::data.GetPatternUnit());
|
const qreal lHeight = ToPixel(labelHeight, *VDataTool::data.GetPatternUnit());
|
||||||
|
|
||||||
pos = *centerPinPoint - QRectF(0, 0, lWidth, lHeight).center();
|
pos = static_cast<QPointF>(*centerPinPoint) - QRectF(0, 0, lWidth, lHeight).center();
|
||||||
restrictions &= ~ VPieceItem::IsMovable;
|
restrictions &= ~ VPieceItem::IsMovable;
|
||||||
}
|
}
|
||||||
catch(const VExceptionBadId &)
|
catch(const VExceptionBadId &)
|
||||||
|
@ -1383,7 +1384,7 @@ VPieceItem::MoveTypes VToolSeamAllowance::FindGrainlineGeometry(const VGrainline
|
||||||
const auto topPinPoint = VAbstractTool::data.GeometricObject<VPointF>(topPin);
|
const auto topPinPoint = VAbstractTool::data.GeometricObject<VPointF>(topPin);
|
||||||
const auto bottomPinPoint = VAbstractTool::data.GeometricObject<VPointF>(bottomPin);
|
const auto bottomPinPoint = VAbstractTool::data.GeometricObject<VPointF>(bottomPin);
|
||||||
|
|
||||||
QLineF grainline(*bottomPinPoint, *topPinPoint);
|
QLineF grainline(static_cast<QPointF>(*bottomPinPoint), static_cast<QPointF>(*topPinPoint));
|
||||||
length = FromPixel(grainline.length(), *VDataTool::data.GetPatternUnit());
|
length = FromPixel(grainline.length(), *VDataTool::data.GetPatternUnit());
|
||||||
rotationAngle = grainline.angle();
|
rotationAngle = grainline.angle();
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ void BiasRotatePoint(VPointF *point, qreal dx, qreal dy, const QPointF &pRotate,
|
||||||
{
|
{
|
||||||
point->setX(point->x()+dx);
|
point->setX(point->x()+dx);
|
||||||
point->setY(point->y()+dy);
|
point->setY(point->y()+dy);
|
||||||
QLineF line(pRotate, *point);
|
QLineF line(pRotate, static_cast<QPointF>(*point));
|
||||||
line.setAngle(line.angle()+angle);
|
line.setAngle(line.angle()+angle);
|
||||||
point->setX(line.p2().x());
|
point->setX(line.p2().x());
|
||||||
point->setY(line.p2().y());
|
point->setY(line.p2().y());
|
||||||
|
@ -352,8 +352,8 @@ void UnionInitParameters(const VToolUnionDetailsInitData &initData, const VPiece
|
||||||
point4.setX(point4.x()+dx);
|
point4.setX(point4.x()+dx);
|
||||||
point4.setY(point4.y()+dy);
|
point4.setY(point4.y()+dy);
|
||||||
|
|
||||||
const QLineF p4p3 = QLineF(point4, point3);
|
const QLineF p4p3 = QLineF(static_cast<QPointF>(point4), static_cast<QPointF>(point3));
|
||||||
const QLineF p1p2 = QLineF(point1, point2);
|
const QLineF p1p2 = QLineF(static_cast<QPointF>(point1), static_cast<QPointF>(point2));
|
||||||
|
|
||||||
angle = p4p3.angleTo(p1p2);
|
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)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
BiasRotatePoint(point.data(), dx, dy, *initData.data->GeometricObject<VPointF>(pRotate), angle);
|
BiasRotatePoint(point.data(), dx, dy, static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate)),
|
||||||
|
angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QScopedPointer<VPointF> point1(new VPointF(*point));
|
QScopedPointer<VPointF> 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)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
BiasRotatePoint(point.data(), dx, dy, *initData.data->GeometricObject<VPointF>(pRotate), angle);
|
BiasRotatePoint(point.data(), dx, dy, static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate)),
|
||||||
|
angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QScopedPointer<VPointF> point1(new VPointF(*point));
|
QScopedPointer<VPointF> 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)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *initData.data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(&p1, dx, dy, p, angle);
|
BiasRotatePoint(&p1, dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, dx, dy, p, angle);
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineF l1(*center, p1);
|
QLineF l1(static_cast<QPointF>(*center), static_cast<QPointF>(p1));
|
||||||
QLineF l2(*center, p2);
|
QLineF l2(static_cast<QPointF>(*center), static_cast<QPointF>(p2));
|
||||||
center->setMode(Draw::Modeling);
|
center->setMode(Draw::Modeling);
|
||||||
VPointF *tmpCenter = center.take();
|
VPointF *tmpCenter = center.take();
|
||||||
const quint32 idCenter = initData.data->AddGObject(tmpCenter);
|
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)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *initData.data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(&p1, dx, dy, p, angle);
|
BiasRotatePoint(&p1, dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, dx, dy, p, angle);
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineF l1(*center, p1);
|
QLineF l1(static_cast<QPointF>(*center), static_cast<QPointF>(p1));
|
||||||
QLineF l2(*center, p2);
|
QLineF l2(static_cast<QPointF>(*center), static_cast<QPointF>(p2));
|
||||||
center->setMode(Draw::Modeling);
|
center->setMode(Draw::Modeling);
|
||||||
VPointF *tmpCenter = center.take();
|
VPointF *tmpCenter = center.take();
|
||||||
quint32 idCenter = initData.data->AddGObject(tmpCenter);
|
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)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *initData.data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, 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);
|
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<QPointF>(p2), static_cast<QPointF>(p3), *p4, 0, Draw::Modeling);
|
||||||
const quint32 idObject = initData.data->AddGObject(spl);
|
const quint32 idObject = initData.data->AddGObject(spl);
|
||||||
children.append(idObject);
|
children.append(idObject);
|
||||||
|
|
||||||
|
@ -545,7 +547,7 @@ quint32 AddNodeSplinePath(const VPieceNode &node, const VToolUnionDetailsInitDat
|
||||||
QScopedPointer<VPointF> p4(new VPointF(spline.GetP4()));
|
QScopedPointer<VPointF> p4(new VPointF(spline.GetP4()));
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *initData.data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, 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);
|
BiasRotatePoint(p4.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSpline spl = VSpline(*p1, p2, p3, *p4);
|
VSpline spl = VSpline(*p1, static_cast<QPointF>(p2), static_cast<QPointF>(p3), *p4);
|
||||||
if (i==1)
|
if (i==1)
|
||||||
{
|
{
|
||||||
const qreal angle1 = spl.GetStartAngle()+180;
|
const qreal angle1 = spl.GetStartAngle()+180;
|
||||||
|
@ -798,7 +800,7 @@ void UpdateNodePoint(VContainer *data, const VPieceNode &node, QVector<quint32>
|
||||||
point->setMode(Draw::Modeling);
|
point->setMode(Draw::Modeling);
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
BiasRotatePoint(point.data(), dx, dy, *data->GeometricObject<VPointF>(pRotate), angle);
|
BiasRotatePoint(point.data(), dx, dy, static_cast<QPointF>(*data->GeometricObject<VPointF>(pRotate)), angle);
|
||||||
}
|
}
|
||||||
data->UpdateGObject(TakeNextId(children), point.take());
|
data->UpdateGObject(TakeNextId(children), point.take());
|
||||||
}
|
}
|
||||||
|
@ -814,15 +816,15 @@ void UpdateNodeArc(VContainer *data, const VPieceNode &node, QVector<quint32> &c
|
||||||
|
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(&p1, dx, dy, p, angle);
|
BiasRotatePoint(&p1, dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, dx, dy, p, angle);
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineF l1(*center, p1);
|
QLineF l1(static_cast<QPointF>(*center), static_cast<QPointF>(p1));
|
||||||
QLineF l2(*center, p2);
|
QLineF l2(static_cast<QPointF>(*center), static_cast<QPointF>(p2));
|
||||||
|
|
||||||
QScopedPointer<VArc> arc1(new VArc(*center, arc->GetRadius(), arc->GetFormulaRadius(), l1.angle(),
|
QScopedPointer<VArc> arc1(new VArc(*center, arc->GetRadius(), arc->GetFormulaRadius(), l1.angle(),
|
||||||
QString().setNum(l1.angle()), l2.angle(), QString().setNum(l2.angle())));
|
QString().setNum(l1.angle()), l2.angle(), QString().setNum(l2.angle())));
|
||||||
|
@ -841,15 +843,15 @@ void UpdateNodeElArc(VContainer *data, const VPieceNode &node, QVector<quint32>
|
||||||
|
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(&p1, dx, dy, p, angle);
|
BiasRotatePoint(&p1, dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, dx, dy, p, angle);
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
BiasRotatePoint(center.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineF l1(*center, p1);
|
QLineF l1(static_cast<QPointF>(*center), static_cast<QPointF>(p1));
|
||||||
QLineF l2(*center, p2);
|
QLineF l2(static_cast<QPointF>(*center), static_cast<QPointF>(p2));
|
||||||
|
|
||||||
QScopedPointer<VEllipticalArc> arc1(new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(),
|
QScopedPointer<VEllipticalArc> arc1(new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(),
|
||||||
arc->GetFormulaRadius1(), arc->GetFormulaRadius2(),
|
arc->GetFormulaRadius1(), arc->GetFormulaRadius2(),
|
||||||
|
@ -873,7 +875,7 @@ void UpdateNodeSpline(VContainer *data, const VPieceNode &node, QVector<quint32>
|
||||||
|
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, dx, dy, p, angle);
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
|
@ -881,7 +883,8 @@ void UpdateNodeSpline(VContainer *data, const VPieceNode &node, QVector<quint32>
|
||||||
BiasRotatePoint(p4.data(), dx, dy, p, angle);
|
BiasRotatePoint(p4.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
QScopedPointer<VSpline> spl(new VSpline(*p1, p2, p3, *p4, 0, Draw::Modeling));
|
QScopedPointer<VSpline> spl(new VSpline(*p1, static_cast<QPointF>(p2), static_cast<QPointF>(p3), *p4, 0,
|
||||||
|
Draw::Modeling));
|
||||||
data->UpdateGObject(TakeNextId(children), spl.take());
|
data->UpdateGObject(TakeNextId(children), spl.take());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -905,7 +908,7 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVector<quin
|
||||||
|
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
const QPointF p = *data->GeometricObject<VPointF>(pRotate);
|
const QPointF p = static_cast<QPointF>(*data->GeometricObject<VPointF>(pRotate));
|
||||||
|
|
||||||
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
BiasRotatePoint(p1.data(), dx, dy, p, angle);
|
||||||
BiasRotatePoint(&p2, dx, dy, p, angle);
|
BiasRotatePoint(&p2, dx, dy, p, angle);
|
||||||
|
@ -913,7 +916,7 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVector<quin
|
||||||
BiasRotatePoint(p4.data(), dx, dy, p, angle);
|
BiasRotatePoint(p4.data(), dx, dy, p, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSpline spl = VSpline(*p1, p2, p3, *p4);
|
VSpline spl = VSpline(*p1, static_cast<QPointF>(p2), static_cast<QPointF>(p3), *p4);
|
||||||
if (i==1)
|
if (i==1)
|
||||||
{
|
{
|
||||||
const qreal angle1 = spl.GetStartAngle()+180;
|
const qreal angle1 = spl.GetStartAngle()+180;
|
||||||
|
@ -1263,7 +1266,8 @@ void UpdateUnitedDetailPins(quint32 id, const VToolUnionDetailsInitData &initDat
|
||||||
point->setMode(Draw::Modeling);
|
point->setMode(Draw::Modeling);
|
||||||
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID)
|
||||||
{
|
{
|
||||||
BiasRotatePoint(point.data(), dx, dy, *initData.data->GeometricObject<VPointF>(pRotate), angle);
|
BiasRotatePoint(point.data(), dx, dy,
|
||||||
|
static_cast<QPointF>(*initData.data->GeometricObject<VPointF>(pRotate)), angle);
|
||||||
}
|
}
|
||||||
initData.data->UpdateGObject(TakeNextId(children), point.take());
|
initData.data->UpdateGObject(TakeNextId(children), point.take());
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,14 +120,14 @@ void VisOperation::RefreshFlippedObjects(const QPointF &firstPoint, const QPoint
|
||||||
|
|
||||||
++iPoint;
|
++iPoint;
|
||||||
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor2);
|
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor2);
|
||||||
DrawPoint(point, *p, supportColor2);
|
DrawPoint(point, static_cast<QPointF>(*p), supportColor2);
|
||||||
|
|
||||||
++iPoint;
|
++iPoint;
|
||||||
point = GetPoint(static_cast<quint32>(iPoint), supportColor);
|
point = GetPoint(static_cast<quint32>(iPoint), supportColor);
|
||||||
|
|
||||||
if (object1Id != NULL_ID)
|
if (object1Id != NULL_ID)
|
||||||
{
|
{
|
||||||
DrawPoint(point, p->Flip(QLineF(firstPoint, secondPoint)), supportColor);
|
DrawPoint(point, static_cast<QPointF>(p->Flip(QLineF(firstPoint, secondPoint))), supportColor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ void VisToolFlippingByAxis::RefreshGeometry()
|
||||||
|
|
||||||
if (object1Id != NULL_ID)
|
if (object1Id != NULL_ID)
|
||||||
{
|
{
|
||||||
firstPoint = *Visualization::data->GeometricObject<VPointF>(object1Id);
|
firstPoint = static_cast<QPointF>(*Visualization::data->GeometricObject<VPointF>(object1Id));
|
||||||
DrawPoint(point1, firstPoint, supportColor2);
|
DrawPoint(point1, firstPoint, supportColor2);
|
||||||
|
|
||||||
if (m_axisType == AxisType::VerticalAxis)
|
if (m_axisType == AxisType::VerticalAxis)
|
||||||
|
|
|
@ -58,7 +58,7 @@ void VisToolFlippingByLine::RefreshGeometry()
|
||||||
|
|
||||||
if (object1Id != NULL_ID)
|
if (object1Id != NULL_ID)
|
||||||
{
|
{
|
||||||
firstPoint = *Visualization::data->GeometricObject<VPointF>(object1Id);
|
firstPoint = static_cast<QPointF>(*Visualization::data->GeometricObject<VPointF>(object1Id));
|
||||||
DrawPoint(point1, firstPoint, supportColor2);
|
DrawPoint(point1, firstPoint, supportColor2);
|
||||||
|
|
||||||
if (object2Id == NULL_ID)
|
if (object2Id == NULL_ID)
|
||||||
|
@ -67,7 +67,7 @@ void VisToolFlippingByLine::RefreshGeometry()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
secondPoint = *Visualization::data->GeometricObject<VPointF>(object2Id);
|
secondPoint = static_cast<QPointF>(*Visualization::data->GeometricObject<VPointF>(object2Id));
|
||||||
DrawPoint(point2, secondPoint, supportColor2);
|
DrawPoint(point2, secondPoint, supportColor2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ QVector<QGraphicsItem *> VisToolMove::CreateOriginObjects(int &iPoint, int &iCur
|
||||||
|
|
||||||
++iPoint;
|
++iPoint;
|
||||||
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor2);
|
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor2);
|
||||||
DrawPoint(point, *p, supportColor2);
|
DrawPoint(point, static_cast<QPointF>(*p), supportColor2);
|
||||||
originObjects.append(point);
|
originObjects.append(point);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -289,7 +289,7 @@ void VisToolMove::CreateMovedObjects(int &iPoint, int &iCurve, qreal length, qre
|
||||||
|
|
||||||
++iPoint;
|
++iPoint;
|
||||||
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor);
|
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor);
|
||||||
DrawPoint(point, p->Move(length, angle), supportColor);
|
DrawPoint(point, static_cast<QPointF>(p->Move(length, angle)), supportColor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::Arc:
|
case GOType::Arc:
|
||||||
|
|
|
@ -91,29 +91,30 @@ void VisToolRotation::RefreshGeometry()
|
||||||
if (object1Id != NULL_ID)
|
if (object1Id != NULL_ID)
|
||||||
{
|
{
|
||||||
origin = Visualization::data->GeometricObject<VPointF>(object1Id);
|
origin = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(point, *origin, supportColor2);
|
DrawPoint(point, static_cast<QPointF>(*origin), supportColor2);
|
||||||
|
|
||||||
QLineF rLine;
|
QLineF rLine;
|
||||||
if (VFuzzyComparePossibleNulls(angle, INT_MIN))
|
if (VFuzzyComparePossibleNulls(angle, INT_MIN))
|
||||||
{
|
{
|
||||||
rLine = QLineF(*origin, Visualization::scenePos);
|
rLine = QLineF(static_cast<QPointF>(*origin), Visualization::scenePos);
|
||||||
|
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
rLine.setAngle(CorrectAngle(rLine.angle()));
|
rLine.setAngle(CorrectAngle(rLine.angle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
rLine.setP2(Ray(*origin, rLine.angle()));
|
rLine.setP2(Ray(static_cast<QPointF>(*origin), rLine.angle()));
|
||||||
tempAngle = rLine.angle();
|
tempAngle = rLine.angle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rLine = QLineF(*origin, Ray(*origin, angle));
|
rLine = QLineF(static_cast<QPointF>(*origin), Ray(static_cast<QPointF>(*origin), angle));
|
||||||
tempAngle = angle;
|
tempAngle = angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawLine(this, rLine, supportColor2, Qt::DashLine);
|
DrawLine(this, rLine, supportColor2, Qt::DashLine);
|
||||||
DrawLine(xAxis, QLineF(*origin, Ray(*origin, 0)), supportColor2, Qt::DashLine);
|
DrawLine(xAxis, QLineF(static_cast<QPointF>(*origin), Ray(static_cast<QPointF>(*origin), 0)), supportColor2,
|
||||||
|
Qt::DashLine);
|
||||||
|
|
||||||
VArc arc(*origin, ToPixel(DefPointRadius/*mm*/*2, Unit::Mm), 0, tempAngle);
|
VArc arc(*origin, ToPixel(DefPointRadius/*mm*/*2, Unit::Mm), 0, tempAngle);
|
||||||
DrawPath(angleArc, arc.GetPath(PathDirection::Hide), supportColor2, Qt::SolidLine, Qt::RoundCap);
|
DrawPath(angleArc, arc.GetPath(PathDirection::Hide), supportColor2, Qt::SolidLine, Qt::RoundCap);
|
||||||
|
@ -140,45 +141,46 @@ void VisToolRotation::RefreshGeometry()
|
||||||
|
|
||||||
++iPoint;
|
++iPoint;
|
||||||
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor2);
|
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(iPoint), supportColor2);
|
||||||
DrawPoint(point, *p, supportColor2);
|
DrawPoint(point, static_cast<QPointF>(*p), supportColor2);
|
||||||
|
|
||||||
++iPoint;
|
++iPoint;
|
||||||
point = GetPoint(static_cast<quint32>(iPoint), supportColor);
|
point = GetPoint(static_cast<quint32>(iPoint), supportColor);
|
||||||
|
|
||||||
if (object1Id != NULL_ID)
|
if (object1Id != NULL_ID)
|
||||||
{
|
{
|
||||||
DrawPoint(point, p->Rotate(*origin, tempAngle), supportColor);
|
DrawPoint(point, static_cast<QPointF>(p->Rotate(static_cast<QPointF>(*origin), tempAngle)),
|
||||||
|
supportColor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::Arc:
|
case GOType::Arc:
|
||||||
{
|
{
|
||||||
iCurve = AddCurve<VArc>(tempAngle, *origin, id, iCurve);
|
iCurve = AddCurve<VArc>(tempAngle, static_cast<QPointF>(*origin), id, iCurve);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::EllipticalArc:
|
case GOType::EllipticalArc:
|
||||||
{
|
{
|
||||||
iCurve = AddCurve<VEllipticalArc>(tempAngle, *origin, id, iCurve);
|
iCurve = AddCurve<VEllipticalArc>(tempAngle, static_cast<QPointF>(*origin), id, iCurve);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::Spline:
|
case GOType::Spline:
|
||||||
{
|
{
|
||||||
iCurve = AddCurve<VSpline>(tempAngle, *origin, id, iCurve);
|
iCurve = AddCurve<VSpline>(tempAngle, static_cast<QPointF>(*origin), id, iCurve);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::SplinePath:
|
case GOType::SplinePath:
|
||||||
{
|
{
|
||||||
iCurve = AddCurve<VSplinePath>(tempAngle, *origin, id, iCurve);
|
iCurve = AddCurve<VSplinePath>(tempAngle, static_cast<QPointF>(*origin), id, iCurve);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::CubicBezier:
|
case GOType::CubicBezier:
|
||||||
{
|
{
|
||||||
iCurve = AddCurve<VCubicBezier>(tempAngle, *origin, id, iCurve);
|
iCurve = AddCurve<VCubicBezier>(tempAngle, static_cast<QPointF>(*origin), id, iCurve);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::CubicBezierPath:
|
case GOType::CubicBezierPath:
|
||||||
{
|
{
|
||||||
iCurve = AddCurve<VCubicBezierPath>(tempAngle, *origin, id, iCurve);
|
iCurve = AddCurve<VCubicBezierPath>(tempAngle, static_cast<QPointF>(*origin), id, iCurve);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GOType::Unknown:
|
case GOType::Unknown:
|
||||||
|
|
|
@ -79,22 +79,22 @@ void VisToolAlongLine::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(lineP1, *first, supportColor);
|
DrawPoint(lineP1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (object2Id <= NULL_ID)
|
if (object2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(line, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawLine(line, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(lineP2, *second, supportColor);
|
DrawPoint(lineP2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
DrawLine(line, QLineF(*first, *second), supportColor);
|
DrawLine(line, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(length))
|
if (not qFuzzyIsNull(length))
|
||||||
{
|
{
|
||||||
QLineF mainLine = VGObject::BuildLine(*first, length, line->line().angle());
|
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*first), length, line->line().angle());
|
||||||
DrawLine(this, mainLine, mainColor, lineStyle);
|
DrawLine(this, mainLine, mainColor, lineStyle);
|
||||||
|
|
||||||
DrawPoint(point, mainLine.p2(), mainColor);
|
DrawPoint(point, mainLine.p2(), mainColor);
|
||||||
|
|
|
@ -85,43 +85,49 @@ void VisToolBisector::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(line1P1, *first, supportColor);
|
DrawPoint(line1P1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (object2Id <= NULL_ID)
|
if (object2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(line1, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawLine(line1, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(line1P2, *second, supportColor);
|
DrawPoint(line1P2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
DrawLine(line1, QLineF(*first, *second), supportColor);
|
DrawLine(line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor);
|
||||||
|
|
||||||
if (object3Id <= NULL_ID)
|
if (object3Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(line2, QLineF(*second, Visualization::scenePos), supportColor);
|
DrawLine(line2, QLineF(static_cast<QPointF>(*second), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(object3Id);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(object3Id);
|
||||||
DrawPoint(line2P2, *third, supportColor);
|
DrawPoint(line2P2, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
DrawLine(line2, QLineF(*second, *third), supportColor);
|
DrawLine(line2, QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third)), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(length))
|
if (not qFuzzyIsNull(length))
|
||||||
{
|
{
|
||||||
qreal angle = VToolBisector::BisectorAngle(*first, *second, *third);
|
qreal angle = VToolBisector::BisectorAngle(static_cast<QPointF>(*first),
|
||||||
QLineF mainLine = VGObject::BuildLine(*second, length, angle);
|
static_cast<QPointF>(*second),
|
||||||
|
static_cast<QPointF>(*third));
|
||||||
|
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second), length, angle);
|
||||||
DrawLine(this, mainLine, mainColor, lineStyle);
|
DrawLine(this, mainLine, mainColor, lineStyle);
|
||||||
|
|
||||||
DrawPoint(point, mainLine.p2(), mainColor);
|
DrawPoint(point, mainLine.p2(), mainColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qreal angle = VToolBisector::BisectorAngle(*first, *second, *third);
|
qreal angle = VToolBisector::BisectorAngle(static_cast<QPointF>(*first),
|
||||||
QPointF endRay = Ray(*second, angle);
|
static_cast<QPointF>(*second),
|
||||||
QLineF mainLine = VGObject::BuildLine(*second, QLineF(*second, endRay).length(), angle);
|
static_cast<QPointF>(*third));
|
||||||
|
QPointF endRay = Ray(static_cast<QPointF>(*second), angle);
|
||||||
|
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second),
|
||||||
|
QLineF(static_cast<QPointF>(*second), endRay).length(),
|
||||||
|
angle);
|
||||||
DrawLine(this, mainLine, mainColor, lineStyle);
|
DrawLine(this, mainLine, mainColor, lineStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,17 +78,17 @@ void VisToolCurveIntersectAxis::RefreshGeometry()
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(axisPointId);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(axisPointId);
|
||||||
if (VFuzzyComparePossibleNulls(angle, -1))
|
if (VFuzzyComparePossibleNulls(angle, -1))
|
||||||
{
|
{
|
||||||
axis = Axis(*first, Visualization::scenePos);
|
axis = Axis(static_cast<QPointF>(*first), Visualization::scenePos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
axis = Axis(*first, angle);
|
axis = Axis(static_cast<QPointF>(*first), angle);
|
||||||
}
|
}
|
||||||
DrawPoint(basePoint, *first, mainColor);
|
DrawPoint(basePoint, static_cast<QPointF>(*first), mainColor);
|
||||||
DrawLine(axisLine, axis, supportColor, Qt::DashLine);
|
DrawLine(axisLine, axis, supportColor, Qt::DashLine);
|
||||||
|
|
||||||
QPointF p = VToolCurveIntersectAxis::FindPoint(*first, axis.angle(), curve);
|
QPointF p = VToolCurveIntersectAxis::FindPoint(static_cast<QPointF>(*first), axis.angle(), curve);
|
||||||
QLineF axis_line(*first, p);
|
QLineF axis_line(static_cast<QPointF>(*first), p);
|
||||||
DrawLine(this, axis_line, mainColor, lineStyle);
|
DrawLine(this, axis_line, mainColor, lineStyle);
|
||||||
|
|
||||||
DrawPoint(point, p, mainColor);
|
DrawPoint(point, p, mainColor);
|
||||||
|
|
|
@ -68,17 +68,17 @@ void VisToolEndLine::RefreshGeometry()
|
||||||
{
|
{
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
line = QLineF(*first, Visualization::scenePos);
|
line = QLineF(static_cast<QPointF>(*first), Visualization::scenePos);
|
||||||
line.setAngle(CorrectAngle(line.angle()));
|
line.setAngle(CorrectAngle(line.angle()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
line = QLineF(*first, Visualization::scenePos);
|
line = QLineF(static_cast<QPointF>(*first), Visualization::scenePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
line = VGObject::BuildLine(*first, length, angle);
|
line = VGObject::BuildLine(static_cast<QPointF>(*first), length, angle);
|
||||||
DrawPoint(point, line.p2(), mainColor);
|
DrawPoint(point, line.p2(), mainColor);
|
||||||
}
|
}
|
||||||
DrawLine(this, line, mainColor, lineStyle);
|
DrawLine(this, line, mainColor, lineStyle);
|
||||||
|
|
|
@ -66,37 +66,37 @@ void VisToolHeight::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(base_point, *first, supportColor);
|
DrawPoint(base_point, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (lineP1Id <= NULL_ID)
|
if (lineP1Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(this, QLineF(*first, Visualization::scenePos), mainColor);
|
DrawLine(this, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), mainColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP1Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP1Id);
|
||||||
DrawPoint(lineP1, *second, supportColor);
|
DrawPoint(lineP1, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
QLineF base_line;
|
QLineF base_line;
|
||||||
if (lineP2Id <= NULL_ID)
|
if (lineP2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
base_line = QLineF(*second, Visualization::scenePos);
|
base_line = QLineF(static_cast<QPointF>(*second), Visualization::scenePos);
|
||||||
DrawLine(line, base_line, supportColor);
|
DrawLine(line, base_line, supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(lineP2Id);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(lineP2Id);
|
||||||
DrawPoint(lineP2, *third, supportColor);
|
DrawPoint(lineP2, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
base_line = QLineF(*second, *third);
|
base_line = QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third));
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawLine(line, base_line, supportColor);
|
DrawLine(line, base_line, supportColor);
|
||||||
|
|
||||||
QPointF height = VToolHeight::FindPoint(base_line, *first);
|
QPointF height = VToolHeight::FindPoint(base_line, static_cast<QPointF>(*first));
|
||||||
DrawPoint(point, height, mainColor);
|
DrawPoint(point, height, mainColor);
|
||||||
|
|
||||||
QLineF height_line(*first, height);
|
QLineF height_line(static_cast<QPointF>(*first), height);
|
||||||
DrawLine(this, height_line, mainColor, lineStyle);
|
DrawLine(this, height_line, mainColor, lineStyle);
|
||||||
|
|
||||||
ShowIntersection(height_line, base_line);
|
ShowIntersection(height_line, base_line);
|
||||||
|
|
|
@ -59,12 +59,12 @@ void VisToolLine::RefreshGeometry()
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
if (point2Id == NULL_ID)
|
if (point2Id == NULL_ID)
|
||||||
{
|
{
|
||||||
line = QLineF(*first, Visualization::scenePos);
|
line = QLineF(static_cast<QPointF>(*first), Visualization::scenePos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
|
||||||
line = QLineF(*first, *second);
|
line = QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
|
||||||
}
|
}
|
||||||
DrawLine(this, line, mainColor, lineStyle);
|
DrawLine(this, line, mainColor, lineStyle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,18 +66,18 @@ void VisToolLineIntersect::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(line1P1, *first, supportColor);
|
DrawPoint(line1P1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (line1P2Id <= NULL_ID)
|
if (line1P2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(line1, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawLine(line1, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(line1P2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(line1P2Id);
|
||||||
DrawPoint(line1P2, *second, supportColor);
|
DrawPoint(line1P2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
DrawLine(line1, QLineF(*first, *second), supportColor);
|
DrawLine(line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor);
|
||||||
|
|
||||||
if (line2P1Id <= NULL_ID)
|
if (line2P1Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -86,14 +86,14 @@ void VisToolLineIntersect::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(line2P1Id);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(line2P1Id);
|
||||||
DrawPoint(line2P1, *third, supportColor);
|
DrawPoint(line2P1, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
if (line2P2Id <= NULL_ID)
|
if (line2P2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(this, QLineF(*third, Visualization::scenePos), supportColor);
|
DrawLine(this, QLineF(static_cast<QPointF>(*third), Visualization::scenePos), supportColor);
|
||||||
|
|
||||||
QLineF l1(*first, *second);
|
QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
|
||||||
QLineF l2(*third, Visualization::scenePos);
|
QLineF l2(static_cast<QPointF>(*third), Visualization::scenePos);
|
||||||
QPointF fPoint;
|
QPointF fPoint;
|
||||||
QLineF::IntersectType intersect = l1.intersect(l2, &fPoint);
|
QLineF::IntersectType intersect = l1.intersect(l2, &fPoint);
|
||||||
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
||||||
|
@ -104,12 +104,12 @@ void VisToolLineIntersect::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> forth = Visualization::data->GeometricObject<VPointF>(line2P2Id);
|
const QSharedPointer<VPointF> forth = Visualization::data->GeometricObject<VPointF>(line2P2Id);
|
||||||
DrawPoint(line2P2, *forth, supportColor);
|
DrawPoint(line2P2, static_cast<QPointF>(*forth), supportColor);
|
||||||
|
|
||||||
DrawLine(this, QLineF(*third, *forth), supportColor);
|
DrawLine(this, QLineF(static_cast<QPointF>(*third), static_cast<QPointF>(*forth)), supportColor);
|
||||||
|
|
||||||
QLineF l1(*first, *second);
|
QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
|
||||||
QLineF l2(*third, *forth);
|
QLineF l2(static_cast<QPointF>(*third), static_cast<QPointF>(*forth));
|
||||||
QPointF fPoint;
|
QPointF fPoint;
|
||||||
QLineF::IntersectType intersect = l1.intersect(l2, &fPoint);
|
QLineF::IntersectType intersect = l1.intersect(l2, &fPoint);
|
||||||
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
||||||
|
|
|
@ -69,18 +69,18 @@ void VisToolLineIntersectAxis::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(lineP1, *first, supportColor);
|
DrawPoint(lineP1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (point2Id <= NULL_ID)
|
if (point2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(baseLine, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawLine(baseLine, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
|
||||||
DrawPoint(lineP2, *second, supportColor);
|
DrawPoint(lineP2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
const QLineF base_line(*first, *second);
|
const QLineF base_line(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
|
||||||
DrawLine(baseLine, base_line, supportColor);
|
DrawLine(baseLine, base_line, supportColor);
|
||||||
|
|
||||||
if (axisPointId > NULL_ID)
|
if (axisPointId > NULL_ID)
|
||||||
|
@ -89,17 +89,17 @@ void VisToolLineIntersectAxis::RefreshGeometry()
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(axisPointId);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(axisPointId);
|
||||||
if (VFuzzyComparePossibleNulls(angle, -1))
|
if (VFuzzyComparePossibleNulls(angle, -1))
|
||||||
{
|
{
|
||||||
axis = Axis(*third, Visualization::scenePos);
|
axis = Axis(static_cast<QPointF>(*third), Visualization::scenePos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
axis = Axis(*third, angle);
|
axis = Axis(static_cast<QPointF>(*third), angle);
|
||||||
}
|
}
|
||||||
DrawPoint(basePoint, *third, mainColor);
|
DrawPoint(basePoint, static_cast<QPointF>(*third), mainColor);
|
||||||
DrawLine(axisLine, axis, supportColor, Qt::DashLine);
|
DrawLine(axisLine, axis, supportColor, Qt::DashLine);
|
||||||
|
|
||||||
QPointF p = VToolLineIntersectAxis::FindPoint(axis, base_line);
|
QPointF p = VToolLineIntersectAxis::FindPoint(axis, base_line);
|
||||||
QLineF axis_line(*third, p);
|
QLineF axis_line(static_cast<QPointF>(*third), p);
|
||||||
DrawLine(this, axis_line, mainColor, lineStyle);
|
DrawLine(this, axis_line, mainColor, lineStyle);
|
||||||
|
|
||||||
DrawPoint(point, p, mainColor);
|
DrawPoint(point, p, mainColor);
|
||||||
|
|
|
@ -67,11 +67,11 @@ void VisToolNormal::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(lineP1, *first, supportColor);
|
DrawPoint(lineP1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (object2Id <= NULL_ID)
|
if (object2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
QLineF line_mouse(*first, Visualization::scenePos);
|
QLineF line_mouse(static_cast<QPointF>(*first), Visualization::scenePos);
|
||||||
DrawLine(line, line_mouse, supportColor);
|
DrawLine(line, line_mouse, supportColor);
|
||||||
|
|
||||||
QLineF normal = line_mouse.normalVector();
|
QLineF normal = line_mouse.normalVector();
|
||||||
|
@ -81,9 +81,9 @@ void VisToolNormal::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(lineP2, *second, supportColor);
|
DrawPoint(lineP2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
QLineF line_mouse(*first, *second);
|
QLineF line_mouse(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
|
||||||
DrawLine(line, line_mouse, supportColor);
|
DrawLine(line, line_mouse, supportColor);
|
||||||
|
|
||||||
if (qFuzzyIsNull(length))
|
if (qFuzzyIsNull(length))
|
||||||
|
@ -94,8 +94,9 @@ void VisToolNormal::RefreshGeometry()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QPointF fPoint = VToolNormal::FindPoint(*first, *second, length, angle);
|
QPointF fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*first), static_cast<QPointF>(*second),
|
||||||
QLineF mainLine = QLineF(*first, fPoint);
|
length, angle);
|
||||||
|
QLineF mainLine = QLineF(static_cast<QPointF>(*first), fPoint);
|
||||||
DrawLine(this, mainLine, mainColor, lineStyle);
|
DrawLine(this, mainLine, mainColor, lineStyle);
|
||||||
|
|
||||||
DrawPoint(point, mainLine.p2(), mainColor);
|
DrawPoint(point, mainLine.p2(), mainColor);
|
||||||
|
|
|
@ -67,16 +67,17 @@ void VisToolPointFromArcAndTangent::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)// tangent point
|
if (object1Id > NULL_ID)// tangent point
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> tan = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> tan = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(tangent, *tan, supportColor);
|
DrawPoint(tangent, static_cast<QPointF>(*tan), supportColor);
|
||||||
|
|
||||||
if (arcId > NULL_ID)// circle center
|
if (arcId > NULL_ID)// circle center
|
||||||
{
|
{
|
||||||
const QSharedPointer<VArc> arc = Visualization::data->GeometricObject<VArc>(arcId);
|
const QSharedPointer<VArc> arc = Visualization::data->GeometricObject<VArc>(arcId);
|
||||||
DrawPath(arcPath, arc->GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap);
|
DrawPath(arcPath, arc->GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap);
|
||||||
|
|
||||||
FindRays(*tan, arc.data());
|
FindRays(static_cast<QPointF>(*tan), arc.data());
|
||||||
|
|
||||||
const QPointF fPoint = VToolPointFromArcAndTangent::FindPoint(*tan, arc.data(), crossPoint);
|
const QPointF fPoint = VToolPointFromArcAndTangent::FindPoint(static_cast<QPointF>(*tan), arc.data(),
|
||||||
|
crossPoint);
|
||||||
DrawPoint(point, fPoint, mainColor);
|
DrawPoint(point, fPoint, mainColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +99,7 @@ void VisToolPointFromArcAndTangent::setCrossPoint(const CrossCirclesPoint &value
|
||||||
void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc)
|
void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc)
|
||||||
{
|
{
|
||||||
QPointF p1, p2;
|
QPointF p1, p2;
|
||||||
const QPointF center = arc->GetCenter();
|
const QPointF center = static_cast<QPointF>(arc->GetCenter());
|
||||||
const qreal radius = arc->GetRadius();
|
const qreal radius = arc->GetRadius();
|
||||||
const int res = VGObject::ContactPoints (p, center, radius, p1, p2);
|
const int res = VGObject::ContactPoints (p, center, radius, p1, p2);
|
||||||
|
|
||||||
|
|
|
@ -64,21 +64,23 @@ void VisToolPointFromCircleAndTangent::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)// tangent point
|
if (object1Id > NULL_ID)// tangent point
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> tan = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> tan = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(tangent, *tan, supportColor);
|
DrawPoint(tangent, static_cast<QPointF>(*tan), supportColor);
|
||||||
|
|
||||||
if (object2Id > NULL_ID)// circle center
|
if (object2Id > NULL_ID)// circle center
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> center = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const QSharedPointer<VPointF> center = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(cCenter, *center, supportColor);
|
DrawPoint(cCenter, static_cast<QPointF>(*center), supportColor);
|
||||||
|
|
||||||
if (cRadius > 0)
|
if (cRadius > 0)
|
||||||
{
|
{
|
||||||
cPath->setRect(PointRect(cRadius));
|
cPath->setRect(PointRect(cRadius));
|
||||||
DrawPoint(cPath, *center, Qt::darkGreen, Qt::DashLine);
|
DrawPoint(cPath, static_cast<QPointF>(*center), Qt::darkGreen, Qt::DashLine);
|
||||||
|
|
||||||
FindRays(*tan, *center, cRadius);
|
FindRays(static_cast<QPointF>(*tan), static_cast<QPointF>(*center), cRadius);
|
||||||
|
|
||||||
const QPointF fPoint = VToolPointFromCircleAndTangent::FindPoint(*tan, *center, cRadius, crossPoint);
|
const QPointF fPoint = VToolPointFromCircleAndTangent::FindPoint(static_cast<QPointF>(*tan),
|
||||||
|
static_cast<QPointF>(*center),
|
||||||
|
cRadius, crossPoint);
|
||||||
DrawPoint(point, fPoint, mainColor);
|
DrawPoint(point, fPoint, mainColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,17 +65,17 @@ void VisToolPointOfContact::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(lineP1, *first, supportColor);
|
DrawPoint(lineP1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (lineP2Id <= NULL_ID)
|
if (lineP2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(this, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawLine(this, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP2Id);
|
||||||
DrawPoint(lineP2, *second, supportColor);
|
DrawPoint(lineP2, static_cast<QPointF>(*second), supportColor);
|
||||||
DrawLine(this, QLineF(*first, *second), supportColor);
|
DrawLine(this, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor);
|
||||||
|
|
||||||
if (radiusId <= NULL_ID)
|
if (radiusId <= NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -84,15 +84,17 @@ void VisToolPointOfContact::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(radiusId);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(radiusId);
|
||||||
DrawPoint(arc_point, *third, supportColor);
|
DrawPoint(arc_point, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(radius))
|
if (not qFuzzyIsNull(radius))
|
||||||
{
|
{
|
||||||
QPointF fPoint = VToolPointOfContact::FindPoint(radius, *third, *first, *second);
|
QPointF fPoint = VToolPointOfContact::FindPoint(radius, static_cast<QPointF>(*third),
|
||||||
|
static_cast<QPointF>(*first),
|
||||||
|
static_cast<QPointF>(*second));
|
||||||
DrawPoint(point, fPoint, mainColor);
|
DrawPoint(point, fPoint, mainColor);
|
||||||
|
|
||||||
circle->setRect(PointRect(radius));
|
circle->setRect(PointRect(radius));
|
||||||
DrawPoint(circle, *third, supportColor, Qt::DashLine);
|
DrawPoint(circle, static_cast<QPointF>(*third), supportColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,9 +69,9 @@ void VisToolPointOfIntersection::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(axisP1, *first, supportColor);
|
DrawPoint(axisP1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
axisL1 = Axis(*first, 90);
|
axisL1 = Axis(static_cast<QPointF>(*first), 90);
|
||||||
DrawLine(this, axisL1, supportColor, Qt::DashLine);
|
DrawLine(this, axisL1, supportColor, Qt::DashLine);
|
||||||
|
|
||||||
QLineF axisL2;
|
QLineF axisL2;
|
||||||
|
@ -83,8 +83,8 @@ void VisToolPointOfIntersection::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
|
||||||
DrawPoint(axisP2, *second, supportColor);
|
DrawPoint(axisP2, static_cast<QPointF>(*second), supportColor);
|
||||||
axisL2 = Axis(*second, 180);
|
axisL2 = Axis(static_cast<QPointF>(*second), 180);
|
||||||
ShowIntersection(axisL1, axisL2, mainColor);
|
ShowIntersection(axisL1, axisL2, mainColor);
|
||||||
}
|
}
|
||||||
DrawLine(axis2, axisL2, supportColor, Qt::DashLine);
|
DrawLine(axis2, axisL2, supportColor, Qt::DashLine);
|
||||||
|
|
|
@ -69,23 +69,24 @@ void VisToolPointOfIntersectionCircles::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(c1Center, *first, supportColor);
|
DrawPoint(c1Center, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (object2Id > NULL_ID)
|
if (object2Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(c2Center, *second, supportColor);
|
DrawPoint(c2Center, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
if (c1Radius > 0 && c2Radius > 0)
|
if (c1Radius > 0 && c2Radius > 0)
|
||||||
{
|
{
|
||||||
c1Path->setRect(PointRect(c1Radius));
|
c1Path->setRect(PointRect(c1Radius));
|
||||||
DrawPoint(c1Path, *first, Qt::darkGreen, Qt::DashLine);
|
DrawPoint(c1Path, static_cast<QPointF>(*first), Qt::darkGreen, Qt::DashLine);
|
||||||
|
|
||||||
c2Path->setRect(PointRect(c2Radius));
|
c2Path->setRect(PointRect(c2Radius));
|
||||||
DrawPoint(c2Path, *second, Qt::darkRed, Qt::DashLine);
|
DrawPoint(c2Path, static_cast<QPointF>(*second), Qt::darkRed, Qt::DashLine);
|
||||||
|
|
||||||
const QPointF fPoint = VToolPointOfIntersectionCircles::FindPoint(*first, *second, c1Radius,
|
const QPointF fPoint = VToolPointOfIntersectionCircles::FindPoint(static_cast<QPointF>(*first),
|
||||||
c2Radius, crossPoint);
|
static_cast<QPointF>(*second),
|
||||||
|
c1Radius, c2Radius, crossPoint);
|
||||||
DrawPoint(point, fPoint, mainColor);
|
DrawPoint(point, fPoint, mainColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,44 +69,48 @@ void VisToolShoulderPoint::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(line1P1, *first, supportColor);
|
DrawPoint(line1P1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (lineP1Id <= NULL_ID)
|
if (lineP1Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(line1, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawLine(line1, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP1Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP1Id);
|
||||||
DrawPoint(line1P2, *second, supportColor);
|
DrawPoint(line1P2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
DrawLine(line1, QLineF(*first, *second), supportColor);
|
DrawLine(line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor);
|
||||||
|
|
||||||
if (lineP2Id <= NULL_ID)
|
if (lineP2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(line2, QLineF(*second, Visualization::scenePos), supportColor);
|
DrawLine(line2, QLineF(static_cast<QPointF>(*second), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(lineP2Id);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(lineP2Id);
|
||||||
DrawPoint(line2P2, *third, supportColor);
|
DrawPoint(line2P2, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
DrawLine(line2, QLineF(*second, *third), supportColor);
|
DrawLine(line2, QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third)), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(length))
|
if (not qFuzzyIsNull(length))
|
||||||
{
|
{
|
||||||
QPointF fPoint = VToolShoulderPoint::FindPoint(*second, *third, *first, length);
|
QPointF fPoint = VToolShoulderPoint::FindPoint(static_cast<QPointF>(*second),
|
||||||
QLineF mainLine = QLineF(*second, fPoint);
|
static_cast<QPointF>(*third),
|
||||||
|
static_cast<QPointF>(*first), length);
|
||||||
|
QLineF mainLine = QLineF(static_cast<QPointF>(*second), fPoint);
|
||||||
DrawLine(this, mainLine, mainColor, lineStyle);
|
DrawLine(this, mainLine, mainColor, lineStyle);
|
||||||
|
|
||||||
DrawPoint(point, mainLine.p2(), mainColor);
|
DrawPoint(point, mainLine.p2(), mainColor);
|
||||||
DrawLine(line3, QLineF(*first, mainLine.p2()), supportColor, Qt::DashLine);
|
DrawLine(line3, QLineF(static_cast<QPointF>(*first), mainLine.p2()), supportColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qreal angle = QLineF(*second, *third).angle();
|
qreal angle = QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third)).angle();
|
||||||
QPointF endRay = Ray(*second, angle);
|
QPointF endRay = Ray(static_cast<QPointF>(*second), angle);
|
||||||
QLineF mainLine = VGObject::BuildLine(*second, QLineF(*second, endRay).length(), angle);
|
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second),
|
||||||
|
QLineF(static_cast<QPointF>(*second), endRay).length(),
|
||||||
|
angle);
|
||||||
DrawLine(this, mainLine, mainColor, lineStyle);
|
DrawLine(this, mainLine, mainColor, lineStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,18 +72,18 @@ void VisToolTriangle::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(axisP1, *first, supportColor);
|
DrawPoint(axisP1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (object2Id <= NULL_ID)
|
if (object2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawAimedAxis(axis, QLineF(*first, Visualization::scenePos), supportColor);
|
DrawAimedAxis(axis, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(axisP2, *second, supportColor);
|
DrawPoint(axisP2, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
DrawAimedAxis(axis, QLineF(*first, *second), supportColor);
|
DrawAimedAxis(axis, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor);
|
||||||
|
|
||||||
if (hypotenuseP1Id <= NULL_ID)
|
if (hypotenuseP1Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -92,30 +92,37 @@ void VisToolTriangle::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(hypotenuseP1Id);
|
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(hypotenuseP1Id);
|
||||||
DrawPoint(hypotenuseP1, *third, supportColor);
|
DrawPoint(hypotenuseP1, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
if (hypotenuseP2Id <= NULL_ID)
|
if (hypotenuseP2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(this, QLineF(*third, Visualization::scenePos), supportColor, Qt::DashLine);
|
DrawLine(this, QLineF(static_cast<QPointF>(*third), Visualization::scenePos), supportColor,
|
||||||
|
Qt::DashLine);
|
||||||
|
|
||||||
QPointF trPoint = VToolTriangle::FindPoint(*first, *second, *third, Visualization::scenePos);
|
QPointF trPoint = VToolTriangle::FindPoint(static_cast<QPointF>(*first),
|
||||||
|
static_cast<QPointF>(*second),
|
||||||
|
static_cast<QPointF>(*third), Visualization::scenePos);
|
||||||
DrawPoint(point, trPoint, mainColor);
|
DrawPoint(point, trPoint, mainColor);
|
||||||
|
|
||||||
DrawLine(foot1, QLineF(*third, trPoint), supportColor, Qt::DashLine);
|
DrawLine(foot1, QLineF(static_cast<QPointF>(*third), trPoint), supportColor, Qt::DashLine);
|
||||||
DrawLine(foot2, QLineF(Visualization::scenePos, trPoint), supportColor, Qt::DashLine);
|
DrawLine(foot2, QLineF(Visualization::scenePos, trPoint), supportColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> forth = Visualization::data->GeometricObject<VPointF>(hypotenuseP2Id);
|
const QSharedPointer<VPointF> forth = Visualization::data->GeometricObject<VPointF>(hypotenuseP2Id);
|
||||||
DrawPoint(hypotenuseP2, *forth, supportColor);
|
DrawPoint(hypotenuseP2, static_cast<QPointF>(*forth), supportColor);
|
||||||
|
|
||||||
DrawLine(this, QLineF(*third, *forth), supportColor, Qt::DashLine);
|
DrawLine(this, QLineF(static_cast<QPointF>(*third), static_cast<QPointF>(*forth)), supportColor,
|
||||||
|
Qt::DashLine);
|
||||||
|
|
||||||
QPointF trPoint = VToolTriangle::FindPoint(*first, *second, *third, *forth);
|
QPointF trPoint = VToolTriangle::FindPoint(static_cast<QPointF>(*first),
|
||||||
|
static_cast<QPointF>(*second),
|
||||||
|
static_cast<QPointF>(*third),
|
||||||
|
static_cast<QPointF>(*forth));
|
||||||
DrawPoint(point, trPoint, mainColor);
|
DrawPoint(point, trPoint, mainColor);
|
||||||
|
|
||||||
DrawLine(foot1, QLineF(*third, trPoint), supportColor, Qt::DashLine);
|
DrawLine(foot1, QLineF(static_cast<QPointF>(*third), trPoint), supportColor, Qt::DashLine);
|
||||||
DrawLine(foot2, QLineF(*forth, trPoint), supportColor, Qt::DashLine);
|
DrawLine(foot2, QLineF(static_cast<QPointF>(*forth), trPoint), supportColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,51 +86,54 @@ void VisToolTrueDarts::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> blP1 = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> blP1 = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(baseLineP1, *blP1, supportColor);
|
DrawPoint(baseLineP1, static_cast<QPointF>(*blP1), supportColor);
|
||||||
|
|
||||||
if (baseLineP2Id <= NULL_ID)
|
if (baseLineP2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(this, QLineF(*blP1, Visualization::scenePos), supportColor, Qt::DashLine);
|
DrawLine(this, QLineF(static_cast<QPointF>(*blP1), Visualization::scenePos), supportColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> blP2 = Visualization::data->GeometricObject<VPointF>(baseLineP2Id);
|
const QSharedPointer<VPointF> blP2 = Visualization::data->GeometricObject<VPointF>(baseLineP2Id);
|
||||||
DrawPoint(baseLineP2, *blP2, supportColor);
|
DrawPoint(baseLineP2, static_cast<QPointF>(*blP2), supportColor);
|
||||||
DrawLine(this, QLineF(*blP1, *blP2), supportColor, Qt::DashLine);
|
DrawLine(this, QLineF(static_cast<QPointF>(*blP1), static_cast<QPointF>(*blP2)), supportColor,
|
||||||
|
Qt::DashLine);
|
||||||
|
|
||||||
if (dartP1Id > NULL_ID)
|
if (dartP1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> d1 = Visualization::data->GeometricObject<VPointF>(dartP1Id);
|
const QSharedPointer<VPointF> d1 = Visualization::data->GeometricObject<VPointF>(dartP1Id);
|
||||||
DrawPoint(dartP1, *d1, supportColor);
|
DrawPoint(dartP1, static_cast<QPointF>(*d1), supportColor);
|
||||||
|
|
||||||
if (dartP2Id <= NULL_ID)
|
if (dartP2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(p1d2, QLineF(*d1, Visualization::scenePos), supportColor);
|
DrawLine(p1d2, QLineF(static_cast<QPointF>(*d1), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> d2 = Visualization::data->GeometricObject<VPointF>(dartP2Id);
|
const QSharedPointer<VPointF> d2 = Visualization::data->GeometricObject<VPointF>(dartP2Id);
|
||||||
DrawPoint(dartP2, *d2, supportColor);
|
DrawPoint(dartP2, static_cast<QPointF>(*d2), supportColor);
|
||||||
DrawLine(p1d2, QLineF(*d1, *d2), supportColor);
|
DrawLine(p1d2, QLineF(static_cast<QPointF>(*d1), static_cast<QPointF>(*d2)), supportColor);
|
||||||
|
|
||||||
if (dartP3Id <= NULL_ID)
|
if (dartP3Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(d2p2, QLineF(*d2, Visualization::scenePos), supportColor);
|
DrawLine(d2p2, QLineF(static_cast<QPointF>(*d2), Visualization::scenePos), supportColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> d3 = Visualization::data->GeometricObject<VPointF>(dartP3Id);
|
const QSharedPointer<VPointF> d3 = Visualization::data->GeometricObject<VPointF>(dartP3Id);
|
||||||
DrawPoint(dartP3, *d3, supportColor);
|
DrawPoint(dartP3, static_cast<QPointF>(*d3), supportColor);
|
||||||
DrawLine(d2p2, QLineF(*d2, *d3), supportColor);
|
DrawLine(d2p2, QLineF(static_cast<QPointF>(*d2), static_cast<QPointF>(*d3)), supportColor);
|
||||||
|
|
||||||
QPointF p1;
|
QPointF p1;
|
||||||
QPointF p2;
|
QPointF p2;
|
||||||
VToolTrueDarts::FindPoint(*blP1, *blP2, *d1, *d2, *d3, p1, p2);
|
VToolTrueDarts::FindPoint(static_cast<QPointF>(*blP1), static_cast<QPointF>(*blP2),
|
||||||
|
static_cast<QPointF>(*d1), static_cast<QPointF>(*d2),
|
||||||
|
static_cast<QPointF>(*d3), p1, p2);
|
||||||
|
|
||||||
DrawLine(lineblP1P1, QLineF(*blP1, p1), supportColor);
|
DrawLine(lineblP1P1, QLineF(static_cast<QPointF>(*blP1), p1), supportColor);
|
||||||
DrawLine(lineblP2P2, QLineF(*blP2, p2), supportColor);
|
DrawLine(lineblP2P2, QLineF(static_cast<QPointF>(*blP2), p2), supportColor);
|
||||||
DrawLine(p1d2, QLineF(p1, *d2), supportColor);
|
DrawLine(p1d2, QLineF(p1, static_cast<QPointF>(*d2)), supportColor);
|
||||||
DrawLine(d2p2, QLineF(*d2, p2), supportColor);
|
DrawLine(d2p2, QLineF(static_cast<QPointF>(*d2), p2), supportColor);
|
||||||
|
|
||||||
DrawPoint(point1, p1, mainColor);
|
DrawPoint(point1, p1, mainColor);
|
||||||
DrawPoint(point2, p2, mainColor);
|
DrawPoint(point2, p2, mainColor);
|
||||||
|
|
|
@ -59,7 +59,7 @@ void VisToolArc::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(arcCenter, *first, supportColor);
|
DrawPoint(arcCenter, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(radius) && f1 >= 0 && f2 >= 0)
|
if (not qFuzzyIsNull(radius) && f1 >= 0 && f2 >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ void VisToolArcWithLength::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(arcCenter, *first, supportColor);
|
DrawPoint(arcCenter, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(radius) && f1 >= 0 && not qFuzzyIsNull(length))
|
if (not qFuzzyIsNull(radius) && f1 >= 0 && not qFuzzyIsNull(length))
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,17 +77,18 @@ void VisToolCubicBezier::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const auto first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const auto first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(point1, *first, Qt::DashLine);
|
DrawPoint(point1, static_cast<QPointF>(*first), Qt::DashLine);
|
||||||
|
|
||||||
if (object2Id <= NULL_ID)
|
if (object2Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
DrawLine(helpLine1, QLineF(*first, Visualization::scenePos), mainColor, Qt::DashLine);
|
DrawLine(helpLine1, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), mainColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
const auto second = Visualization::data->GeometricObject<VPointF>(object2Id);
|
||||||
DrawPoint(point2, *second, supportColor);
|
DrawPoint(point2, static_cast<QPointF>(*second), supportColor);
|
||||||
DrawLine(helpLine1, QLineF(*first, *second), mainColor, Qt::DashLine);
|
DrawLine(helpLine1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), mainColor,
|
||||||
|
Qt::DashLine);
|
||||||
|
|
||||||
if (object3Id <= NULL_ID)
|
if (object3Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -98,19 +99,21 @@ void VisToolCubicBezier::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto third = Visualization::data->GeometricObject<VPointF>(object3Id);
|
const auto third = Visualization::data->GeometricObject<VPointF>(object3Id);
|
||||||
DrawPoint(point3, *third, supportColor);
|
DrawPoint(point3, static_cast<QPointF>(*third), supportColor);
|
||||||
|
|
||||||
if (object4Id <= NULL_ID)
|
if (object4Id <= NULL_ID)
|
||||||
{
|
{
|
||||||
VCubicBezier spline(*first, *second, *third, VPointF(Visualization::scenePos));
|
VCubicBezier spline(*first, *second, *third, VPointF(Visualization::scenePos));
|
||||||
DrawPath(this, spline.GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap);
|
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<QPointF>(*third), Visualization::scenePos), mainColor,
|
||||||
|
Qt::DashLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto fourth = Visualization::data->GeometricObject<VPointF>(object4Id);
|
const auto fourth = Visualization::data->GeometricObject<VPointF>(object4Id);
|
||||||
DrawPoint(point4, *fourth, supportColor);
|
DrawPoint(point4, static_cast<QPointF>(*fourth), supportColor);
|
||||||
DrawLine(helpLine2, QLineF(*fourth, *third), mainColor, Qt::DashLine);
|
DrawLine(helpLine2, QLineF(static_cast<QPointF>(*fourth), static_cast<QPointF>(*third)), mainColor,
|
||||||
|
Qt::DashLine);
|
||||||
|
|
||||||
VCubicBezier spline(*first, *second, *third, *fourth);
|
VCubicBezier spline(*first, *second, *third, *fourth);
|
||||||
DrawPath(this, spline.GetPath(PathDirection::Show), mainColor, Qt::SolidLine, Qt::RoundCap);
|
DrawPath(this, spline.GetPath(PathDirection::Show), mainColor, Qt::SolidLine, Qt::RoundCap);
|
||||||
|
|
|
@ -78,7 +78,7 @@ void VisToolCubicBezierPath::RefreshGeometry()
|
||||||
for (int i = 0; i < size; ++i)
|
for (int i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
QGraphicsEllipseItem *point = this->getPoint(mainPoints, static_cast<unsigned>(i), 1/*zValue*/);
|
QGraphicsEllipseItem *point = this->getPoint(mainPoints, static_cast<unsigned>(i), 1/*zValue*/);
|
||||||
DrawPoint(point, pathPoints.at(i), supportColor);
|
DrawPoint(point, static_cast<QPointF>(pathPoints.at(i)), supportColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == Mode::Creation)
|
if (mode == Mode::Creation)
|
||||||
|
@ -106,16 +106,18 @@ void VisToolCubicBezierPath::RefreshGeometry()
|
||||||
const VSpline spl = path.GetSpline(i);
|
const VSpline spl = path.GetSpline(i);
|
||||||
|
|
||||||
QGraphicsLineItem *ctrlLine1 = this->getLine(static_cast<unsigned>(preLastPoint));
|
QGraphicsLineItem *ctrlLine1 = this->getLine(static_cast<unsigned>(preLastPoint));
|
||||||
DrawLine(ctrlLine1, QLineF(spl.GetP1(), spl.GetP2()), mainColor, Qt::DashLine);
|
DrawLine(ctrlLine1, QLineF(static_cast<QPointF>(spl.GetP1()), static_cast<QPointF>(spl.GetP2())),
|
||||||
|
mainColor, Qt::DashLine);
|
||||||
|
|
||||||
QGraphicsEllipseItem *p2 = this->getPoint(ctrlPoints, static_cast<unsigned>(preLastPoint));
|
QGraphicsEllipseItem *p2 = this->getPoint(ctrlPoints, static_cast<unsigned>(preLastPoint));
|
||||||
DrawPoint(p2, spl.GetP2(), Qt::green);
|
DrawPoint(p2, static_cast<QPointF>(spl.GetP2()), Qt::green);
|
||||||
|
|
||||||
QGraphicsLineItem *ctrlLine2 = this->getLine(static_cast<unsigned>(lastPoint));
|
QGraphicsLineItem *ctrlLine2 = this->getLine(static_cast<unsigned>(lastPoint));
|
||||||
DrawLine(ctrlLine2, QLineF(spl.GetP4(), spl.GetP3()), mainColor, Qt::DashLine);
|
DrawLine(ctrlLine2, QLineF(static_cast<QPointF>(spl.GetP4()), static_cast<QPointF>(spl.GetP3())),
|
||||||
|
mainColor, Qt::DashLine);
|
||||||
|
|
||||||
QGraphicsEllipseItem *p3 = this->getPoint(ctrlPoints, static_cast<unsigned>(lastPoint));
|
QGraphicsEllipseItem *p3 = this->getPoint(ctrlPoints, static_cast<unsigned>(lastPoint));
|
||||||
DrawPoint(p3, spl.GetP3(), Qt::green);
|
DrawPoint(p3, static_cast<QPointF>(spl.GetP3()), Qt::green);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,8 +195,8 @@ void VisToolCubicBezierPath::Creating(const QVector<VPointF> &pathPoints, int po
|
||||||
const VPointF p1 = pathPoints.last();
|
const VPointF p1 = pathPoints.last();
|
||||||
if (pathPoints.size() >= 4)
|
if (pathPoints.size() >= 4)
|
||||||
{
|
{
|
||||||
QLineF p1p2(p1, Visualization::scenePos);
|
QLineF p1p2(static_cast<QPointF>(p1), Visualization::scenePos);
|
||||||
QLineF prP3p1(pathPoints.at(size-2), p1);
|
QLineF prP3p1(static_cast<QPointF>(pathPoints.at(size-2)), static_cast<QPointF>(p1));
|
||||||
p1p2.setAngle(prP3p1.angle());
|
p1p2.setAngle(prP3p1.angle());
|
||||||
|
|
||||||
const QPointF p2 = p1p2.p2();
|
const QPointF p2 = p1p2.p2();
|
||||||
|
@ -210,24 +212,25 @@ void VisToolCubicBezierPath::Creating(const QVector<VPointF> &pathPoints, int po
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawLine(helpLine1, QLineF(p1, Visualization::scenePos), mainColor, Qt::DashLine);
|
DrawLine(helpLine1, QLineF(static_cast<QPointF>(p1), Visualization::scenePos), mainColor, Qt::DashLine);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
const VPointF p1 = pathPoints.at(subSplPoints + pointsLeft-1);
|
const VPointF p1 = pathPoints.at(subSplPoints + pointsLeft-1);
|
||||||
QPointF p2 = pathPoints.at(subSplPoints + pointsLeft);
|
QPointF p2 = static_cast<QPointF>(pathPoints.at(subSplPoints + pointsLeft));
|
||||||
|
|
||||||
if (subSplCount >= 1)
|
if (subSplCount >= 1)
|
||||||
{
|
{
|
||||||
QLineF p1p2(p1, p2);
|
QLineF p1p2(static_cast<QPointF>(p1), p2);
|
||||||
QLineF prP3p1(pathPoints.at(subSplPoints + pointsLeft-2), p1);
|
QLineF prP3p1(static_cast<QPointF>(pathPoints.at(subSplPoints + pointsLeft-2)),
|
||||||
|
static_cast<QPointF>(p1));
|
||||||
p1p2.setAngle(prP3p1.angle());
|
p1p2.setAngle(prP3p1.angle());
|
||||||
p2 = p1p2.p2();
|
p2 = p1p2.p2();
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawLine(helpLine1, QLineF(p1, p2), mainColor, Qt::DashLine);
|
DrawLine(helpLine1, QLineF(static_cast<QPointF>(p1), p2), mainColor, Qt::DashLine);
|
||||||
|
|
||||||
VSpline spline(p1, p2, Visualization::scenePos, VPointF(Visualization::scenePos));
|
VSpline spline(p1, p2, Visualization::scenePos, VPointF(Visualization::scenePos));
|
||||||
DrawPath(newCurveSegment, spline.GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap);
|
DrawPath(newCurveSegment, spline.GetPath(PathDirection::Hide), mainColor, Qt::SolidLine, Qt::RoundCap);
|
||||||
|
@ -240,18 +243,19 @@ void VisToolCubicBezierPath::Creating(const QVector<VPointF> &pathPoints, int po
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
const VPointF p1 = pathPoints.at(subSplPoints + pointsLeft-2);
|
const VPointF p1 = pathPoints.at(subSplPoints + pointsLeft-2);
|
||||||
QPointF p2 = pathPoints.at(subSplPoints + pointsLeft-1);
|
QPointF p2 = static_cast<QPointF>(pathPoints.at(subSplPoints + pointsLeft-1));
|
||||||
const QPointF p3 = pathPoints.at(subSplPoints + pointsLeft);
|
const QPointF p3 = static_cast<QPointF>(pathPoints.at(subSplPoints + pointsLeft));
|
||||||
|
|
||||||
if (subSplCount >= 1)
|
if (subSplCount >= 1)
|
||||||
{
|
{
|
||||||
QLineF p1p2(p1, p2);
|
QLineF p1p2(static_cast<QPointF>(p1), p2);
|
||||||
QLineF prP3p1(pathPoints.at(subSplPoints + pointsLeft-3), p1);
|
QLineF prP3p1(static_cast<QPointF>(pathPoints.at(subSplPoints + pointsLeft-3)),
|
||||||
|
static_cast<QPointF>(p1));
|
||||||
p1p2.setAngle(prP3p1.angle());
|
p1p2.setAngle(prP3p1.angle());
|
||||||
p2 = p1p2.p2();
|
p2 = p1p2.p2();
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawLine(helpLine1, QLineF(p1, p2), mainColor, Qt::DashLine);
|
DrawLine(helpLine1, QLineF(static_cast<QPointF>(p1), p2), mainColor, Qt::DashLine);
|
||||||
DrawLine(helpLine2, QLineF(p3, Visualization::scenePos), mainColor, Qt::DashLine);
|
DrawLine(helpLine2, QLineF(p3, Visualization::scenePos), mainColor, Qt::DashLine);
|
||||||
|
|
||||||
VSpline spline(p1, p2, p3, VPointF(Visualization::scenePos));
|
VSpline spline(p1, p2, p3, VPointF(Visualization::scenePos));
|
||||||
|
|
|
@ -79,8 +79,8 @@ void VisToolCutSpline::RefreshGeometry()
|
||||||
QPointF spl2p3;
|
QPointF spl2p3;
|
||||||
const QPointF p = spl->CutSpline (length, spl1p2, spl1p3, spl2p2, spl2p3 );
|
const QPointF p = spl->CutSpline (length, spl1p2, spl1p3, spl2p2, spl2p3 );
|
||||||
|
|
||||||
const VSpline sp1 = VSpline(spl->GetP1(), spl1p2, spl1p3, p);
|
const VSpline sp1 = VSpline(spl->GetP1(), spl1p2, spl1p3, VPointF(p));
|
||||||
const VSpline sp2 = VSpline(p, spl2p2, spl2p3, spl->GetP4());
|
const VSpline sp2 = VSpline(VPointF(p), spl2p2, spl2p3, spl->GetP4());
|
||||||
|
|
||||||
DrawPoint(point, p, mainColor);
|
DrawPoint(point, p, mainColor);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ void VisToolCutSplinePath::RefreshGeometry()
|
||||||
SCASSERT(spPath1 != nullptr)
|
SCASSERT(spPath1 != nullptr)
|
||||||
SCASSERT(spPath2 != nullptr)
|
SCASSERT(spPath2 != nullptr)
|
||||||
|
|
||||||
DrawPoint(point, *p, mainColor);
|
DrawPoint(point, static_cast<QPointF>(*p), mainColor);
|
||||||
delete p;
|
delete p;
|
||||||
|
|
||||||
DrawPath(splPath1, spPath1->GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap);
|
DrawPath(splPath1, spPath1->GetPath(PathDirection::Show), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap);
|
||||||
|
|
|
@ -56,7 +56,7 @@ void VisToolEllipticalArc::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(arcCenter, *first, supportColor);
|
DrawPoint(arcCenter, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (not qFuzzyIsNull(radius1) && not qFuzzyIsNull(radius2) && f1 >= 0 && f2 >= 0 && rotationAngle >= 0)
|
if (not qFuzzyIsNull(radius1) && not qFuzzyIsNull(radius2) && f1 >= 0 && f2 >= 0 && rotationAngle >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,24 +91,25 @@ void VisToolSpline::RefreshGeometry()
|
||||||
if (object1Id > NULL_ID)
|
if (object1Id > NULL_ID)
|
||||||
{
|
{
|
||||||
const auto first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
const auto first = Visualization::data->GeometricObject<VPointF>(object1Id);
|
||||||
DrawPoint(point1, *first, supportColor);
|
DrawPoint(point1, static_cast<QPointF>(*first), supportColor);
|
||||||
|
|
||||||
if (mode == Mode::Creation)
|
if (mode == Mode::Creation)
|
||||||
{
|
{
|
||||||
if (isLeftMousePressed && not p2Selected)
|
if (isLeftMousePressed && not p2Selected)
|
||||||
{
|
{
|
||||||
p2 = Visualization::scenePos;
|
p2 = Visualization::scenePos;
|
||||||
controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, p2, *first);
|
controlPoints[0]->RefreshCtrlPoint(1, SplinePointPosition::FirstPoint, p2,
|
||||||
|
static_cast<QPointF>(*first));
|
||||||
|
|
||||||
if (not controlPoints[0]->isVisible())
|
if (not controlPoints[0]->isVisible())
|
||||||
{
|
{
|
||||||
if (QLineF(*first, p2).length() > radius)
|
if (QLineF(static_cast<QPointF>(*first), p2).length() > radius)
|
||||||
{
|
{
|
||||||
controlPoints[0]->show();
|
controlPoints[0]->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p2 = *first;
|
p2 = static_cast<QPointF>(*first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,26 +127,27 @@ void VisToolSpline::RefreshGeometry()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto second = Visualization::data->GeometricObject<VPointF>(object4Id);
|
const auto second = Visualization::data->GeometricObject<VPointF>(object4Id);
|
||||||
DrawPoint(point4, *second, supportColor);
|
DrawPoint(point4, static_cast<QPointF>(*second), supportColor);
|
||||||
|
|
||||||
if (mode == Mode::Creation)
|
if (mode == Mode::Creation)
|
||||||
{
|
{
|
||||||
if (isLeftMousePressed && not p3Selected)
|
if (isLeftMousePressed && not p3Selected)
|
||||||
{
|
{
|
||||||
QLineF ctrlLine (*second, Visualization::scenePos);
|
QLineF ctrlLine (static_cast<QPointF>(*second), Visualization::scenePos);
|
||||||
ctrlLine.setAngle(ctrlLine.angle()+180);
|
ctrlLine.setAngle(ctrlLine.angle()+180);
|
||||||
p3 = ctrlLine.p2();
|
p3 = ctrlLine.p2();
|
||||||
controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, p3, *second);
|
controlPoints[1]->RefreshCtrlPoint(1, SplinePointPosition::LastPoint, p3,
|
||||||
|
static_cast<QPointF>(*second));
|
||||||
|
|
||||||
if (not controlPoints[1]->isVisible())
|
if (not controlPoints[1]->isVisible())
|
||||||
{
|
{
|
||||||
if (QLineF(*second, p3).length() > radius)
|
if (QLineF(static_cast<QPointF>(*second), p3).length() > radius)
|
||||||
{
|
{
|
||||||
controlPoints[1]->show();
|
controlPoints[1]->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p3 = *second;
|
p3 = static_cast<QPointF>(*second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ void VisToolSplinePath::RefreshGeometry()
|
||||||
for (int i = 0; i < size; ++i)
|
for (int i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
QGraphicsEllipseItem *point = this->getPoint(static_cast<unsigned>(i));
|
QGraphicsEllipseItem *point = this->getPoint(static_cast<unsigned>(i));
|
||||||
DrawPoint(point, pathPoints.at(i).P(), supportColor);
|
DrawPoint(point, static_cast<QPointF>(pathPoints.at(i).P()), supportColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == Mode::Creation)
|
if (mode == Mode::Creation)
|
||||||
|
@ -92,14 +92,16 @@ void VisToolSplinePath::RefreshGeometry()
|
||||||
|
|
||||||
VSpline spl = path.GetSpline(i);
|
VSpline spl = path.GetSpline(i);
|
||||||
|
|
||||||
ctrlPoints[preLastPoint]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint, spl.GetP2(),
|
ctrlPoints[preLastPoint]->RefreshCtrlPoint(i, SplinePointPosition::FirstPoint,
|
||||||
spl.GetP1());
|
static_cast<QPointF>(spl.GetP2()),
|
||||||
ctrlPoints[lastPoint]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint, spl.GetP3(),
|
static_cast<QPointF>(spl.GetP1()));
|
||||||
spl.GetP4());
|
ctrlPoints[lastPoint]->RefreshCtrlPoint(i, SplinePointPosition::LastPoint,
|
||||||
|
static_cast<QPointF>(spl.GetP3()),
|
||||||
|
static_cast<QPointF>(spl.GetP4()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Creating(pathPoints.at(size-1).P(), size);
|
Creating(static_cast<QPointF>(pathPoints.at(size-1).P()), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size > 1)
|
if (size > 1)
|
||||||
|
@ -270,7 +272,7 @@ void VisToolSplinePath::Creating(const QPointF &pSpl, int size)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const VSpline spl = path.GetSpline(size - 1);
|
const VSpline spl = path.GetSpline(size - 1);
|
||||||
VSpline preSpl(spl.GetP1(), spl.GetP2(), ctrlLine.p2(), VPointF(pSpl));
|
VSpline preSpl(spl.GetP1(), static_cast<QPointF>(spl.GetP2()), ctrlLine.p2(), VPointF(pSpl));
|
||||||
|
|
||||||
path[size-1].SetAngle2(spline.GetStartAngle(), spline.GetStartAngleFormula());
|
path[size-1].SetAngle2(spline.GetStartAngle(), spline.GetStartAngleFormula());
|
||||||
if (ctrlPoint != pSpl)
|
if (ctrlPoint != pSpl)
|
||||||
|
|
|
@ -144,7 +144,7 @@ void VSimplePoint::RefreshGeometry(const VPointF &point)
|
||||||
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
||||||
rec.translate(-rec.center().x(), -rec.center().y());
|
rec.translate(-rec.center().x(), -rec.center().y());
|
||||||
this->setRect(rec);
|
this->setRect(rec);
|
||||||
this->setPos(point);
|
this->setPos(static_cast<QPointF>(point));
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
namePoint->blockSignals(true);
|
namePoint->blockSignals(true);
|
||||||
QFont font = namePoint->font();
|
QFont font = namePoint->font();
|
||||||
|
|
|
@ -181,7 +181,7 @@ void TST_VArc::TestGetPoints()
|
||||||
|
|
||||||
for (int i=0; i < points.size(); ++i)
|
for (int i=0; i < points.size(); ++i)
|
||||||
{
|
{
|
||||||
QLineF rLine(center, points.at(i));
|
QLineF rLine(static_cast<QPointF>(center), points.at(i));
|
||||||
const qreal value = qAbs(rLine.length() - radius);
|
const qreal value = qAbs(rLine.length() - radius);
|
||||||
const QString errorMsg = QString("Broken the first rule. All points should be on the same distance from "
|
const QString errorMsg = QString("Broken the first rule. All points should be on the same distance from "
|
||||||
"the center. Error ='%1'.").arg(value);
|
"the center. Error ='%1'.").arg(value);
|
||||||
|
@ -199,7 +199,7 @@ void TST_VArc::TestGetPoints()
|
||||||
else
|
else
|
||||||
{// sector square
|
{// sector square
|
||||||
gSquere = (M_PI * radius * radius) / 360.0 * arc.AngleArc();
|
gSquere = (M_PI * radius * radius) / 360.0 * arc.AngleArc();
|
||||||
points.append(center);
|
points.append(static_cast<QPointF>(center));
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculated square
|
// calculated square
|
||||||
|
@ -305,7 +305,7 @@ void TST_VArc::TestFlip()
|
||||||
QFETCH(QLineF, axis);
|
QFETCH(QLineF, axis);
|
||||||
QFETCH(QString, prefix);
|
QFETCH(QString, prefix);
|
||||||
|
|
||||||
VArc originArc(center, radius, startAngle, endAngle);
|
VArc originArc(VPointF(center), radius, startAngle, endAngle);
|
||||||
const VArc res = originArc.Flip(axis, prefix);
|
const VArc res = originArc.Flip(axis, prefix);
|
||||||
|
|
||||||
const QString errorMsg = QString("The name doesn't contain the prefix '%1'.").arg(prefix);
|
const QString errorMsg = QString("The name doesn't contain the prefix '%1'.").arg(prefix);
|
||||||
|
|
|
@ -300,13 +300,13 @@ void TST_VEllipticalArc::TestGetPoints2()
|
||||||
const qreal c = qSqrt(qAbs(radius2*radius2 - radius1*radius1));
|
const qreal c = qSqrt(qAbs(radius2*radius2 - radius1*radius1));
|
||||||
// distance from the center to the focus
|
// distance from the center to the focus
|
||||||
|
|
||||||
QPointF focus1 = center;
|
QPointF focus1 = static_cast<QPointF>(center);
|
||||||
QPointF focus2 = center;
|
QPointF focus2 = static_cast<QPointF>(center);
|
||||||
|
|
||||||
if (radius1 < radius2)
|
if (radius1 < radius2)
|
||||||
{
|
{
|
||||||
focus1.setY(focus1.ry() + c);
|
focus1.setY(focus1.ry() + c);
|
||||||
QLineF line(center, focus1);
|
QLineF line(static_cast<QPointF>(center), focus1);
|
||||||
line.setAngle(line.angle() + rotationAngle);
|
line.setAngle(line.angle() + rotationAngle);
|
||||||
focus1 = line.p2();
|
focus1 = line.p2();
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ void TST_VEllipticalArc::TestGetPoints2()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
focus1.setX(focus1.rx() + c);
|
focus1.setX(focus1.rx() + c);
|
||||||
QLineF line(center, focus1);
|
QLineF line(static_cast<QPointF>(center), focus1);
|
||||||
line.setAngle(line.angle() + rotationAngle);
|
line.setAngle(line.angle() + rotationAngle);
|
||||||
focus1 = line.p2();
|
focus1 = line.p2();
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ void TST_VEllipticalArc::TestGetPoints2()
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF ellipsePoint(center.x() + radius1, center.y());
|
QPointF ellipsePoint(center.x() + radius1, center.y());
|
||||||
QLineF line(center, ellipsePoint);
|
QLineF line(static_cast<QPointF>(center), ellipsePoint);
|
||||||
line.setAngle(line.angle() + rotationAngle);
|
line.setAngle(line.angle() + rotationAngle);
|
||||||
ellipsePoint = line.p2();
|
ellipsePoint = line.p2();
|
||||||
|
|
||||||
|
@ -464,7 +464,7 @@ void TST_VEllipticalArc::TestFlip_data()
|
||||||
QTest::addColumn<QLineF>("axis");
|
QTest::addColumn<QLineF>("axis");
|
||||||
QTest::addColumn<QString>("prefix");
|
QTest::addColumn<QString>("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));
|
QLineF axis(QPointF(600, 30), QPointF(600, 1800));
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,7 @@ void TST_VSpline::CompareThreeWays()
|
||||||
VPointF p4(681.33729132409951, 1815.7969526662778, "p4", 5.0000125984251973, 9.9999874015748045);
|
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 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<QPointF>(spl1.GetP2()), static_cast<QPointF>(spl1.GetP3()), spl1.GetP4(), 1);
|
||||||
VSpline spl3(spl1.GetP1(), spl1.GetP4(), spl1.GetStartAngle(), "", spl2.GetEndAngle(), "", spl2.GetC1Length(), "",
|
VSpline spl3(spl1.GetP1(), spl1.GetP4(), spl1.GetStartAngle(), "", spl2.GetEndAngle(), "", spl2.GetC1Length(), "",
|
||||||
spl2.GetC2Length(), "", 1);
|
spl2.GetC2Length(), "", 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user