Use method VAbstractCurve::PathLength to get length.
--HG-- branch : feature
This commit is contained in:
parent
dd8067e47f
commit
ebd58376d9
|
@ -321,6 +321,11 @@ QPainterPath VAbstractCurve::ShowDirection(const QVector<QPointF> &points) const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VAbstractCurve::PathLength(const QVector<QPointF> &path)
|
||||
{
|
||||
if (path.size() < 2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
QPainterPath splinePath;
|
||||
splinePath.moveTo(path.at(0));
|
||||
for (qint32 i = 1; i < path.count(); ++i)
|
||||
|
|
|
@ -79,13 +79,14 @@ public:
|
|||
QString GetColor() const;
|
||||
void SetColor(const QString &color);
|
||||
|
||||
static qreal PathLength(const QVector<QPointF> &path);
|
||||
|
||||
static QVector<QPointF> CurveIntersectLine(const QVector<QPointF> &points, const QLineF &line);
|
||||
|
||||
virtual QString NameForHistory(const QString &toolName) const=0;
|
||||
protected:
|
||||
QPainterPath ShowDirection(const QVector<QPointF> &points) const;
|
||||
virtual void CreateName() =0;
|
||||
static qreal PathLength(const QVector<QPointF> &path);
|
||||
private:
|
||||
QSharedDataPointer<VAbstractCurveData> d;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user