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());
89 (
n->getParent(
na)->getStatus() ==
STOP ||
90 n->getParent(
na)->getStatus() ==
UNSTOP) )
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();
112 QString label =
na.getLabel(
n);
113 int alt =
n->getAlternative(
na);
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);
141 switch (
n->getStatus()) {
152 painter.drawConvexPolygon(points, 4);
183 painter.drawConvexPolygon(points, 8);
198 painter.setPen(Qt::SolidLine);
200 if (
n->hasOpenChildren()) {
201 QLinearGradient gradient(myx-
nodeWidth,myy,
203 if (
n->hasSolvedChildren()) {
204 gradient.setColorAt(0,
white);
205 gradient.setColorAt(1,
green);
206 }
else if (
n->hasFailedChildren()) {
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);
215 if (
n->hasSolvedChildren())
216 painter.setBrush(QBrush(
green));
218 painter.setBrush(QBrush(
red));
221 QPointF points[3] = {QPointF(myx,myy),
225 painter.drawConvexPolygon(points, 3);
227 switch (
n->getStatus()) {
230 if (
n->isCurrentBest(curBest)) {
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));
250 painter.setBrush(
n->getStatus() ==
STOP ?
269 painter.drawConvexPolygon(points, 8);
273 painter.setBrush(
n->childrenLayoutIsDone() ? QBrush(
blue) :
278 painter.setBrush(Qt::white);
284 if (copies && (
n->hasCopy() && !
n->hasWorkingSpace())) {
285 painter.setBrush(Qt::darkRed);
286 painter.drawEllipse(myx, myy, 10.0, 10.0);
289 if (copies &&
n->hasWorkingSpace()) {
290 painter.setBrush(Qt::darkYellow);
291 painter.drawEllipse(myx, myy + 10.0, 10.0, 10.0);
294 if (
n->isBookmarked()) {
295 painter.setBrush(Qt::black);
296 painter.drawEllipse(myx-10-0, myy, 10.0, 10.0);