Improving for layout debug mode.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2015-03-23 14:13:44 +02:00
parent 1f74e30d39
commit 6b8cb0bf69
2 changed files with 17 additions and 13 deletions

View File

@ -48,16 +48,20 @@ enum class BestFrom : char
//#define LAYOUT_DEBUG // Enable debug mode //#define LAYOUT_DEBUG // Enable debug mode
// This block help rule debug mode. Don't turn all options at the same time!
#ifdef LAYOUT_DEBUG #ifdef LAYOUT_DEBUG
// Nice looking
# define SHOW_VERTICES // Show contour vertices # define SHOW_VERTICES // Show contour vertices
# define SHOW_DIRECTION // Show contour direction # define SHOW_DIRECTION // Show contour direction
# define ARRANGED_DETAILS // Show already arranged details # define ARRANGED_DETAILS // Show already arranged details
//# define SHOW_CANDIDATE
//# define SHOW_ROTATION // Debugging
//# define SHOW_COMBINE # define SHOW_CANDIDATE // Show each position
//# define SHOW_MIRROR # define SHOW_ROTATION // For each position show rotation part
//# define SHOW_CANDIDATE_BEST # define SHOW_COMBINE // For each position show edge combine part
//# define SHOW_BEST # define SHOW_MIRROR // For each position show mirror part
//# define SHOW_CANDIDATE_BEST // For only correct positions that pass checks
//# define SHOW_BEST // Show only best position for workpiece
#endif//LAYOUT_DEBUG #endif//LAYOUT_DEBUG
#endif // VLAYOUTDEF_H #endif // VLAYOUTDEF_H

View File

@ -147,10 +147,10 @@ void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail,
QPainter paint; QPainter paint;
paint.begin(&frameImage); paint.begin(&frameImage);
paint.setPen(QPen(Qt::darkRed, 10, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); paint.setPen(QPen(Qt::darkRed, 15, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
paint.drawRect(QRectF(contour.GetWidth()/2, contour.GetHeight()/2, contour.GetWidth(), contour.GetHeight())); paint.drawRect(QRectF(contour.GetWidth()/2, contour.GetHeight()/2, contour.GetWidth(), contour.GetHeight()));
paint.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); paint.setPen(QPen(Qt::black, 6, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
QPainterPath p; QPainterPath p;
if (contour.GetContour().isEmpty()) if (contour.GetContour().isEmpty())
{ {
@ -166,7 +166,7 @@ void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail,
} }
#ifdef SHOW_CANDIDATE #ifdef SHOW_CANDIDATE
paint.setPen(QPen(Qt::darkGreen, 3, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); paint.setPen(QPen(Qt::darkGreen, 6, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p = DrawContour(detail.GetLayoutAllowencePoints()); p = DrawContour(detail.GetLayoutAllowencePoints());
p.translate(contour.GetWidth()/2, contour.GetHeight()/2); p.translate(contour.GetWidth()/2, contour.GetHeight()/2);
paint.drawPath(p); paint.drawPath(p);
@ -176,7 +176,7 @@ void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail,
#endif #endif
#ifdef ARRANGED_DETAILS #ifdef ARRANGED_DETAILS
paint.setPen(QPen(Qt::blue, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin)); paint.setPen(QPen(Qt::blue, 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p = DrawDetails(details); p = DrawDetails(details);
p.translate(contour.GetWidth()/2, contour.GetHeight()/2); p.translate(contour.GetWidth()/2, contour.GetHeight()/2);
paint.drawPath(p); paint.drawPath(p);