Refactoring. Replace PassmarkLength by VAbstractPiece::MaxLocalSA.
--HG-- branch : feature
This commit is contained in:
parent
4907ce584f
commit
d1e28f4d46
|
@ -168,6 +168,7 @@ public:
|
|||
protected:
|
||||
template <class T>
|
||||
static QVector<T> RemoveDublicates(const QVector<T> &points, bool removeFirstAndLast = true);
|
||||
static qreal MaxLocalSA(const VSAPoint &p, qreal width);
|
||||
|
||||
private:
|
||||
QSharedDataPointer<VAbstractPieceData> d;
|
||||
|
@ -178,7 +179,6 @@ private:
|
|||
static bool Crossing(const QVector<QPointF> &sub1, const QVector<QPointF> &sub2);
|
||||
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 qreal MaxLocalSA(const VSAPoint &p, qreal width);
|
||||
static QVector<QPointF> AngleByLength(const QPointF &p2, const QPointF &sp1, const QPointF &sp2, const QPointF &sp3,
|
||||
qreal width);
|
||||
static QVector<QPointF> AngleByIntersection(const QPointF &p1, const QPointF &p2, const QPointF &p3,
|
||||
|
|
|
@ -67,24 +67,6 @@ QVector<quint32> PieceMissingNodes(const QVector<quint32> &d1Nodes, const QVecto
|
|||
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;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -965,7 +947,7 @@ QVector<QLineF> VPiece::CreatePassmark(int previousIndex, int passmarkIndex, int
|
|||
|
||||
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);
|
||||
if (node.GetPassmarkAngleType() == PassmarkAngleType::Straightforward)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user