Methods can be static.
--HG-- branch : feature
This commit is contained in:
parent
4fcd7d9b25
commit
25e6df1c1d
|
@ -157,7 +157,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal VEquidistant::GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints) const
|
qreal VEquidistant::GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)
|
||||||
{
|
{
|
||||||
qreal length = 0;
|
qreal length = 0;
|
||||||
QVector<QPointF> points;
|
QVector<QPointF> points;
|
||||||
|
@ -170,7 +170,7 @@ qreal VEquidistant::GetLengthContour(const QVector<QPointF> &contour, const QVec
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> VEquidistant::biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my) const
|
QVector<QPointF> VEquidistant::biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my)
|
||||||
{
|
{
|
||||||
QVector<QPointF> p;
|
QVector<QPointF> p;
|
||||||
for (qint32 i = 0; i < points.size(); ++i)
|
for (qint32 i = 0; i < points.size(); ++i)
|
||||||
|
@ -183,7 +183,7 @@ QVector<QPointF> VEquidistant::biasPoints(const QVector<QPointF> &points, const
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &points) const
|
QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &points)
|
||||||
{
|
{
|
||||||
QVector<QPointF> correctPoints;
|
QVector<QPointF> correctPoints;
|
||||||
if (points.size()<4)//Better don't check if only three points. We can destroy equidistant.
|
if (points.size()<4)//Better don't check if only three points. We can destroy equidistant.
|
||||||
|
@ -295,7 +295,7 @@ QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Eq
|
||||||
return ekv;
|
return ekv;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> VEquidistant::CheckLoops(const QVector<QPointF> &points) const
|
QVector<QPointF> VEquidistant::CheckLoops(const QVector<QPointF> &points)
|
||||||
{
|
{
|
||||||
QVector<QPointF> ekvPoints;
|
QVector<QPointF> ekvPoints;
|
||||||
/*If we got less than 4 points no need seek loops.*/
|
/*If we got less than 4 points no need seek loops.*/
|
||||||
|
@ -353,7 +353,7 @@ QVector<QPointF> VEquidistant::CheckLoops(const QVector<QPointF> &points) const
|
||||||
return ekvPoints;
|
return ekvPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> VEquidistant::GetReversePoint(const QVector<QPointF> &points) const
|
QVector<QPointF> VEquidistant::GetReversePoint(const QVector<QPointF> &points)
|
||||||
{
|
{
|
||||||
Q_ASSERT(points.size() > 0);
|
Q_ASSERT(points.size() > 0);
|
||||||
QVector<QPointF> reversePoints;
|
QVector<QPointF> reversePoints;
|
||||||
|
@ -421,7 +421,7 @@ QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width) const
|
||||||
return paralel;
|
return paralel;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VEquidistant::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) const
|
QPointF VEquidistant::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width)
|
||||||
{
|
{
|
||||||
Q_ASSERT(width > 0);
|
Q_ASSERT(width > 0);
|
||||||
QLineF pLine = line;
|
QLineF pLine = line;
|
||||||
|
|
|
@ -52,7 +52,7 @@ private:
|
||||||
* @param newPoints point whos we try to add to contour.
|
* @param newPoints point whos we try to add to contour.
|
||||||
* @return length length of contour.
|
* @return length length of contour.
|
||||||
*/
|
*/
|
||||||
qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints) const;
|
static qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints);
|
||||||
/**
|
/**
|
||||||
* @brief biasPoints bias point.
|
* @brief biasPoints bias point.
|
||||||
* @param points vector of points.
|
* @param points vector of points.
|
||||||
|
@ -60,13 +60,13 @@ private:
|
||||||
* @param my offset respect to y.
|
* @param my offset respect to y.
|
||||||
* @return new vector biased points.
|
* @return new vector biased points.
|
||||||
*/
|
*/
|
||||||
QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my) const;
|
static QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my);
|
||||||
/**
|
/**
|
||||||
* @brief CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant.
|
* @brief CorrectEquidistantPoints clear equivalent points and remove point on line from equdistant.
|
||||||
* @param points list of points equdistant.
|
* @param points list of points equdistant.
|
||||||
* @return corrected list.
|
* @return corrected list.
|
||||||
*/
|
*/
|
||||||
QVector<QPointF> CorrectEquidistantPoints(const QVector<QPointF> &points) const;
|
static QVector<QPointF> CorrectEquidistantPoints(const QVector<QPointF> &points);
|
||||||
/**
|
/**
|
||||||
* @brief Equidistant create equidistant painter path for detail.
|
* @brief Equidistant create equidistant painter path for detail.
|
||||||
* @param points vector of points.
|
* @param points vector of points.
|
||||||
|
@ -80,13 +80,13 @@ private:
|
||||||
* @param points vector of points of equidistant.
|
* @param points vector of points of equidistant.
|
||||||
* @return vector of points of equidistant.
|
* @return vector of points of equidistant.
|
||||||
*/
|
*/
|
||||||
QVector<QPointF> CheckLoops(const QVector<QPointF> &points) const;
|
static QVector<QPointF> CheckLoops(const QVector<QPointF> &points);
|
||||||
/**
|
/**
|
||||||
* @brief GetReversePoint return revers container of points.
|
* @brief GetReversePoint return revers container of points.
|
||||||
* @param points container with points.
|
* @param points container with points.
|
||||||
* @return reverced points.
|
* @return reverced points.
|
||||||
*/
|
*/
|
||||||
QVector<QPointF> GetReversePoint(const QVector<QPointF> &points) const;
|
static QVector<QPointF> GetReversePoint(const QVector<QPointF> &points);
|
||||||
/**
|
/**
|
||||||
* @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal.
|
* @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal.
|
||||||
* @param line1 first line.
|
* @param line1 first line.
|
||||||
|
@ -109,7 +109,7 @@ private:
|
||||||
* @param width width to parallel line.
|
* @param width width to parallel line.
|
||||||
* @return point of parallel line.
|
* @return point of parallel line.
|
||||||
*/
|
*/
|
||||||
QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) const;
|
static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VEQUIDISTANT_H
|
#endif // VEQUIDISTANT_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user