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);
77 void statusChanged(
bool);
78 void scaleChanged(
int);
79 void solution(
const Space*);
80 void searchFinished(
void);
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);
229 void scaleChanged(
int);
231 void autoZoomChanged(
bool);
233 void contextMenu(QContextMenuEvent*);
237 void solution(
const Space*);
239 void searchFinished(
void);
241 void addedBookmark(
const QString&
id);
243 void removedBookmark(
int idx);
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);
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.
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.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
#define GECODE_GIST_EXPORT
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
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.
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.
Gecode toplevel namespace
int sourceY
Target y coordinate after smooth scrolling.
int targetH
Target height after layout.
QTimeLine zoomTimeLine
Timer for smooth zooming.
void update(IntSet &y, Space &home, IntSet &py)
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.