parent
bc25721ffa
commit
80e7af2ec4
|
@ -215,6 +215,34 @@ void VContainer::UpdateId(qint64 newId)
|
|||
}
|
||||
}
|
||||
|
||||
QVector<QPointF> VContainer::CorrectEquidistantPoints(const QVector<QPointF> &points) const
|
||||
{
|
||||
QVector<QPointF> correctPoints;
|
||||
if(points.size()<4)//Better don't check if only three points. We can destroy equidistant.
|
||||
{
|
||||
qWarning()<<"Only three points.";
|
||||
return points;
|
||||
}
|
||||
for(qint32 i = 0; i <points.size(); ++i)
|
||||
{
|
||||
if(i == points.size()-1)
|
||||
{
|
||||
correctPoints.append(points.at(i));
|
||||
continue;
|
||||
}
|
||||
if(points.at(i) == points.at(i+1))
|
||||
{
|
||||
correctPoints.append(points.at(i));
|
||||
++i;
|
||||
}
|
||||
else
|
||||
{
|
||||
correctPoints.append(points.at(i));
|
||||
}
|
||||
}
|
||||
return correctPoints;
|
||||
}
|
||||
|
||||
QPainterPath VContainer::ContourPath(qint64 idDetail) const
|
||||
{
|
||||
VDetail detail = GetDetail(idDetail);
|
||||
|
@ -323,6 +351,8 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const
|
|||
}
|
||||
path.lineTo(points[0]);
|
||||
|
||||
pointsEkv = CorrectEquidistantPoints(pointsEkv);
|
||||
|
||||
if (detail.getSupplement() == true)
|
||||
{
|
||||
QPainterPath ekv;
|
||||
|
|
|
@ -378,6 +378,7 @@ public:
|
|||
* @param newId id
|
||||
*/
|
||||
static void UpdateId(qint64 newId);
|
||||
QVector<QPointF> CorrectEquidistantPoints(const QVector<QPointF> &points) const;
|
||||
/**
|
||||
* @brief ContourPath create painter path for detail
|
||||
* @param idDetail id of detail
|
||||
|
@ -440,7 +441,7 @@ public:
|
|||
void CreateManTableIGroup ();
|
||||
private:
|
||||
/**
|
||||
* @brief _id current id. New object will have value +1. For full class equal 0.
|
||||
* @brief _id current id. New object will have value +1. For empty class equal 0.
|
||||
*/
|
||||
static qint64 _id;
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user