34#ifndef GECODE_GIST_TREECANVAS_HH
35#define GECODE_GIST_TREECANVAS_HH
38#if QT_VERSION >= 0x050000
71 void updateCanvas(
void);
76 void update(
int w,
int h,
int scale0);
119 void scaleTree(
int scale0,
int zoomx=-1,
int zoomy=-1);
370 void inspectSolution(
const Space* s);
Static reference to the currently best space.
Abstract base class for comparators.
Abstract base class for inspectors.
NodeAllocatorBase< VisualNode > NodeAllocator
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.
void navNextSol(bool back=false)
Move selection to next solution (in DFS order)
void update(void)
Update display.
void zoomToFit(void)
Zoom the canvas so that the whole tree fits.
void resizeToOuter(void)
Resize to the outer widget size if auto zoom is enabled.
void activateComparator(int i, bool active)
Set active comparator.
void exportPDF(void)
Export pdf of the current subtree.
int targetX
Target x coordinate after smooth scrolling.
void wheelEvent(QWheelEvent *event)
Handle mouse wheel events.
Statistics stats
Statistics about the search tree.
void resizeEvent(QResizeEvent *event)
Handle resize event.
int targetScale
Target scale after layout.
QVector< VisualNode * > bookmarks
The bookmarks map.
SearcherThread searcher
Search engine thread.
VisualNode * currentNode
The currently selected node.
bool finish(void)
Stop search and wait for it to finish.
void exportWholeTreePDF(void)
Export pdf of the whole tree.
int xtrans
Offset on the x axis so that the tree is centered.
void activateDoubleClickInspector(int i, bool active)
Set active inspector.
void navUp(void)
Move selection to the parent of the selected node.
bool autoHideFailed
Whether to hide failed subtrees automatically.
void labelBranches(void)
Label all branches in subtree under current node.
VisualNode * eventNode(QEvent *event)
Return the node corresponding to the event position.
void contextMenuEvent(QContextMenuEvent *event)
Handle context menu event.
void startCompareNodesBeforeFP(void)
Wait for click on node to compare with current node before fixpoint.
void startCompareNodes(void)
Wait for click on node to compare with current node.
void addComparator(Comparator *c)
Add comparator c.
QMutex mutex
Mutex for synchronizing acccess to the tree.
void inspectBeforeFP(void)
Calls inspectCurrentNode(false)
void hideFailed(void)
Hide failed subtrees of selected node.
bool getAutoZoom(void)
Return preference whether to automatically zoom to fit.
void setRefreshPause(int i)
Set refresh pause in msec.
void bookmarkNode(void)
Bookmark current node.
void searchAll(void)
Explore complete subtree of selected node.
QTimeLine scrollTimeLine
Timer for smooth scrolling.
int layoutDoneTimerId
Timer id for delaying the update.
void addSolutionInspector(Inspector *i)
Add inspector i.
int targetH
Target height after layout.
bool smoothScrollAndZoom
Whether to use smooth scrolling and zooming.
QTimeLine zoomTimeLine
Timer for smooth zooming.
void setPath(void)
Set the current node to be the head of the path.
void navRoot(void)
Move selection to the root node.
void statusChanged(VisualNode *, const Statistics &, bool)
Status bar update.
TreeCanvas(Space *rootSpace, bool bab, QWidget *parent, const Options &opt)
Constructor.
bool event(QEvent *event)
General event handler, used for displaying tool tips.
void setMoveDuringSearch(bool b)
Set preference whether to move cursor during search.
void searchOne(void)
Find next solution below selected node.
void scroll(void)
React to scroll events.
void navDown(void)
Move selection to the first child of the selected node.
QVector< QPair< Comparator *, bool > > comparators
The registered comparators, and whether they are active.
friend class SearcherThread
bool compareNodes
Whether node comparison action is running.
void scaleTree(int scale0, int zoomx=-1, int zoomy=-1)
Set scale factor to scale0.
void activateSolutionInspector(int i, bool active)
Set active inspector.
int c_d
The recomputation distance.
void mousePressEvent(QMouseEvent *event)
Handle mouse press event.
void navLeft(void)
Move selection to the left sibling of the selected node.
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.
void setRefresh(int i)
Set refresh rate.
Node::NodeAllocator * na
Allocator for nodes.
BestNode * curBest
The currently best solution (for branch-and-bound)
void paintEvent(QPaintEvent *event)
Paint the tree.
void unstopAll(void)
Do not stop at any stop node.
bool moveDuringSearch
Whether to move cursor during search.
bool getSmoothScrollAndZoom(void)
Return preference whether to use smooth scrolling and zooming.
void mouseDoubleClickEvent(QMouseEvent *event)
Handle mouse double click event.
int a_d
The adaptive recomputation distance.
void unhideAll(void)
Unhide all nodes below selected node.
void searchFinished(void)
Signals that Gist is finished.
int sourceX
Source x coordinate after smooth scrolling.
void scaleChanged(int)
The scale factor has changed.
bool getAutoHideFailed(void)
Return preference whether to automatically hide failed subtrees.
void solution(const Space *)
Signals that a solution has been found.
int targetW
Target width after layout.
void setRecompDistances(int c_d, int a_d)
Set recomputation distances.
void addMoveInspector(Inspector *i)
Add inspector i.
bool autoZoom
Whether to zoom automatically.
void emitStatusChanged(void)
Re-emit status change information for current node.
void setAutoZoom(bool b)
Set preference whether to automatically zoom to fit.
void centerCurrentNode(void)
Center the view on the currently selected node.
void setSmoothScrollAndZoom(bool b)
Set preference whether to use smooth scrolling and zooming.
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 activateMoveInspector(int i, bool active)
Set active inspector.
void setCurrentNode(VisualNode *n, bool finished=true, bool update=true)
Set the selected node to n.
void contextMenu(QContextMenuEvent *)
Context menu triggered.
bool stopSearchFlag
Flag signalling the search to stop.
void setShowCopies(bool b)
Set preference whether to show copies in the tree.
void labelPath(void)
Label all branches on path to root node.
void layoutDone(int w, int h, int scale0)
Layout done.
virtual void timerEvent(QTimerEvent *e)
Timer invoked for smooth zooming and scrolling.
bool getMoveDuringSearch(void)
Return preference whether to move cursor during search.
bool compareNodesBeforeFP
Whether node comparison action computes fixpoint.
void toggleStop(void)
Do not stop at selected stop node.
void toggleHidden(void)
Toggle hidden state of selected node.
void navRight(void)
Move selection to the right sibling of the selected node.
void navPrevSol(void)
Move selection to previous solution (in DFS order)
bool showCopies
Whether to show copies in the tree.
void inspectPath(void)
Call the double click inspector for all nodes on the path from root to head of the path.
bool getShowCopies(void)
Return preference whether to show copies in the tree.
VisualNode * root
The root node of the tree.
void stopSearch(void)
Stop current search.
void inspectCurrentNode(bool fix=true, int inspectorNo=-1)
Call the double click inspector for the currently selected node.
int sourceY
Target y coordinate after smooth scrolling.
void setAutoHideFailed(bool b)
Set preference whether to automatically hide failed subtrees.
void addDoubleClickInspector(Inspector *i)
Add inspector i.
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
int bab(Space *root, const Gist::Options &opt=Gist::Options::def)
Create a new stand-alone Gist for branch-and-bound search of root.
void print(const Search::Statistics &stat, bool restart)
Print statistics.
Parameters for the tree layout.
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.
The Gecode Interactive Search Tool.
Gecode toplevel namespace