Move rotation to separate method. Preparetion for working with new setting.
--HG-- branch : feature
This commit is contained in:
parent
0d1725fc11
commit
dd098506dd
|
@ -69,31 +69,7 @@ void VPosition::run()
|
||||||
}
|
}
|
||||||
frame = frame + 3;
|
frame = frame + 3;
|
||||||
|
|
||||||
for (int angle = 0; angle <= 360; angle = angle+180)
|
Rotate(180);
|
||||||
{
|
|
||||||
if (*stop)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QCoreApplication::processEvents();
|
|
||||||
|
|
||||||
// We should use copy of the detail.
|
|
||||||
VLayoutDetail workDetail = detail;
|
|
||||||
|
|
||||||
if (CheckRotationEdges(workDetail, j, i, angle))
|
|
||||||
{
|
|
||||||
#ifdef LAYOUT_DEBUG
|
|
||||||
# ifdef SHOW_CANDIDATE_BEST
|
|
||||||
++frame;
|
|
||||||
DrawDebug(gContour, workDetail, frame, paperIndex, detailsCount, details);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation);
|
|
||||||
}
|
|
||||||
++frame;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -607,6 +583,36 @@ QVector<QPointF> VPosition::CutEdge(const QLineF &edge, unsigned int shift)
|
||||||
return points;
|
return points;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VPosition::Rotate(int increase)
|
||||||
|
{
|
||||||
|
for (int angle = 0; angle <= 360; angle = angle+increase)
|
||||||
|
{
|
||||||
|
if (*stop)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCoreApplication::processEvents();
|
||||||
|
|
||||||
|
// We should use copy of the detail.
|
||||||
|
VLayoutDetail workDetail = detail;
|
||||||
|
|
||||||
|
if (CheckRotationEdges(workDetail, j, i, angle))
|
||||||
|
{
|
||||||
|
#ifdef LAYOUT_DEBUG
|
||||||
|
# ifdef SHOW_CANDIDATE_BEST
|
||||||
|
++frame;
|
||||||
|
DrawDebug(gContour, workDetail, frame, paperIndex, detailsCount, details);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SaveCandidate(bestResult, workDetail, j, i, BestFrom::Rotation);
|
||||||
|
}
|
||||||
|
++frame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VPosition::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const
|
bool VPosition::TrueIntersection(const QLineF &gEdge, const QLineF &dEdge, const QPointF &p) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -119,6 +119,8 @@ private:
|
||||||
|
|
||||||
static void AppendWhole(QVector<QPointF> &contour, const VLayoutDetail &detail, int detJ, unsigned int shift);
|
static void AppendWhole(QVector<QPointF> &contour, const VLayoutDetail &detail, int detJ, unsigned int shift);
|
||||||
static QVector<QPointF> CutEdge(const QLineF &edge, unsigned int shift);
|
static QVector<QPointF> CutEdge(const QLineF &edge, unsigned int shift);
|
||||||
|
|
||||||
|
void Rotate(int increase);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VPOSITION_H
|
#endif // VPOSITION_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user