55 #include <qcompilerdetection.h>
59 #include <QSharedDataPointer>
79 VSpline (
const VPointF &p1,
const VPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
81 VSpline (
const VPointF &p1,
const QPointF &p2,
const QPointF &p3,
const VPointF &p4, quint32 idObject = 0,
83 VSpline (
const VPointF &p1,
const VPointF &p4, qreal angle1,
const QString &angle1Formula, qreal angle2,
84 const QString &angle2Formula, qreal c1Length,
const QString &c1LengthFormula, qreal c2Length,
86 VSpline Rotate(
const QPointF &originPoint, qreal degrees,
const QString &prefix = QString())
const;
87 VSpline Flip(
const QLineF &axis,
const QString &prefix = QString())
const;
88 VSpline Move(qreal length, qreal angle,
const QString &prefix = QString())
const;
92 #ifdef Q_COMPILER_RVALUE_REFS
114 void SetEndAngle(qreal angle,
const QString &formula);
122 void SetC1Length(qreal length,
const QString &formula);
123 void SetC2Length(qreal length,
const QString &formula);
125 virtual qreal
GetLength ()
const Q_DECL_OVERRIDE;
136 qreal kAsm2, qreal kCurve);
137 qreal
ParamT(
const QPointF &pBt)
const;
143 QSharedDataPointer<VSplineData>
d;
144 QVector<qreal> CalcT(qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, qreal curveCoord4,
145 qreal pointCoord)
const;
147 static int Sign(
long double ld);
QPointF CutSpline(qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3) const
CutSpline cut spline.
The VPointF class keep data of point.
VSpline class that implements the spline.
virtual qreal GetLength() const Q_DECL_OVERRIDE
GetLength return length of spline.
VSpline Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
virtual QPointF GetControlPoint2() const Q_DECL_OVERRIDE
static qint32 Cubic(QVector< qreal > &x, qreal a, qreal b, qreal c)
Cubic Cubic equation solution. Real coefficients case.
virtual qreal GetC2Length() const Q_DECL_OVERRIDE
virtual VPointF GetP4() const Q_DECL_OVERRIDE
GetP4 return last spline point.
void SetP4(const VPointF &p)
void SetC1Length(qreal length, const QString &formula)
QString GetC1LengthFormula() const
VSpline()
VSpline default constructor.
qreal GetKcurve() const
GetKcurve return coefficient of curvature spline.
void SetC2Length(qreal length, const QString &formula)
VSpline & operator=(const VSpline &spline)
virtual qreal GetStartAngle() const Q_DECL_OVERRIDE
GetAngle1 return first angle control line.
void SetP1(const VPointF &p)
qreal ParamT(const QPointF &pBt) const
VSpline::ParamT calculate t coeffient that reprezent point on curve.
VSpline Flip(const QLineF &axis, const QString &prefix=QString()) const
virtual VPointF GetP1() const Q_DECL_OVERRIDE
GetP1 return first spline point.
virtual VPointF GetP2() const Q_DECL_OVERRIDE
GetP2 return first control point.
QString GetStartAngleFormula() const
QString GetEndAngleFormula() const
qreal GetKasm1() const
GetKasm1 return coefficient of length first control line.
static QVector< QPointF > SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve)
SplinePoints return list with spline points.
QPointF CutSpline(qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3) const
CutSpline cut spline.
virtual qreal GetC1Length() const Q_DECL_OVERRIDE
void Swap(VSpline &spline) Q_DECL_NOTHROW
virtual VPointF GetP3() const Q_DECL_OVERRIDE
GetP3 return second control point.
QString GetC2LengthFormula() const
VSpline Move(qreal length, qreal angle, const QString &prefix=QString()) const
QVector< qreal > CalcT(qreal curveCoord1, qreal curveCoord2, qreal curveCoord3, qreal curveCoord4, qreal pointCoord) const
void SetStartAngle(qreal angle, const QString &formula)
virtual QVector< QPointF > getPoints() const Q_DECL_OVERRIDE
GetPoints return list with spline points.
virtual qreal GetEndAngle() const Q_DECL_OVERRIDE
GetAngle2 return second angle control line.
void SetEndAngle(qreal angle, const QString &formula)
QSharedDataPointer< VSplineData > d
virtual QPointF GetControlPoint1() const Q_DECL_OVERRIDE
static int Sign(long double ld)
qreal GetKasm2() const
GetKasm2 return coefficient of length second control line.
Q_DECLARE_TYPEINFO(VSpline, Q_MOVABLE_TYPE)