40 namespace Gecode {
namespace Gist {
74 const QRect& clippingRect0,
bool showCopies)
76 clippingRect(clippingRect0), curBest(curBest0),
77 x(0.0), y(0.0), copies(showCopies) {
78 QPen pen = painter.pen();
86 double parentX = x -
static_cast<double>(n->
getOffset());
101 painter.setPen(Qt::red);
103 painter.setPen(Qt::black);
107 path.moveTo(myx,myy);
108 path.lineTo(parentX,parentY);
109 painter.drawPath(path);
111 QFontMetrics fm = painter.fontMetrics();
114 int n_alt = n->
getParent(
na)->getNumberOfChildren();
115 int tw = fm.width(label);
117 if (alt==0 && n_alt > 1) {
119 }
else if (alt==n_alt-1 && n_alt > 1) {
124 painter.drawText(QPointF(lx,myy-2),label);
129 painter.setBrush(Qt::gray);
130 painter.setPen(Qt::NoPen);
138 painter.drawConvexPolygon(points, 3);
152 painter.drawConvexPolygon(points, 4);
183 painter.drawConvexPolygon(points, 8);
198 painter.setPen(Qt::SolidLine);
201 QLinearGradient gradient(myx-
nodeWidth,myy,
204 gradient.setColorAt(0,
white);
205 gradient.setColorAt(1,
green);
207 gradient.setColorAt(0,
white);
208 gradient.setColorAt(1,
red);
210 gradient.setColorAt(0,
white);
211 gradient.setColorAt(1, QColor(0,0,0));
213 painter.setBrush(gradient);
216 painter.setBrush(QBrush(
green));
218 painter.setBrush(QBrush(
red));
221 QPointF points[3] = {QPointF(myx,myy),
225 painter.drawConvexPolygon(points, 3);
231 painter.setBrush(QBrush(
orange));
233 painter.setBrush(QBrush(
green));
235 QPointF points[4] = {QPointF(myx,myy),
240 painter.drawConvexPolygon(points, 4);
244 painter.setBrush(QBrush(
red));
269 painter.drawConvexPolygon(points, 8);
278 painter.setBrush(Qt::white);
285 painter.setBrush(Qt::darkRed);
286 painter.drawEllipse(myx, myy, 10.0, 10.0);
290 painter.setBrush(Qt::darkYellow);
291 painter.drawEllipse(myx, myy + 10.0, 10.0, 10.0);
295 painter.setBrush(Qt::black);
296 painter.drawEllipse(myx-10-0, myy, 10.0, 10.0);