54 #include <QPainterPath>
56 #include "../vmisc/def.h"
57 #include "../ifc/ifcdef.h"
58 #include "../ifc/exception/vexception.h"
97 QPainterPath painterPath;
115 if (not pathPoints.isEmpty())
117 pathPoints.removeLast();
158 if (qFuzzyIsNull(t) || not qFuzzyCompare(t, -1))
190 QPointF &spl2p2, QPointF &spl2p3)
const
194 throw VException(tr(
"Can't cut this spline"));
201 if (fullLength <= minLength)
204 spl1p2 = spl1p3 = spl2p2 = spl2p3 = QPointF();
208 const qreal maxLength = fullLength - minLength;
210 if (length < minLength)
214 else if (length > maxLength)
224 fullLength += splLength;
225 if (fullLength > length)
229 return spl.
CutSpline(length - (fullLength - splLength), spl1p2, spl1p3, spl2p2, spl2p3);
233 spl1p2 = spl1p3 = spl2p2 = spl2p3 = QPointF();
245 QString
name = toolName;
VAbstractBezier & operator=(const VAbstractBezier &curve)
virtual VPointF FirstPoint() const =0
virtual qreal GetLength() const Q_DECL_OVERRIDE
GetLength return length of spline path.
virtual ~VAbstractCubicBezierPath()
QPointF CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3) const
CutSplinePath cut spline path into two. This method don't return two spline path. You must create spl...
virtual QVector< QPointF > getPoints() const Q_DECL_OVERRIDE
GetPathPoints return list of points what located on path.
VAbstractCubicBezierPath & operator=(const VAbstractCubicBezierPath &curve)
virtual QString NameForHistory(const QString &toolName) const Q_DECL_OVERRIDE
NameForHistory helps to create name for dialog History.
virtual qint32 CountSubSpl() const =0
VAbstractCubicBezierPath(const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
int Segment(const QPointF &p) const
virtual void CreateName() Q_DECL_OVERRIDE
virtual qint32 CountPoints() const =0
virtual QPainterPath GetPath() const Q_DECL_OVERRIDE
GetPath return QPainterPath which reprezent spline path.
virtual QVector< DirectionArrow > DirectionArrows() const Q_DECL_OVERRIDE
virtual VSpline GetSpline(qint32 index) const =0
virtual VPointF LastPoint() const =0
virtual QVector< DirectionArrow > DirectionArrows() const
quint32 GetDuplicate() const
virtual QPainterPath GetPath() const
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.
VSpline class that implements the spline.
QPointF CutSpline(qreal length, VSpline &spl1, VSpline &spl2) const
virtual qreal GetLength() const Q_DECL_OVERRIDE
GetLength return length of spline.
qreal ParamT(const QPointF &pBt) const
VSpline::ParamT calculate t coeffient that reprezent point on curve.
virtual QVector< QPointF > getPoints() const Q_DECL_OVERRIDE
GetPoints return list with spline points.
double ToPixel(double val, const Unit &unit)