New function VFuzzyOnAxis.
--HG-- branch : develop
This commit is contained in:
parent
1ab19c05a3
commit
95b9c3ed19
|
@ -105,4 +105,10 @@ static inline bool VFuzzyComparePoints(const QPointF &p1, const QPointF &p2)
|
|||
return QLineF(p1, p2).length() <= accuracyPointOnLine;
|
||||
}
|
||||
|
||||
Q_REQUIRED_RESULT static inline bool VFuzzyOnAxis(qreal v1, qreal v2);
|
||||
static inline bool VFuzzyOnAxis(qreal v1, qreal v2)
|
||||
{
|
||||
return qAbs(v1 - v2) <= accuracyPointOnLine;
|
||||
}
|
||||
|
||||
#endif // VGEOMETRYDEF_H
|
||||
|
|
|
@ -87,7 +87,7 @@ void VBestSquare::NewResult(const VBestSquareResData &data)
|
|||
{
|
||||
if (d->saveLength)
|
||||
{
|
||||
if (qAbs(data.depthPosition - d->data.depthPosition) <= accuracyPointOnLine
|
||||
if (VFuzzyOnAxis(data.depthPosition, d->data.depthPosition)
|
||||
&& IsImprovedSidePosition(data.sidePosition))
|
||||
{
|
||||
SaveResult();
|
||||
|
@ -99,8 +99,7 @@ void VBestSquare::NewResult(const VBestSquareResData &data)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (IsImprovedSidePosition(data.sidePosition)
|
||||
|| qAbs(data.sidePosition - d->data.sidePosition) <= accuracyPointOnLine)
|
||||
if (IsImprovedSidePosition(data.sidePosition) || VFuzzyOnAxis(data.sidePosition, d->data.sidePosition))
|
||||
{
|
||||
SaveResult();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user