57 #include "../ifc/exception/vexception.h"
58 #include "../vmisc/vmath.h"
64 #ifdef Q_COMPILER_RVALUE_REFS
66 { Swap(curve);
return *
this; }
103 if ( &curve ==
this )
117 for(
int i=0; i < points.size(); ++i)
119 curve.
append(points.at(i).Rotate(originPoint, degrees));
133 for(
int i=0; i < points.size(); ++i)
135 curve.
append(points.at(i).Flip(axis));
149 for(
int i=0; i < points.size(); ++i)
151 curve.
append(points.at(i).Move(length, angle));
168 return d->path[indx];
174 return d->path[indx];
180 d->path.append(point);
193 return d->path.size();
208 throw VException(tr(
"Not enough points to create the spline."));
213 throw VException(tr(
"This spline does not exist."));
219 QPointF p2 =
static_cast<QPointF
>(
d->path.at(base + 1));
222 const QPointF b =
static_cast<QPointF
>(
d->path.at(base));
223 QLineF foot1(b,
static_cast<QPointF
>(
d->path.at(base - 1)));
226 foot2.setAngle(foot1.angle() + 180);
230 VSpline spl(
d->path.at(base), p2,
static_cast<QPointF
>(
d->path.at(base + 2)),
d->path.at(base + 3));
294 for (qint32 i = 1; i <= size; ++i)
330 return qFloor(qAbs((size - 4) / 3.0 + 1));
336 if (subSplIndex <= 0)
341 return (subSplIndex - 1) * 3;
347 if (countSubSpl <= 0)
352 return ((countSubSpl - 1) * 3 + 4);
358 if (not
d->path.isEmpty())
360 return d->path.first();
virtual void CreateName() Q_DECL_OVERRIDE
QString getLineWeight() const
getLineWeight return weight of the lines
void SetDuplicate(quint32 number)
void SetPenStyle(const QString &penStyle)
VAbstractCurve & operator=(const VAbstractCurve &curve)
void setLineColor(const QString &color)
void setLineWeight(const QString &lineWeight)
setLineWeight set weight of the lines
QString GetPenStyle() const
void Swap(VAbstractCurve &curve) Q_DECL_NOTHROW
QString getLineColor() const
virtual VPointF FirstPoint() const Q_DECL_OVERRIDE
void append(const VPointF &point)
static qint32 SubSplPointsCount(qint32 countSubSpl)
VCubicBezierPath(quint32 idObject=0, Draw mode=Draw::Calculation)
QVector< VPointF > GetCubicPath() const
virtual ~VCubicBezierPath()
virtual qint32 CountPoints() const Q_DECL_OVERRIDE
VCubicBezierPath & operator=(const VCubicBezierPath &curve)
virtual qreal GetC2Length() const Q_DECL_OVERRIDE
virtual qint32 CountSubSpl() const Q_DECL_OVERRIDE
virtual qreal GetC1Length() const Q_DECL_OVERRIDE
const VPointF & at(int indx) const
virtual VPointF LastPoint() const Q_DECL_OVERRIDE
VCubicBezierPath Flip(const QLineF &axis, const QString &prefix=QString()) const
virtual VSpline GetSpline(qint32 index) const Q_DECL_OVERRIDE
virtual QVector< VSplinePoint > GetSplinePath() const Q_DECL_OVERRIDE
QSharedDataPointer< VCubicBezierPathData > d
virtual qreal GetEndAngle() const Q_DECL_OVERRIDE
void Swap(VCubicBezierPath &curve) Q_DECL_NOTHROW
VCubicBezierPath Move(qreal length, qreal angle, const QString &prefix=QString()) const
virtual void Clear() Q_DECL_OVERRIDE
virtual qreal GetStartAngle() const Q_DECL_OVERRIDE
static qint32 SubSplOffset(qint32 subSplIndex)
VCubicBezierPath Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
VPointF & operator[](int indx)
The VException class parent for all exception. Could be use for abstract exception.
virtual QString name() const
name return name graphical object.
void setName(const QString &name)
setName set name graphical object.
The VPointF class keep data of point.
The VSplinePoint class keep information about point in spline path. Each point have two angles and tw...
void SetAngle1(const qreal &value, const QString &angle1F)
void SetP(const VPointF &value)
void SetLength1(const qreal &value, const QString &length1F)
void SetLength2(const qreal &value, const QString &length2F)
void SetAngle2(const qreal &value, const QString &angle2F)
VSpline class that implements the spline.
virtual qreal GetC2Length() const Q_DECL_OVERRIDE
virtual VPointF GetP4() const Q_DECL_OVERRIDE
GetP4 return last spline point.
QString GetC1LengthFormula() const
virtual qreal GetStartAngle() const Q_DECL_OVERRIDE
GetAngle1 return first angle control line.
virtual VPointF GetP1() const Q_DECL_OVERRIDE
GetP1 return first spline point.
QString GetStartAngleFormula() const
QString GetEndAngleFormula() const
virtual qreal GetC1Length() const Q_DECL_OVERRIDE
QString GetC2LengthFormula() const
virtual qreal GetEndAngle() const Q_DECL_OVERRIDE
GetAngle2 return second angle control line.