Refactoring. Replace PassmarkLength by VAbstractPiece::MaxLocalSA.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-03-30 11:07:42 +03:00
parent 4907ce584f
commit d1e28f4d46
2 changed files with 2 additions and 20 deletions

View File

@ -168,6 +168,7 @@ public:
protected: protected:
template <class T> template <class T>
static QVector<T> RemoveDublicates(const QVector<T> &points, bool removeFirstAndLast = true); static QVector<T> RemoveDublicates(const QVector<T> &points, bool removeFirstAndLast = true);
static qreal MaxLocalSA(const VSAPoint &p, qreal width);
private: private:
QSharedDataPointer<VAbstractPieceData> d; QSharedDataPointer<VAbstractPieceData> d;
@ -178,7 +179,6 @@ private:
static bool Crossing(const QVector<QPointF> &sub1, const QVector<QPointF> &sub2); static bool Crossing(const QVector<QPointF> &sub1, const QVector<QPointF> &sub2);
static QVector<QPointF> SubPath(const QVector<QPointF> &path, int startIndex, int endIndex); static QVector<QPointF> SubPath(const QVector<QPointF> &path, int startIndex, int endIndex);
static Q_DECL_CONSTEXPR qreal PointPosition(const QPointF &p, const QLineF &line); static Q_DECL_CONSTEXPR qreal PointPosition(const QPointF &p, const QLineF &line);
static qreal MaxLocalSA(const VSAPoint &p, qreal width);
static QVector<QPointF> AngleByLength(const QPointF &p2, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3, static QVector<QPointF> AngleByLength(const QPointF &p2, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3,
qreal width); qreal width);
static QVector<QPointF> AngleByIntersection(const QPointF &p1, const QPointF &p2, const QPointF &p3, static QVector<QPointF> AngleByIntersection(const QPointF &p1, const QPointF &p2, const QPointF &p3,

View File

@ -67,24 +67,6 @@ QVector<quint32> PieceMissingNodes(const QVector<quint32> &d1Nodes, const QVecto
return r; return r;
} }
//---------------------------------------------------------------------------------------------------------------------
qreal PassmarkLength(const VSAPoint &passmarkSAPoint, qreal width)
{
qreal w1 = passmarkSAPoint.GetSAAfter();
if (w1 < 0)
{
w1 = width;
}
qreal w2 = passmarkSAPoint.GetSABefore();
if (w2 < 0)
{
w2 = width;
}
return qMax(w1, w2);
}
const qreal passmarkGap = (1.5/*mm*/ / 25.4) * PrintDPI; const qreal passmarkGap = (1.5/*mm*/ / 25.4) * PrintDPI;
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -965,7 +947,7 @@ QVector<QLineF> VPiece::CreatePassmark(int previousIndex, int passmarkIndex, int
QVector<QLineF> passmarksLines; QVector<QLineF> passmarksLines;
const qreal passmarkLength = PassmarkLength(passmarkSAPoint, width) * 0.25; const qreal passmarkLength = VAbstractPiece::MaxLocalSA(passmarkSAPoint, width) * 0.25;
const VPieceNode &node = d->m_path.at(passmarkIndex); const VPieceNode &node = d->m_path.at(passmarkIndex);
if (node.GetPassmarkAngleType() == PassmarkAngleType::Straightforward) if (node.GetPassmarkAngleType() == PassmarkAngleType::Straightforward)
{ {