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);
void search(VisualNode *n, bool all, TreeCanvas *ti)
Static reference to the currently best space.
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
bool showCopies
Whether to show copies in the tree.
Abstract base class for comparators.
QVector< VisualNode * > bookmarks
The bookmarks map.
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.
VisualNode * root
The root node of the tree.
int targetScale
Target scale after layout.
int targetW
Target width after layout.
QSlider * scaleBar
The scale bar.
Abstract base class for inspectors.
int xtrans
Offset on the x axis so that the tree is centered.
const int minScale
Minimum scale factor.
bool finishedFlag
Flag signalling that Gist is ready to be closed.
Gecode::FloatVal c(-8, 8)
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)
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
double scale
Current scale factor.
Gecode Interactive Search Tool
QMutex mutex
Mutex for synchronizing acccess to the tree.
int a_d
The adaptive recomputation distance.
QTimeLine scrollTimeLine
Timer for smooth scrolling.
VisualNode * pathHead
The head of the currently selected path.
int layoutDoneTimerId
Timer id for delaying the update.
const int maxScale
Maximum scale factor.
bool autoHideFailed
Whether to hide failed subtrees automatically.
Statistics stats
Statistics about the search tree.
QMutex layoutMutex
Mutex for synchronizing layout and drawing.
bool moveDuringSearch
Whether to move cursor during search.
void solution(const Space *)
QVector< QPair< Inspector *, bool > > doubleClickInspectors
The registered click inspectors, and whether they are active.
int targetY
Target y coordinate after smooth scrolling.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
#define GECODE_GIST_EXPORT
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
int c_d
The recomputation distance.
const int maxAutoZoomScale
Maximum scale factor for automatic zoom.
Node class that supports visual layout
int bab(Space *root, const Gist::Options &opt)
Create a new stand-alone Gist for branch-and-bound search of root.
void searchFinished(void)
QVector< QPair< Inspector *, bool > > solutionInspectors
The registered solution inspectors, and whether they are active.
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
SearcherThread searcher
Search engine thread.
bool stopSearchFlag
Flag signalling the search to stop.
bool autoZoom
Whether to zoom automatically.
int refreshPause
Time (in msec) to pause after each refresh.
bool compareNodes
Whether node comparison action is running.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
int sourceY
Target y coordinate after smooth scrolling.
int targetH
Target height after layout.
void moveToNode(VisualNode *n, bool)
QTimeLine zoomTimeLine
Timer for smooth zooming.
void update(int w, int h, int scale0)
A thread that concurrently explores the tree.
Statistics about the search tree
Node::NodeAllocator * na
Allocator for nodes.
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.