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);
bool isOnPath(void)
Return whether node is on the path.
Node representing stop point.
bool hasWorkingSpace(void)
Return whether the node has a working space.
static const QColor lightRed
The color for expanded failed nodes.
static const QColor white
White color.
Static reference to the currently best space.
Node representing a branch.
DrawingCursor(VisualNode *root, const VisualNode::NodeAllocator &na, BestNode *curBest0, QPainter &painter0, const QRect &clippingRect0, bool showCopies)
Constructor.
bool isHidden(void)
Return if node is hidden.
bool isCurrentBest(BestNode *curBest)
Return whether this node is the currently best solution.
Node representing failure.
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntConLevel icl)
Post propagator such that x forms a Hamiltonian path.
bool hasFailedChildren(void)
Return whether the subtree of this node has any failed children.
const double quarterNodeWidth
static const QColor green
The color for solved nodes.
Node that has not been explored yet.
int getAlternative(const NodeAllocator &na) const
Return alternative number of this node.
int getParent(void) const
Return the parent.
NodeStatus getStatus(void) const
Return current status of the node.
static const QColor blue
The color for choice nodes.
QString getLabel(T *n) const
Get label of node n.
bool isRoot(void) const
Check if this node is the root of a tree.
int n
Number of negative literals for node type.
static const QColor lightGreen
The color for expanded solved nodes.
const VisualNode::NodeAllocator & na
The node allocator.
Node representing a solution.
const double quarterFailedWidthF
const double shadowOffset
Gecode Interactive Search Tool
VisualNode * startNode(void)
Return start node.
const double halfFailedWidth
static const QColor red
The color for failed nodes.
bool hasOpenChildren(void)
Return whether the subtree of this node has any open children.
static const QColor orange
The color for the best solution.
void processCurrentNode(void)
Draw the node.
bool childrenLayoutIsDone(void)
Return whether the layout of the node's children has been completed.
A cursor that can be run over a tree.
Node * x
Pointer to corresponding Boolean expression node.
bool isMarked(void)
Return whether node is marked.
bool isBookmarked(void)
Return whether node is bookmarked.
Node class that supports visual layout
int getOffset(void)
Return offset off this node from its parent.
VisualNode * node(void)
Return current node.
bool hasCopy(void)
Return whether the node has a copy.
const double halfNodeWidth
static const QColor lightBlue
The color for expanded choice nodes.
bool hasSolvedChildren(void)
Return whether the subtree of this node has any solved children.
Node representing ignored stop point.