Go to the documentation of this file.
34 #ifndef GECODE_GIST_TREECANVAS_HH
35 #define GECODE_GIST_TREECANVAS_HH
38 #if QT_VERSION >= 0x050000
47 namespace Gecode {
namespace Gist {
50 namespace LayoutConfig {
71 void updateCanvas(
void);
76 void update(
int w,
int h,
int scale0);
103 void activateDoubleClickInspector(
int i,
bool active);
107 void activateSolutionInspector(
int i,
bool active);
111 void activateMoveInspector(
int i,
bool active);
115 void activateComparator(
int i,
bool active);
119 void scaleTree(
int scale0,
int zoomx=-1,
int zoomy=-1);
122 void searchAll(
void);
124 void searchOne(
void);
126 void toggleHidden(
void);
128 void hideFailed(
void);
130 void unhideAll(
void);
132 void toggleStop(
void);
134 void unstopAll(
void);
136 void exportPDF(
void);
138 void exportWholeTreePDF(
void);
142 void zoomToFit(
void);
144 void centerCurrentNode(
void);
152 void inspectCurrentNode(
bool fix=
true,
int inspectorNo=-1);
154 void inspectBeforeFP(
void);
156 void labelBranches(
void);
158 void labelPath(
void);
161 void stopSearch(
void);
177 void navNextSol(
bool back =
false);
179 void navPrevSol(
void);
182 void bookmarkNode(
void);
186 void inspectPath(
void);
188 void startCompareNodes(
void);
190 void startCompareNodesBeforeFP(
void);
193 void emitStatusChanged(
void);
196 void setRecompDistances(
int c_d,
int a_d);
198 void setAutoHideFailed(
bool b);
200 void setAutoZoom(
bool b);
202 bool getAutoHideFailed(
void);
204 bool getAutoZoom(
void);
206 void setShowCopies(
bool b);
208 bool getShowCopies(
void);
210 void setRefresh(
int i);
212 void setRefreshPause(
int i);
214 bool getSmoothScrollAndZoom(
void);
216 void setSmoothScrollAndZoom(
bool b);
218 bool getMoveDuringSearch(
void);
220 void setMoveDuringSearch(
bool b);
222 void resizeToOuter(
void);
316 bool event(QEvent *event);
318 void paintEvent(QPaintEvent* event);
320 void mousePressEvent(QMouseEvent* event);
322 void mouseDoubleClickEvent(QMouseEvent* event);
324 void contextMenuEvent(QContextMenuEvent* event);
326 void resizeEvent(QResizeEvent* event);
328 void wheelEvent(QWheelEvent* event);
353 virtual void timerEvent(QTimerEvent* e);
361 void layoutDone(
int w,
int h,
int scale0);
366 void statusChanged(
bool);
370 void inspectSolution(
const Space* s);
int refreshPause
Time (in msec) to pause after each refresh.
const int maxAutoZoomScale
Maximum scale factor for automatic zoom.
const int minScale
Minimum scale factor.
int targetX
Target x coordinate after smooth scrolling.
Gecode Interactive Search Tool
const int maxScale
Maximum scale factor.
bool compareNodes
Whether node comparison action is running.
void search(VisualNode *n, bool all, TreeCanvas *ti)
void statusChanged(VisualNode *, const Statistics &, bool)
Status bar update.
Abstract base class for comparators.
Node class that supports visual layout
void autoZoomChanged(bool)
The auto-zoom state was changed.
VisualNode * root
The root node of the tree.
QSlider * scaleBar
The scale bar.
QVector< QPair< Inspector *, bool > > solutionInspectors
The registered solution inspectors, and whether they are active.
double scale
Current scale factor.
Abstract base class for inspectors.
int a_d
The adaptive recomputation distance.
int targetW
Target width after layout.
bool autoHideFailed
Whether to hide failed subtrees automatically.
void searchFinished(void)
Signals that Gist is finished.
bool showCopies
Whether to show copies in the tree.
Gecode toplevel namespace
bool autoZoom
Whether to zoom automatically.
BestNode * curBest
The currently best solution (for branch-and-bound)
SearcherThread searcher
Search engine thread.
A thread that concurrently explores the tree.
VisualNode * pathHead
The head of the currently selected path.
void update(IntSet &y, Space &home, IntSet &py)
bool moveDuringSearch
Whether to move cursor during search.
int targetScale
Target scale after layout.
VisualNode * currentNode
The currently selected node.
int sourceY
Target y coordinate after smooth scrolling.
QVector< QPair< Inspector *, bool > > doubleClickInspectors
The registered click inspectors, and whether they are active.
int xtrans
Offset on the x axis so that the tree is centered.
int targetH
Target height after layout.
void contextMenu(QContextMenuEvent *)
Context menu triggered.
Statistics stats
Statistics about the search tree.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Static reference to the currently best space.
A canvas that displays the search tree.
void scaleChanged(int)
The scale factor has changed.
QMutex layoutMutex
Mutex for synchronizing layout and drawing.
int layoutDoneTimerId
Timer id for delaying the update.
void searchFinished(void)
#define GECODE_GIST_EXPORT
void moveToNode(VisualNode *n, bool)
void solution(const Space *)
const int defScale
Default scale factor.
void removedBookmark(int idx)
Signals that a bookmark has been removed.
Statistics about the search tree
void addedBookmark(const QString &id)
Signals that a bookmark has been added.
int targetY
Target y coordinate after smooth scrolling.
QVector< QPair< Comparator *, bool > > comparators
The registered comparators, and whether they are active.
int bab(Space *root, const Gist::Options &opt)
Create a new stand-alone Gist for branch-and-bound search of root.
void solution(const Space *)
Signals that a solution has been found.
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
QMutex mutex
Mutex for synchronizing acccess to the tree.
void update(int w, int h, int scale0)
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance)
QTimeLine zoomTimeLine
Timer for smooth zooming.
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
QTimeLine scrollTimeLine
Timer for smooth scrolling.
Gecode::FloatVal c(-8, 8)
bool stopSearchFlag
Flag signalling the search to stop.
QVector< QPair< Inspector *, bool > > moveInspectors
The registered move inspectors, and whether they are active.
bool finishedFlag
Flag signalling that Gist is ready to be closed.
int n
Number of negative literals for node type.
QVector< VisualNode * > bookmarks
The bookmarks map.
int sourceX
Source x coordinate after smooth scrolling.
Gecode::IntArgs i({1, 2, 3, 4})
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
Node::NodeAllocator * na
Allocator for nodes.
void print(const Search::Statistics &stat, bool restart)
Print statistics.
int c_d
The recomputation distance.