Go to the documentation of this file.
38 #ifndef GECODE_GIST_TREECANVAS_HH
39 #define GECODE_GIST_TREECANVAS_HH
42 #if QT_VERSION >= 0x050000
51 namespace Gecode {
namespace Gist {
54 namespace LayoutConfig {
75 void updateCanvas(
void);
80 void update(
int w,
int h,
int scale0);
107 void activateDoubleClickInspector(
int i,
bool active);
111 void activateSolutionInspector(
int i,
bool active);
115 void activateMoveInspector(
int i,
bool active);
119 void activateComparator(
int i,
bool active);
123 void scaleTree(
int scale0,
int zoomx=-1,
int zoomy=-1);
126 void searchAll(
void);
128 void searchOne(
void);
130 void toggleHidden(
void);
132 void hideFailed(
void);
134 void unhideAll(
void);
136 void toggleStop(
void);
138 void unstopAll(
void);
140 void exportPDF(
void);
142 void exportWholeTreePDF(
void);
146 void zoomToFit(
void);
148 void centerCurrentNode(
void);
156 void inspectCurrentNode(
bool fix=
true,
int inspectorNo=-1);
158 void inspectBeforeFP(
void);
160 void labelBranches(
void);
162 void labelPath(
void);
165 void stopSearch(
void);
181 void navNextSol(
bool back =
false);
183 void navPrevSol(
void);
186 void bookmarkNode(
void);
190 void inspectPath(
void);
192 void startCompareNodes(
void);
194 void startCompareNodesBeforeFP(
void);
197 void emitStatusChanged(
void);
200 void setRecompDistances(
int c_d,
int a_d);
202 void setAutoHideFailed(
bool b);
204 void setAutoZoom(
bool b);
206 bool getAutoHideFailed(
void);
208 bool getAutoZoom(
void);
210 void setShowCopies(
bool b);
212 bool getShowCopies(
void);
214 void setRefresh(
int i);
216 void setRefreshPause(
int i);
218 bool getSmoothScrollAndZoom(
void);
220 void setSmoothScrollAndZoom(
bool b);
222 bool getMoveDuringSearch(
void);
224 void setMoveDuringSearch(
bool b);
226 void resizeToOuter(
void);
233 void scaleChanged(
int);
235 void autoZoomChanged(
bool);
237 void contextMenu(QContextMenuEvent*);
241 void solution(
const Space*);
243 void searchFinished(
void);
245 void addedBookmark(
const QString&
id);
247 void removedBookmark(
int idx);
320 bool event(QEvent *event);
322 void paintEvent(QPaintEvent* event);
324 void mousePressEvent(QMouseEvent* event);
326 void mouseDoubleClickEvent(QMouseEvent* event);
328 void contextMenuEvent(QContextMenuEvent* event);
330 void resizeEvent(QResizeEvent* event);
332 void wheelEvent(QWheelEvent* event);
357 virtual void timerEvent(QTimerEvent* e);
365 void layoutDone(
int w,
int h,
int scale0);
367 void setCurrentNode(
VisualNode*
n,
bool finished=
true,
bool update=
true);
370 void statusChanged(
bool);
374 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)
Abstract base class for comparators.
Node class that supports visual layout
VisualNode * root
The root node of the tree.
QSlider * scaleBar
The scale bar.
Gecode::IntArgs i(4, 1, 2, 3, 4)
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.
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.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
A thread that concurrently explores the tree.
VisualNode * pathHead
The head of the currently selected path.
bool moveDuringSearch
Whether to move cursor during search.
int targetScale
Target scale after layout.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
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.
Statistics stats
Statistics about the search tree.
Static reference to the currently best space.
A canvas that displays the search tree.
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.
Statistics about the search tree
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.
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.
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
Node::NodeAllocator * na
Allocator for nodes.
int c_d
The recomputation distance.