34#ifndef GECODE_GIST_TREECANVAS_HH
35#define GECODE_GIST_TREECANVAS_HH
38#if QT_VERSION >= 0x050000
47namespace Gecode {
namespace Gist {
50 namespace LayoutConfig {
71 void updateCanvas(
void);
76 void update(
int w,
int h,
int scale0);
101 void addDoubleClickInspector(
Inspector* i);
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);
363 void setCurrentNode(
VisualNode*
n,
bool finished=
true,
bool update=
true);
366 void statusChanged(
bool);
370 void inspectSolution(
const Space* s);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
Static reference to the currently best space.
Abstract base class for comparators.
Gecode Interactive Search Tool
Abstract base class for inspectors.
A thread that concurrently explores the tree.
void update(int w, int h, int scale0)
void solution(const Space *)
void searchFinished(void)
void search(VisualNode *n, bool all, TreeCanvas *ti)
void moveToNode(VisualNode *n, bool)
Statistics about the search tree
A canvas that displays the search tree.
double scale
Current scale factor.
int targetX
Target x coordinate after smooth scrolling.
Statistics stats
Statistics about the search tree.
int targetScale
Target scale after layout.
QVector< VisualNode * > bookmarks
The bookmarks map.
SearcherThread searcher
Search engine thread.
VisualNode * currentNode
The currently selected node.
int xtrans
Offset on the x axis so that the tree is centered.
bool autoHideFailed
Whether to hide failed subtrees automatically.
QMutex mutex
Mutex for synchronizing acccess to the tree.
QTimeLine scrollTimeLine
Timer for smooth scrolling.
int layoutDoneTimerId
Timer id for delaying the update.
int targetH
Target height after layout.
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
QTimeLine zoomTimeLine
Timer for smooth zooming.
void statusChanged(VisualNode *, const Statistics &, bool)
Status bar update.
QVector< QPair< Comparator *, bool > > comparators
The registered comparators, and whether they are active.
bool compareNodes
Whether node comparison action is running.
int c_d
The recomputation distance.
QSlider * scaleBar
The scale bar.
QMutex layoutMutex
Mutex for synchronizing layout and drawing.
int targetY
Target y coordinate after smooth scrolling.
QVector< QPair< Inspector *, bool > > doubleClickInspectors
The registered click inspectors, and whether they are active.
void autoZoomChanged(bool)
The auto-zoom state was changed.
Node::NodeAllocator * na
Allocator for nodes.
BestNode * curBest
The currently best solution (for branch-and-bound)
bool moveDuringSearch
Whether to move cursor during search.
int a_d
The adaptive recomputation distance.
void searchFinished(void)
Signals that Gist is finished.
int sourceX
Source x coordinate after smooth scrolling.
void scaleChanged(int)
The scale factor has changed.
void solution(const Space *)
Signals that a solution has been found.
int targetW
Target width after layout.
bool autoZoom
Whether to zoom automatically.
bool finishedFlag
Flag signalling that Gist is ready to be closed.
void removedBookmark(int idx)
Signals that a bookmark has been removed.
VisualNode * pathHead
The head of the currently selected path.
void contextMenu(QContextMenuEvent *)
Context menu triggered.
bool stopSearchFlag
Flag signalling the search to stop.
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
bool showCopies
Whether to show copies in the tree.
VisualNode * root
The root node of the tree.
int sourceY
Target y coordinate after smooth scrolling.
int refreshPause
Time (in msec) to pause after each refresh.
QVector< QPair< Inspector *, bool > > moveInspectors
The registered move inspectors, and whether they are active.
QVector< QPair< Inspector *, bool > > solutionInspectors
The registered solution inspectors, and whether they are active.
void addedBookmark(const QString &id)
Signals that a bookmark has been added.
Node class that supports visual layout
#define GECODE_GIST_EXPORT
void print(const Search::Statistics &stat, bool restart)
Print statistics.
const int maxScale
Maximum scale factor.
const int defScale
Default scale factor.
const int minScale
Minimum scale factor.
const int maxAutoZoomScale
Maximum scale factor for automatic zoom.
Gecode toplevel namespace