56 #include "../ifc/exception/vexception.h"
57 #include "../vmisc/vmath.h"
61 #ifdef Q_COMPILER_RVALUE_REFS
84 if (points.size() < 3)
90 for (qint32 i = 1; i <= points.size()-1; ++i)
96 newPoints[i-1].SetP(p1.
P());
100 newPoints[i].SetP(p2.
P());
114 if (points.isEmpty())
141 newPoints[i-1].SetP(spl.
GetP1());
145 newPoints[i].SetP(spl.
GetP4());
166 newPoints[i-1].SetP(spl.
GetP1());
170 newPoints[i].SetP(spl.
GetP4());
191 newPoints[i-1].SetP(spl.
GetP1());
195 newPoints[i].SetP(spl.
GetP4());
219 if (
d->path.size() > 0 &&
static_cast<QPointF
>(
d->path.last().P()) ==
static_cast<QPointF
>(point.
P()))
224 d->path.append(point);
235 if (
d->path.isEmpty())
241 return d->path.size() - 1;
255 throw VException(tr(
"Not enough points to create the spline."));
260 throw VException(tr(
"This spline does not exist."));
279 if (indexSpline < 1 || indexSpline >
CountSubSpl())
281 throw VException(tr(
"This spline does not exist."));
285 d->path[indexSpline-1] = point;
289 d->path[indexSpline] = point;
302 if (indexSpline < 1 || indexSpline >
CountSubSpl())
304 throw VException(tr(
"This spline does not exist."));
308 return d->path.at(indexSpline-1);
312 return d->path.at(indexSpline);
341 return d->path[indx];
352 return d->path[indx];
410 if (not
d->path.isEmpty())
412 return d->path.first().P();
426 return d->path.at(count).P();
441 return d->path.size();
458 points.reserve(
d->path.size());
467 points[i-1].SetP(p1.
P());
468 points[i-1].SetAngle2(p1.
Angle2());
469 points[i-1].SetKAsm2(spl.
GetKasm1());
471 points[i].SetP(p2.
P());
472 points[i].SetAngle1(p2.
Angle1());
virtual void CreateName() Q_DECL_OVERRIDE
QString getLineWeight() const
getLineWeight return weight of the lines
void SetDuplicate(quint32 number)
VAbstractCurve & operator=(const VAbstractCurve &curve)
QString GetPenStyle() const
void Swap(VAbstractCurve &curve) Q_DECL_NOTHROW
QString getLineColor() const
The VException class parent for all exception. Could be use for abstract exception.
The VFSplinePoint class keep information about point in spline path. Each point have two angles and t...
VPointF P() const
P return point.
qreal Angle1() const
Angle1 return first angle of spline.
qreal KAsm1() const
KAsm1 return coefficient of length first control line.
qreal Angle2() const
Angle2 return second angle of spline.
qreal KAsm2() const
KAsm2 return coefficient of length second control line.
virtual QString name() const
name return name graphical object.
The VPointF class keep data of point.
The VSplinePath class keep information about splinePath.
virtual qreal GetC2Length() const Q_DECL_OVERRIDE
VSplinePath Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
const VSplinePoint & at(int indx) const
at return spline point by index.
virtual qreal GetStartAngle() const Q_DECL_OVERRIDE
virtual VSpline GetSpline(qint32 index) const Q_DECL_OVERRIDE
GetSpline return spline by index.
virtual qint32 CountPoints() const Q_DECL_OVERRIDE
CountPoints return count of points.
VSplinePath Flip(const QLineF &axis, const QString &prefix=QString()) const
void UpdatePoint(qint32 indexSpline, const SplinePointPosition &pos, const VSplinePoint &point)
UpdatePoint update spline point in list.
VSplinePath & operator=(const VSplinePath &path)
operator = assignment operator.
virtual void Clear() Q_DECL_OVERRIDE
Clear clear list of points.
virtual QVector< VSplinePoint > GetSplinePath() const Q_DECL_OVERRIDE
GetSplinePath return list with spline points.
virtual VPointF FirstPoint() const Q_DECL_OVERRIDE
VSplinePath(quint32 idObject=0, Draw mode=Draw::Calculation)
VSplinePath constructor.
QSharedDataPointer< VSplinePathData > d
virtual qint32 CountSubSpl() const Q_DECL_OVERRIDE
CountSubSpl return count of simple splines.
virtual qreal GetEndAngle() const Q_DECL_OVERRIDE
QVector< VFSplinePoint > GetFSplinePath() const
virtual VPointF LastPoint() const Q_DECL_OVERRIDE
VSplinePoint & operator[](int indx)
operator [] return spline point by index.
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePointPosition pos) const
GetSplinePoint return spline point from list.
virtual ~VSplinePath() Q_DECL_OVERRIDE
VSplinePath Move(qreal length, qreal angle, const QString &prefix=QString()) const
void Swap(VSplinePath &path) Q_DECL_NOTHROW
void append(const VSplinePoint &point)
append add point in the end of list points.
virtual qreal GetC1Length() const Q_DECL_OVERRIDE
The VSplinePoint class keep information about point in spline path. Each point have two angles and tw...
QString Length1Formula() const
QString Angle2Formula() const
QString Length2Formula() const
QString Angle1Formula() const
VSpline class that implements the spline.
VSpline Rotate(const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
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.
VSpline Flip(const QLineF &axis, const QString &prefix=QString()) const
virtual VPointF GetP1() const Q_DECL_OVERRIDE
GetP1 return first spline point.
QString GetStartAngleFormula() const
QString GetEndAngleFormula() const
qreal GetKasm1() const
GetKasm1 return coefficient of length first control line.
virtual qreal GetC1Length() const Q_DECL_OVERRIDE
QString GetC2LengthFormula() const
VSpline Move(qreal length, qreal angle, const QString &prefix=QString()) const
virtual qreal GetEndAngle() const Q_DECL_OVERRIDE
GetAngle2 return second angle control line.
qreal GetKasm2() const
GetKasm2 return coefficient of length second control line.