55 #include <QSharedData>
59 #include "../vmisc/vabstractapplication.h"
60 #include "../vmisc/vmath.h"
63 QT_WARNING_DISABLE_GCC(
"-Weffc++")
64 QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor")
74 qreal c1Length,
const QString &c1LengthF, qreal c2Length,
const QString &c2LengthF);
77 static qreal GetL(
const QPointF &p1,
const QPointF &p4, qreal kCurve);
133 : QSharedData(spline),
136 angle1(spline.angle1),
137 angle1F(spline.angle1F),
138 angle2(spline.angle2),
139 angle2F(spline.angle2F),
140 c1Length(spline.c1Length),
141 c1LengthF(spline.c1LengthF),
142 c2Length(spline.c2Length),
143 c2LengthF(spline.c2LengthF),
144 kCurve(spline.kCurve)
152 angle1F(QString().number(angle1)),
154 angle2F(QString().number(angle2)),
161 const qreal L =
GetL(
static_cast<QPointF
>(
p1),
static_cast<QPointF
>(
p4),
kCurve);
163 QLineF p1p2(
p1.
x(),
p1.
y(),
p1.
x() + L * kAsm1,
p1.
y());
168 QLineF p4p3(
p4.
x(),
p4.
y(),
p4.
x() + L * kAsm2,
p4.
y());
188 QLineF p1p2(
static_cast<QPointF
>(
p1),
static_cast<QPointF
>(p2));
196 QLineF p4p3(
static_cast<QPointF
>(
p4),
static_cast<QPointF
>(p3));
207 const QString &angle2F, qreal c1Length,
const QString &c1LengthF,
208 qreal c2Length,
const QString &c2LengthF)
216 c1LengthF(c1LengthF),
218 c2LengthF(c2LengthF),
229 static const qreal angle = 90;
230 const qreal radius = QLineF(
p1,
p4).length()/M_SQRT2;
231 return kCurve * radius * 4 / 3 * qTan( angle * M_PI_4 / 180.0 );
The VPointF class keep data of point.
qreal y() const
y return y coordinate
qreal x() const
x return x coordinate
static qreal GetL(const QPointF &p1, const QPointF &p4, qreal kCurve)
VPointF p1
p1 first spline point.
QString angle1F
angle1F the first control point angle formula
qreal angle2
angle2 second angle control line.
qreal c1Length
c1Length the length from the first spline point to the first control point.
qreal c2Length
c2Length the length from the fourth spline point to the second control point.
qreal kCurve
kCurve coefficient of curvature spline.
QString c1LengthF
c1LengthF the formula from the first spline point to the first control point.
QString angle2F
angle2F the second control point angle formula
VPointF p4
p4 fourth spline point.
QString c2LengthF
c2LengthF the formula length from the fourth spline point to the second control point.
qreal angle1
angle1 first angle control line.
VSplineData & operator=(const VSplineData &) Q_DECL_EQ_DELETE