81 double parentX = x -
static_cast<double>(
n->getOffset());
84 (
n->getParent(
na)->getStatus() ==
STOP ||
85 n->getParent(
na)->getStatus() ==
UNSTOP) )
96 painter.setPen(Qt::red);
98 painter.setPen(Qt::black);
102 path.moveTo(myx,myy);
103 path.lineTo(parentX,parentY);
104 painter.drawPath(
path);
106 QFontMetrics fm = painter.fontMetrics();
108 int alt =
n->getAlternative(
na);
109 int n_alt =
n->getParent(
na)->getNumberOfChildren();
110 int tw = fm.width(label);
112 if (alt==0 && n_alt > 1) {
114 }
else if (alt==n_alt-1 && n_alt > 1) {
119 painter.drawText(QPointF(lx,myy-2),label);
124 painter.setBrush(Qt::gray);
125 painter.setPen(Qt::NoPen);
133 painter.drawConvexPolygon(points, 3);
136 switch (
n->getStatus()) {
147 painter.drawConvexPolygon(points, 4);
178 painter.drawConvexPolygon(points, 8);
193 painter.setPen(Qt::SolidLine);
195 if (
n->hasOpenChildren()) {
196 QLinearGradient gradient(myx-
nodeWidth,myy,
198 if (
n->hasSolvedChildren()) {
199 gradient.setColorAt(0,
white);
200 gradient.setColorAt(1,
green);
201 }
else if (
n->hasFailedChildren()) {
202 gradient.setColorAt(0,
white);
203 gradient.setColorAt(1,
red);
205 gradient.setColorAt(0,
white);
206 gradient.setColorAt(1, QColor(0,0,0));
208 painter.setBrush(gradient);
210 if (
n->hasSolvedChildren())
211 painter.setBrush(QBrush(
green));
213 painter.setBrush(QBrush(
red));
216 QPointF points[3] = {QPointF(myx,myy),
220 painter.drawConvexPolygon(points, 3);
222 switch (
n->getStatus()) {
225 if (
n->isCurrentBest(curBest)) {
226 painter.setBrush(QBrush(
orange));
228 painter.setBrush(QBrush(
green));
230 QPointF points[4] = {QPointF(myx,myy),
235 painter.drawConvexPolygon(points, 4);
239 painter.setBrush(QBrush(
red));
245 painter.setBrush(
n->getStatus() ==
STOP ?
264 painter.drawConvexPolygon(points, 8);
268 painter.setBrush(
n->childrenLayoutIsDone() ? QBrush(
blue) :
273 painter.setBrush(Qt::white);
279 if (copies && (
n->hasCopy() && !
n->hasWorkingSpace())) {
280 painter.setBrush(Qt::darkRed);
281 painter.drawEllipse(myx, myy, 10.0, 10.0);
284 if (copies &&
n->hasWorkingSpace()) {
285 painter.setBrush(Qt::darkYellow);
286 painter.drawEllipse(myx, myy + 10.0, 10.0, 10.0);
289 if (
n->isBookmarked()) {
290 painter.setBrush(Qt::black);
291 painter.drawEllipse(myx-10-0, myy, 10.0, 10.0);
DrawingCursor(VisualNode *root, const VisualNode::NodeAllocator &na, BestNode *curBest0, QPainter &painter0, const QRect &clippingRect0, bool showCopies)
Constructor.
void path(Home home, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl=IPL_DEF)
Post propagator such that x forms a Hamiltonian path.