38 #include <QtGui/QPainter> 40 #include <QPrintDialog> 54 namespace Gecode {
namespace Gist {
59 , mutex(QMutex::Recursive)
60 , layoutMutex(QMutex::Recursive)
62 , compareNodes(false), compareNodesBeforeFP(false)
63 , autoHideFailed(true), autoZoom(false)
64 , refresh(500), refreshPause(0), smoothScrollAndZoom(false)
65 , moveDuringSearch(false)
67 , scrollTimeLine(1000), targetX(0), sourceX(0), targetY(0), sourceY(0)
68 , targetW(0), targetH(0), targetScale(0)
69 , layoutDoneTimerId(0) {
70 QMutexLocker locker(&
mutex);
80 int rootIdx =
na->allocate(rootSpace);
81 assert(rootIdx == 0); (void) rootIdx;
89 setAutoFillBackground(
true);
98 Qt::BlockingQueuedConnection);
100 this, SLOT(inspectSolution(
const Space*)));
104 Qt::BlockingQueuedConnection);
112 scaleBar =
new QSlider(Qt::Vertical,
this);
113 scaleBar->setObjectName(
"scaleBar");
117 connect(
scaleBar, SIGNAL(valueChanged(
int)),
127 qRegisterMetaType<Statistics>(
"Statistics");
174 comparators.append(QPair<Comparator*,bool>(c,
false));
187 QSize viewport_size =
size();
188 QAbstractScrollArea* sa =
189 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
192 zoomx = viewport_size.width()/2;
194 zoomy = viewport_size.height()/2;
196 int xoff = (sa->horizontalScrollBar()->value()+zoomx)/
scale;
197 int yoff = (sa->verticalScrollBar()->value()+zoomy)/
scale;
202 scale = (
static_cast<double>(scale0)) / 100.0;
210 sa->horizontalScrollBar()->setRange(0,w-viewport_size.width());
211 sa->verticalScrollBar()->setRange(0,h-viewport_size.height());
212 sa->horizontalScrollBar()->setPageStep(viewport_size.width());
213 sa->verticalScrollBar()->setPageStep(viewport_size.height());
220 sa->horizontalScrollBar()->setValue(xoff-zoomx);
221 sa->verticalScrollBar()->setValue(yoff-zoomy);
229 QMutexLocker locker(&
mutex);
241 QSize viewport_size =
size();
242 QAbstractScrollArea* sa =
243 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
244 sa->horizontalScrollBar()->setRange(0,w-viewport_size.width());
245 sa->verticalScrollBar()->setRange(0,h-viewport_size.height());
246 sa->horizontalScrollBar()->setPageStep(viewport_size.width());
247 sa->verticalScrollBar()->setPageStep(viewport_size.height());
266 QSize viewport_size =
size();
267 QAbstractScrollArea* sa =
268 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
269 sa->horizontalScrollBar()->setRange(0,w-viewport_size.width());
270 sa->verticalScrollBar()->setRange(0,h-viewport_size.height());
299 SearcherThread::updateCanvas(
void) {
300 t->layoutMutex.lock();
304 if (
t->autoHideFailed) {
305 t->root->hideFailed(*
t->na,
true);
309 t->currentNode->setMarked(
false);
311 t->currentNode->setMarked(
true);
316 t->root->layout(*
t->na);
321 t->root->getShape()->depth()
325 int scale0 =
static_cast<int>(
t->scale*100);
327 QWidget*
p =
t->parentWidget();
330 static_cast<double>(p->width()) / (bb.
right - bb.
left +
333 static_cast<double>(p->height()) /
336 scale0 =
static_cast<int>(
std::min(newXScale, newYScale)*100);
341 double scale = (
static_cast<double>(scale0)) / 100.0;
349 t->layoutMutex.unlock();
364 : n(n0), i(-1), noOfChildren(noOfChildren0) {}
376 node->getNumberOfChildNodes(*
t->na,
t->curBest,
t->stats,
378 if (kids == 0 || node->getStatus() ==
STOP) {
385 std::stack<SearchItem> stck;
388 std::max(static_cast<long unsigned int>(
t->stats.maxDepth),
389 static_cast<long unsigned int>(depth+stck.size()));
393 t->stopSearchFlag =
false;
394 while (!stck.empty() && !
t->stopSearchFlag) {
395 if (
t->refresh > 0 && nodeCount >=
t->refresh) {
396 node->dirtyUp(*
t->na);
400 if (
t->refreshPause > 0)
401 msleep(
t->refreshPause);
414 if (
t->moveDuringSearch)
415 emit moveToNode(n,
false);
431 std::max(static_cast<long unsigned int>(
t->stats.maxDepth),
432 static_cast<long unsigned int>(depth+stck.size()));
437 node->dirtyUp(*
t->na);
438 t->stopSearchFlag =
false;
441 t->setCurrentNode(sol,
true,
false);
443 t->setCurrentNode(node,
true,
false);
454 QMutexLocker locker(&
mutex);
460 QMutexLocker locker(&
mutex);
466 QMutexLocker locker(&
mutex);
475 QMutexLocker locker(&
mutex);
484 QMutexLocker locker(&
mutex);
494 QMutexLocker locker(&
mutex);
503 QMutexLocker locker(&
mutex);
518 int zoomCurrent =
static_cast<int>(
scale*100);
537 QWidget*
p = parentWidget();
540 static_cast<double>(p->width()) / (bb.
right - bb.
left +
546 int scale0 =
static_cast<int>(
std::min(newXScale, newYScale)*100);
556 int zoomCurrent =
static_cast<int>(
scale*100);
557 int targetZoom = scale0;
569 QMutexLocker locker(&
mutex);
582 QAbstractScrollArea* sa =
583 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
585 x -= sa->viewport()->width() / 2;
586 y -= sa->viewport()->height() / 2;
588 sourceX = sa->horizontalScrollBar()->value();
592 sourceY = sa->verticalScrollBar()->value();
597 sa->horizontalScrollBar()->setValue(targetX);
598 sa->verticalScrollBar()->setValue(targetY);
612 QAbstractScrollArea* sa =
613 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
614 double p =
static_cast<double>(
i)/100.0;
617 sa->horizontalScrollBar()->setValue(
sourceX+static_cast<int>(xdiff));
618 sa->verticalScrollBar()->setValue(
sourceY+static_cast<int>(ydiff));
623 QMutexLocker locker(&
mutex);
630 int failedInspectorType = -1;
631 int failedInspector = -1;
632 bool needCentering =
false;
643 needCentering =
true;
655 failedInspectorType = 0;
668 failedInspectorType = -1;
693 "Something went wrong - probably an incorrect brancher");
703 switch (curSpace->
status()) {
716 if (inspectorNo==-1) {
719 failedInspectorType = 1;
722 failedInspectorType = -1;
726 failedInspectorType = 1;
727 failedInspector = inspectorNo;
729 failedInspectorType = -1;
736 switch (failedInspectorType) {
738 qFatal(
"Exception in move inspector %d: %s.\n Stopping.",
739 failedInspector, e.
what());
742 qFatal(
"Exception in double click inspector %d: %s.\n Stopping.",
743 failedInspector, e.
what());
746 qFatal(
"Exception: %s.\n Stopping.", e.
what());
764 QMutexLocker locker(&
mutex);
772 QMutexLocker locker(&
mutex);
780 TreeCanvas::inspectSolution(
const Space* s) {
781 int failedInspectorType = -1;
782 int failedInspector = -1;
789 failedInspectorType = 1;
792 failedInspectorType = -1;
797 switch (failedInspectorType) {
799 qFatal(
"Exception in move inspector %d: %s.\n Stopping.",
800 failedInspector, e.
what());
803 qFatal(
"Exception in solution inspector %d: %s.\n Stopping.",
804 failedInspector, e.
what());
807 qFatal(
"Exception: %s.\n Stopping.", e.
what());
821 QMutexLocker locker(&
mutex);
835 int rootIdx =
na->allocate(rootSpace);
836 assert(rootIdx == 0); (void) rootIdx;
854 QMutexLocker locker(&
mutex);
858 QInputDialog::getText(
this,
"Add bookmark",
"Name:",
859 QLineEdit::Normal,
"",&ok);
864 text = QString(
"Node ")+QString().setNum(
bookmarks.size());
879 QMutexLocker locker(&
mutex);
893 QMutexLocker locker(&
mutex);
898 while (nextAlt >= 0) {
909 QMutexLocker locker(&
mutex);
912 setCursor(QCursor(Qt::CrossCursor));
917 QMutexLocker locker(&
mutex);
920 setCursor(QCursor(Qt::CrossCursor));
930 QMutexLocker locker(&
mutex);
943 QMutexLocker locker(&
mutex);
966 QMutexLocker locker(&
mutex);
980 QMutexLocker locker(&
mutex);
994 QMutexLocker locker(&
mutex);
1001 QMutexLocker locker(&
mutex);
1019 #if QT_VERSION >= 0x040400 1020 QString filename = QFileDialog::getSaveFileName(
this, tr(
"Export tree as pdf"),
"", tr(
"PDF (*.pdf)"));
1021 if (filename !=
"") {
1022 QPrinter printer(QPrinter::ScreenResolution);
1023 QMutexLocker locker(&
mutex);
1026 printer.setFullPage(
true);
1030 printer.setOutputFileName(filename);
1031 QPainter painter(&printer);
1033 painter.setRenderHint(QPainter::Antialiasing);
1035 QRect pageRect = printer.pageRect();
1037 static_cast<double>(pageRect.width()) / (bb.
right - bb.
left +
1040 static_cast<double>(pageRect.height()) /
1043 double printScale =
std::min(newXScale, newYScale);
1044 painter.scale(printScale,printScale);
1049 QRect clip(0,0,0,0);
1062 #if QT_VERSION >= 0x040400 1063 exportNodePDF(
root);
1069 #if QT_VERSION >= 0x040400 1077 if (QPrintDialog(&printer,
this).exec() == QDialog::Accepted) {
1078 QMutexLocker locker(&
mutex);
1081 QRect pageRect = printer.pageRect();
1083 static_cast<double>(pageRect.width()) / (bb.
right - bb.
left +
1086 static_cast<double>(pageRect.height()) /
1089 double printScale =
std::min(newXScale, newYScale)*100;
1092 if (printScale > 400.0)
1094 printScale = printScale / 100.0;
1096 QPainter painter(&printer);
1097 painter.setRenderHint(QPainter::Antialiasing);
1098 painter.scale(printScale,printScale);
1099 painter.translate(
xtrans, 0);
1100 QRect clip(0,0,0,0);
1110 switch (event->type()) {
1111 case QEvent::ToolTip:
1113 QHelpEvent* he =
static_cast<QHelpEvent*
>(
event);
1118 case QEvent::MouseButtonDblClick:
1119 case QEvent::MouseButtonPress:
1120 case QEvent::MouseButtonRelease:
1121 case QEvent::MouseMove:
1123 QMouseEvent* me =
static_cast<QMouseEvent*
>(
event);
1128 case QEvent::ContextMenu:
1130 QContextMenuEvent* ce =
static_cast<QContextMenuEvent*
>(
event);
1138 QAbstractScrollArea* sa =
1139 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
1140 int xoff = sa->horizontalScrollBar()->value()/
scale;
1141 int yoff = sa->verticalScrollBar()->value()/
scale;
1146 if (w < sa->viewport()->width())
1147 xoff -= (sa->viewport()->width()-w)/2;
1151 static_cast<int>(x/scale-
xtrans+xoff),
1152 static_cast<int>((y-30)/scale+yoff));
1158 if (
mutex.tryLock()) {
1159 if (event->type() == QEvent::ToolTip) {
1162 QHelpEvent* he =
static_cast<QHelpEvent*
>(
event);
1163 QToolTip::showText(he->globalPos(),
1167 QToolTip::hideText();
1172 return QWidget::event(event);
1184 QPainter painter(
this);
1185 painter.setRenderHint(QPainter::Antialiasing);
1187 QAbstractScrollArea* sa =
1188 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
1189 int xoff = sa->horizontalScrollBar()->value()/
scale;
1190 int yoff = sa->verticalScrollBar()->value()/
scale;
1195 if (w < sa->viewport()->width())
1196 xoff -= (sa->viewport()->width()-w)/2;
1198 QRect origClip =
event->rect();
1199 painter.translate(0, 30);
1200 painter.scale(scale,scale);
1201 painter.translate(
xtrans-xoff, -yoff);
1202 QRect clip(static_cast<int>(origClip.x()/scale-
xtrans+xoff),
1203 static_cast<int>(origClip.y()/scale+yoff),
1204 static_cast<int>(origClip.width()/
scale),
1205 static_cast<int>(origClip.height()/
scale));
1222 if (
mutex.tryLock()) {
1223 if(event->button() == Qt::LeftButton) {
1239 if (
mutex.tryLock()) {
1255 QAbstractScrollArea* sa =
1256 static_cast<QAbstractScrollArea*
>(parentWidget()->parentWidget());
1258 int w = sa->horizontalScrollBar()->maximum()+e->oldSize().width();
1259 int h = sa->verticalScrollBar()->maximum()+e->oldSize().height();
1261 sa->horizontalScrollBar()->setRange(0,w-e->size().width());
1262 sa->verticalScrollBar()->setRange(0,h-e->size().height());
1263 sa->horizontalScrollBar()->setPageStep(e->size().width());
1264 sa->verticalScrollBar()->setPageStep(e->size().height());
1269 if (event->modifiers() & Qt::ShiftModifier) {
1271 if (event->orientation() == Qt::Vertical && !
autoZoom)
1272 scaleTree(
scale*100+ceil(static_cast<double>(event->delta())/4.0),
1273 event->x(),
event->y());
1302 Space* curSpace = NULL;
1305 if (curSpace == NULL)
1310 qFatal(
"Exception in move inspector %d: %s.\n Stopping.",
1323 setCursor(QCursor(Qt::ArrowCursor));
1333 if (
mutex.tryLock()) {
1334 if (event->button() == Qt::LeftButton) {
1340 Space* curSpace = NULL;
1341 Space* compareSpace = NULL;
1344 if (curSpace == NULL) {
1352 switch (compareSpace->
status()) {
1366 comparators[
i].first->compare(*curSpace,*compareSpace);
1368 qFatal(
"Exception in comparator %d: %s.\n Stopping.",
1378 setCursor(QCursor(Qt::ArrowCursor));
bool isOnPath(void)
Return whether node is on the path.
void search(VisualNode *n, bool all, TreeCanvas *ti)
Node representing stop point.
void setCurrentNode(VisualNode *n, bool finished=true, bool update=true)
Set the selected node to n.
void labelBranches(void)
Label all branches in subtree under current node.
std::string toolTip(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Return string that is used as a tool tip.
void toggleStop(void)
Do not stop at selected stop node.
void unhideAll(const NodeAllocator &na)
Unhide all nodes in the subtree of this node.
int right
Right coordinate.
NodeStatus getStatus(void) const
Return current status of the node.
void stopSearch(void)
Stop current search.
Space must be branched (at least one brancher left)
void labelPath(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Create or clear branch labels on path to root.
void exportPDF(void)
Export pdf of the current subtree.
bool isRoot(void) const
Check if this node is the root of a tree.
void inspectCurrentNode(bool fix=true, int inspectorNo=-1)
Call the double click inspector for the currently selected node.
void setMarked(bool m)
Set mark of this node.
void unhideAll(void)
Unhide all nodes below selected node.
void solution(const Space *)
Signals that a solution has been found.
void autoZoomChanged(bool)
The auto-zoom state was changed.
Static reference to the currently best space.
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
const FloatNum max
Largest allowed float value.
void addMoveInspector(Inspector *i)
Add inspector i.
Node representing a branch.
bool showCopies
Whether to show copies in the tree.
void searchFinished(void)
Signals that Gist is finished.
void addDoubleClickInspector(Inspector *i)
Add inspector i.
~TreeCanvas(void)
Destructor.
void layout(const NodeAllocator &na)
Compute layout for the subtree of this node.
void setSmoothScrollAndZoom(bool b)
Set preference whether to use smooth scrolling and zooming.
void navPrevSol(void)
Move selection to previous solution (in DFS order)
void navDown(void)
Move selection to the first child of the selected node.
Abstract base class for comparators.
BoundingBox getBoundingBox(void)
Return the bounding box.
void addComparator(Comparator *c)
Add comparator c.
bool isHidden(void)
Return if node is hidden.
QVector< VisualNode * > bookmarks
The bookmarks map.
NodeAllocatorBase< VisualNode > NodeAllocator
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
const int defScale
Default scale factor.
int sourceX
Source x coordinate after smooth scrolling.
QVector< QPair< Inspector *, bool > > moveInspectors
The registered move inspectors, and whether they are active.
Space * getSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Return working space. Receiver must delete the space.
void zoomToFit(void)
Zoom the canvas so that the whole tree fits.
TreeCanvas(Space *rootSpace, bool bab, QWidget *parent, const Options &opt)
Constructor.
void activateComparator(int i, bool active)
Set active comparator.
VisualNode * root
The root node of the tree.
Node representing failure.
void setPath(void)
Set the current node to be the head of the path.
int targetScale
Target scale after layout.
void navRoot(void)
Move selection to the root node.
int targetW
Target width after layout.
QSlider * scaleBar
The scale bar.
void mouseDoubleClickEvent(QMouseEvent *event)
Handle mouse double click event.
void navNextSol(bool back=false)
Move selection to next solution (in DFS order)
void mousePressEvent(QMouseEvent *event)
Handle mouse press event.
void hideFailed(void)
Hide failed subtrees of selected node.
void statusChanged(VisualNode *, const Statistics &, bool)
Status bar update.
unsigned int getNumberOfChildren(void) const
Return the number of children.
void toggleStop(const NodeAllocator &na)
Do not stop at this node.
void setBookmarked(bool m)
Set bookmark of this node.
Abstract base class for inspectors.
int xtrans
Offset on the x axis so that the tree is centered.
SearchItem(VisualNode *n0, int noOfChildren0)
Constructor.
Node that has not been explored yet.
const int minScale
Minimum scale factor.
void inspectPath(void)
Call the double click inspector for all nodes on the path from root to head of the path...
bool finishedFlag
Flag signalling that Gist is ready to be closed.
int i
The currently explored child.
void labelBranches(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Create or clear branch labels in subtree.
Gecode::FloatVal c(-8, 8)
void paintEvent(QPaintEvent *event)
Paint the tree.
void unstopAll(const NodeAllocator &na)
Do not stop at any stop node in the subtree of this node.
const Choice * getChoice(void)
Return choice of this node.
int p
Number of positive literals for node type.
bool getMoveDuringSearch(void)
Return preference whether to move cursor during search.
const FloatNum min
Smallest allowed float value.
int targetX
Target x coordinate after smooth scrolling.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
BestNode * curBest
The currently best solution (for branch-and-bound)
void searchOne(void)
Find next solution below selected node.
const Space * getWorkingSpace(void) const
Return working space (if present).
Space * clone(CloneStatistics &stat=unused_clone) const
Clone space.
VarImp * x
Pointer to variable implementation.
virtual const char * what(void) const
Return information.
Node representing a solution.
double scale
Current scale factor.
void scaleTree(int scale0, int zoomx=-1, int zoomy=-1)
Set scale factor to scale0.
void commit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
Commit choice c for alternative a.
void labelPath(void)
Label all branches on path to root node.
void setRefreshPause(int i)
Set refresh pause in msec.
bool getAutoHideFailed(void)
Return preference whether to automatically hide failed subtrees.
unsigned int size(I &i)
Size of all ranges of range iterator i.
bool clone
Whether engines create a clone when being initialized.
void activateDoubleClickInspector(int i, bool active)
Set active inspector.
QMutex mutex
Mutex for synchronizing acccess to the tree.
A cursor that draws a tree on a QWidget.
Cursor & getCursor(void)
Return the cursor.
void activateSolutionInspector(int i, bool active)
Set active inspector.
void setRefresh(int i)
Set refresh rate.
int a_d
The adaptive recomputation distance.
A cursor that frees all memory.
QTimeLine scrollTimeLine
Timer for smooth scrolling.
void emitStatusChanged(void)
Re-emit status change information for current node.
VisualNode * pathHead
The head of the currently selected path.
int layoutDoneTimerId
Timer id for delaying the update.
void resizeToOuter(void)
Resize to the outer widget size if auto zoom is enabled.
void navUp(void)
Move selection to the parent of the selected node.
const int maxScale
Maximum scale factor.
T * dfs(T *s, const Search::Options &o)
Invoke depth-first search engine for subclass T of space s with options o.
void unstopAll(void)
Do not stop at any stop node.
void contextMenu(QContextMenuEvent *)
Context menu triggered.
bool autoHideFailed
Whether to hide failed subtrees automatically.
Statistics stats
Statistics about the search tree.
void exportWholeTreePDF(void)
Export pdf of the whole tree.
int getPathAlternative(const NodeAllocator &na)
Return the alternative of the child that is on the path (-1 if none)
QMutex layoutMutex
Mutex for synchronizing layout and drawing.
bool moveDuringSearch
Whether to move cursor during search.
QVector< QPair< Inspector *, bool > > doubleClickInspectors
The registered click inspectors, and whether they are active.
void inspectBeforeFP(void)
Calls inspectCurrentNode(false)
void scroll(void)
React to scroll events.
Shape * getShape(void)
Return the shape of this node.
void run(void)
Execute visitor.
int targetY
Target y coordinate after smooth scrolling.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
int getParent(void) const
Return the parent.
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
Post propagator for SetVar SetOpType SetVar y
void scaleChanged(int)
The scale factor has changed.
Exception: Base-class for exceptions
void print(void)
Print the tree.
bool getSmoothScrollAndZoom(void)
Return preference whether to use smooth scrolling and zooming.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
void dirtyUp(const NodeAllocator &na)
Mark all nodes up the path to the parent as dirty.
Run a cursor over a tree, processing nodes in pre-order.
void setAutoZoom(bool b)
Set preference whether to automatically zoom to fit.
void searchAll(void)
Explore complete subtree of selected node.
void toggleHidden(const NodeAllocator &na)
Toggle whether this node is hidden.
int maxDepth
Maximum depth of the tree.
void addedBookmark(const QString &id)
Signals that a bookmark has been added.
void setShowCopies(bool b)
Set preference whether to show copies in the tree.
bool isBookmarked(void)
Return whether node is bookmarked.
int c_d
The recomputation distance.
void unPathUp(const NodeAllocator &na)
Set all nodes from the node to the root not to be on the path.
const int maxAutoZoomScale
Maximum scale factor for automatic zoom.
int noOfChildren
The number of children.
Node class that supports visual layout
int getOffset(void)
Return offset off this node from its parent.
int bab(Space *root, const Gist::Options &opt)
Create a new stand-alone Gist for branch-and-bound search of root.
int getAlternative(const NodeAllocator &na) const
Return alternative number of this node.
void addSolutionInspector(Inspector *i)
Add inspector i.
VisualNode * findNode(const NodeAllocator &na, int x, int y)
Find a node in this subtree at coordinates x, y.
void resizeEvent(QResizeEvent *event)
Handle resize event.
void setMoveDuringSearch(bool b)
Set preference whether to move cursor during search.
void removedBookmark(int idx)
Signals that a bookmark has been removed.
void setRecompDistances(int c_d, int a_d)
Set recomputation distances.
bool getShowCopies(void)
Return preference whether to show copies in the tree.
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
void startCompareNodes(void)
Wait for click on node to compare with current node.
QVector< QPair< Inspector *, bool > > solutionInspectors
The registered solution inspectors, and whether they are active.
A cursor that finds the next solution.
bool event(QEvent *event)
General event handler, used for displaying tool tips.
Post propagator for SetVar x
SearcherThread searcher
Search engine thread.
int getNumberOfChildNodes(NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d)
Compute and return the number of children.
bool stopSearchFlag
Flag signalling the search to stop.
void centerCurrentNode(void)
Center the view on the currently selected node.
bool autoZoom
Whether to zoom automatically.
VisualNode * eventNode(QEvent *event)
Return the node corresponding to the event position.
int refreshPause
Time (in msec) to pause after each refresh.
void startCompareNodesBeforeFP(void)
Wait for click on node to compare with current node before fixpoint.
void pathUp(const NodeAllocator &na)
Set all nodes from the node to the root to be on the path.
bool getAutoZoom(void)
Return preference whether to automatically zoom to fit.
virtual void timerEvent(QTimerEvent *e)
Timer invoked for smooth zooming and scrolling.
A stack item for depth first search.
void navRight(void)
Move selection to the right sibling of the selected node.
int getChild(int n) const
Return index of child no n.
bool compareNodes
Whether node comparison action is running.
void navLeft(void)
Move selection to the left sibling of the selected node.
bool hasCopy(void)
Return whether the node has a copy.
Gecode toplevel namespace
void setAutoHideFailed(bool b)
Set preference whether to automatically hide failed subtrees.
int sourceY
Target y coordinate after smooth scrolling.
Space * snapshot(Space *s, const Options &o)
Clone space s dependening on options o.
void bookmarkNode(void)
Bookmark current node.
bool isOpen(void)
Return whether this node still has open children.
int targetH
Target height after layout.
QTimeLine zoomTimeLine
Timer for smooth zooming.
void wheelEvent(QWheelEvent *event)
Handle mouse wheel events.
#define GECODE_NEVER
Assert that this command is never executed.
void activateMoveInspector(int i, bool active)
Set active inspector.
void update(IntSet &y, Space &home, IntSet &py)
void update(void)
Update display.
void toggleHidden(void)
Toggle hidden state of selected node.
Statistics about the search tree
Node::NodeAllocator * na
Allocator for nodes.
bool finish(void)
Stop search and wait for it to finish.
void layoutDone(int w, int h, int scale0)
Layout done.
void hideFailed(const NodeAllocator &na, bool onlyDirty=false)
Hide all failed subtrees of this node.
int depth(void) const
Return depth of the shape.
A canvas that displays the search tree.
QVector< QPair< Comparator *, bool > > comparators
The registered comparators, and whether they are active.
VisualNode * currentNode
The currently selected node.
void contextMenuEvent(QContextMenuEvent *event)
Handle context menu event.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).
Node representing ignored stop point.
Space is solved (no brancher left)