From 6b8cb0bf69e16813a240d69df747b503e8acae13 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 23 Mar 2015 14:13:44 +0200 Subject: [PATCH] Improving for layout debug mode. --HG-- branch : release --- src/libs/vlayout/vlayoutdef.h | 22 +++++++++++++--------- src/libs/vlayout/vposition.cpp | 8 ++++---- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 7bb9ab662..4b2a0347c 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -48,16 +48,20 @@ enum class BestFrom : char //#define LAYOUT_DEBUG // Enable debug mode +// This block help rule debug mode. Don't turn all options at the same time! #ifdef LAYOUT_DEBUG -# define SHOW_VERTICES // Show contour vertices -# define SHOW_DIRECTION // Show contour direction -# define ARRANGED_DETAILS // Show already arranged details -//# define SHOW_CANDIDATE -//# define SHOW_ROTATION -//# define SHOW_COMBINE -//# define SHOW_MIRROR -//# define SHOW_CANDIDATE_BEST -//# define SHOW_BEST +// Nice looking +# define SHOW_VERTICES // Show contour vertices +# define SHOW_DIRECTION // Show contour direction +# define ARRANGED_DETAILS // Show already arranged details + +// Debugging +# define SHOW_CANDIDATE // Show each position +# define SHOW_ROTATION // For each position show rotation part +# define SHOW_COMBINE // For each position show edge combine part +# 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 // VLAYOUTDEF_H diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 699f65cfb..df3de516c 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -147,10 +147,10 @@ void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail, QPainter paint; 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.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; if (contour.GetContour().isEmpty()) { @@ -166,7 +166,7 @@ void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail, } #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.translate(contour.GetWidth()/2, contour.GetHeight()/2); paint.drawPath(p); @@ -176,7 +176,7 @@ void VPosition::DrawDebug(const VContour &contour, const VLayoutDetail &detail, #endif #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.translate(contour.GetWidth()/2, contour.GetHeight()/2); paint.drawPath(p);