A canvas that displays the search tree. More...
#include <treecanvas.hh>
Public Slots | |
void | scaleTree (int scale0, int zoomx=-1, int zoomy=-1) |
Set scale factor to scale0. More... | |
void | searchAll (void) |
Explore complete subtree of selected node. More... | |
void | searchOne (void) |
Find next solution below selected node. More... | |
void | toggleHidden (void) |
Toggle hidden state of selected node. More... | |
void | hideFailed (void) |
Hide failed subtrees of selected node. More... | |
void | unhideAll (void) |
Unhide all nodes below selected node. More... | |
void | toggleStop (void) |
Do not stop at selected stop node. More... | |
void | unstopAll (void) |
Do not stop at any stop node. More... | |
void | exportPDF (void) |
Export pdf of the current subtree. More... | |
void | exportWholeTreePDF (void) |
Export pdf of the whole tree. More... | |
void | print (void) |
Print the tree. More... | |
void | zoomToFit (void) |
Zoom the canvas so that the whole tree fits. More... | |
void | centerCurrentNode (void) |
Center the view on the currently selected node. More... | |
void | inspectCurrentNode (bool fix=true, int inspectorNo=-1) |
Call the double click inspector for the currently selected node. More... | |
void | inspectBeforeFP (void) |
Calls inspectCurrentNode(false) More... | |
void | stopSearch (void) |
Stop current search. More... | |
void | reset (void) |
Reset. More... | |
void | navUp (void) |
Move selection to the parent of the selected node. More... | |
void | navDown (void) |
Move selection to the first child of the selected node. More... | |
void | navLeft (void) |
Move selection to the left sibling of the selected node. More... | |
void | navRight (void) |
Move selection to the right sibling of the selected node. More... | |
void | navRoot (void) |
Move selection to the root node. More... | |
void | navNextSol (bool back=false) |
Move selection to next solution (in DFS order) More... | |
void | navPrevSol (void) |
Move selection to previous solution (in DFS order) More... | |
void | bookmarkNode (void) |
Bookmark current node. More... | |
void | setPath (void) |
Set the current node to be the head of the path. More... | |
void | inspectPath (void) |
Call the double click inspector for all nodes on the path from root to head of the path. More... | |
void | startCompareNodes (void) |
Wait for click on node to compare with current node. More... | |
void | startCompareNodesBeforeFP (void) |
Wait for click on node to compare with current node before fixpoint. More... | |
void | emitStatusChanged (void) |
Re-emit status change information for current node. More... | |
void | setRecompDistances (int c_d, int a_d) |
Set recomputation distances. More... | |
void | setAutoHideFailed (bool b) |
Set preference whether to automatically hide failed subtrees. More... | |
void | setAutoZoom (bool b) |
Set preference whether to automatically zoom to fit. More... | |
bool | getAutoHideFailed (void) |
Return preference whether to automatically hide failed subtrees. More... | |
bool | getAutoZoom (void) |
Return preference whether to automatically zoom to fit. More... | |
void | setShowCopies (bool b) |
Set preference whether to show copies in the tree. More... | |
bool | getShowCopies (void) |
Return preference whether to show copies in the tree. More... | |
void | setRefresh (int i) |
Set refresh rate. More... | |
void | setRefreshPause (int i) |
Set refresh pause in msec. More... | |
bool | getSmoothScrollAndZoom (void) |
Return preference whether to use smooth scrolling and zooming. More... | |
void | setSmoothScrollAndZoom (bool b) |
Set preference whether to use smooth scrolling and zooming. More... | |
void | resizeToOuter (void) |
Resize to the outer widget size if auto zoom is enabled. More... | |
bool | finish (void) |
Stop search and wait for it to finish. More... | |
void | update (void) |
Update display. More... | |
void | scroll (void) |
React to scroll events. More... | |
void | layoutDone (int w, int h, int scale0) |
Layout done. More... | |
Signals | |
void | scaleChanged (int) |
The scale factor has changed. More... | |
void | autoZoomChanged (bool) |
The auto-zoom state was changed. More... | |
void | contextMenu (QContextMenuEvent *) |
Context menu triggered. More... | |
void | statusChanged (VisualNode *, const Statistics &, bool) |
Status bar update. More... | |
void | solution (const Space *) |
Signals that a solution has been found. More... | |
void | searchFinished (void) |
Signals that Gist is finished. More... | |
void | addedBookmark (const QString &id) |
Signals that a bookmark has been added. More... | |
void | removedBookmark (int idx) |
Signals that a bookmark has been removed. More... | |
Public Member Functions | |
TreeCanvas (Space *rootSpace, bool bab, QWidget *parent, const Options &opt) | |
Constructor. More... | |
~TreeCanvas (void) | |
Destructor. More... | |
void | addDoubleClickInspector (Inspector *i) |
Add inspector i. More... | |
void | activateDoubleClickInspector (int i, bool active) |
Set active inspector. More... | |
void | addSolutionInspector (Inspector *i) |
Add inspector i. More... | |
void | activateSolutionInspector (int i, bool active) |
Set active inspector. More... | |
void | addMoveInspector (Inspector *i) |
Add inspector i. More... | |
void | activateMoveInspector (int i, bool active) |
Set active inspector. More... | |
void | addComparator (Comparator *c) |
Add comparator c. More... | |
void | activateComparator (int i, bool active) |
Set active comparator. More... | |
Protected Member Functions | |
VisualNode * | eventNode (QEvent *event) |
Return the node corresponding to the event position. More... | |
bool | event (QEvent *event) |
General event handler, used for displaying tool tips. More... | |
void | paintEvent (QPaintEvent *event) |
Paint the tree. More... | |
void | mousePressEvent (QMouseEvent *event) |
Handle mouse press event. More... | |
void | mouseDoubleClickEvent (QMouseEvent *event) |
Handle mouse double click event. More... | |
void | contextMenuEvent (QContextMenuEvent *event) |
Handle context menu event. More... | |
void | resizeEvent (QResizeEvent *event) |
Handle resize event. More... | |
void | wheelEvent (QWheelEvent *event) |
Handle mouse wheel events. More... | |
void | setCurrentNode (VisualNode *n, bool update=true) |
Set the selected node to n. More... | |
virtual void | timerEvent (QTimerEvent *e) |
Timer invoked for smooth zooming and scrolling. More... | |
Protected Attributes | |
QMutex | mutex |
Mutex for synchronizing acccess to the tree. More... | |
QMutex | layoutMutex |
Mutex for synchronizing layout and drawing. More... | |
SearcherThread | searcher |
Search engine thread. More... | |
bool | stopSearchFlag |
Flag signalling the search to stop. More... | |
bool | finishedFlag |
Flag signalling that Gist is ready to be closed. More... | |
Node::NodeAllocator * | na |
Allocator for nodes. More... | |
VisualNode * | root |
The root node of the tree. More... | |
BestNode * | curBest |
The currently best solution (for branch-and-bound) More... | |
VisualNode * | currentNode |
The currently selected node. More... | |
VisualNode * | pathHead |
The head of the currently selected path. More... | |
QVector< QPair< Inspector *, bool > > | doubleClickInspectors |
The registered click inspectors, and whether they are active. More... | |
QVector< QPair< Inspector *, bool > > | solutionInspectors |
The registered solution inspectors, and whether they are active. More... | |
QVector< QPair< Inspector *, bool > > | moveInspectors |
The registered move inspectors, and whether they are active. More... | |
QVector< QPair< Comparator *, bool > > | comparators |
The registered comparators, and whether they are active. More... | |
QVector< VisualNode * > | bookmarks |
The bookmarks map. More... | |
bool | compareNodes |
Whether node comparison action is running. More... | |
bool | compareNodesBeforeFP |
Whether node comparison action computes fixpoint. More... | |
QSlider * | scaleBar |
The scale bar. More... | |
Statistics | stats |
Statistics about the search tree. More... | |
double | scale |
Current scale factor. More... | |
int | xtrans |
Offset on the x axis so that the tree is centered. More... | |
bool | autoHideFailed |
Whether to hide failed subtrees automatically. More... | |
bool | autoZoom |
Whether to zoom automatically. More... | |
bool | showCopies |
Whether to show copies in the tree. More... | |
int | refresh |
Refresh rate. More... | |
int | refreshPause |
Time (in msec) to pause after each refresh. More... | |
bool | smoothScrollAndZoom |
Whether to use smooth scrolling and zooming. More... | |
int | c_d |
The recomputation distance. More... | |
int | a_d |
The adaptive recomputation distance. More... | |
QTimeLine | zoomTimeLine |
Timer for smooth zooming. More... | |
QTimeLine | scrollTimeLine |
Timer for smooth scrolling. More... | |
int | targetX |
Target x coordinate after smooth scrolling. More... | |
int | sourceX |
Source x coordinate after smooth scrolling. More... | |
int | targetY |
Target y coordinate after smooth scrolling. More... | |
int | sourceY |
Target y coordinate after smooth scrolling. More... | |
int | targetW |
Target width after layout. More... | |
int | targetH |
Target height after layout. More... | |
int | targetScale |
Target scale after layout. More... | |
int | layoutDoneTimerId |
Timer id for delaying the update. More... | |
A canvas that displays the search tree.
Definition at line 87 of file treecanvas.hh.
Gecode::Gist::TreeCanvas::TreeCanvas | ( | Space * | rootSpace, |
bool | bab, | ||
QWidget * | parent, | ||
const Options & | opt | ||
) |
Constructor.
Definition at line 54 of file treecanvas.cpp.
Gecode::Gist::TreeCanvas::~TreeCanvas | ( | void | ) |
Destructor.
Definition at line 127 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::addDoubleClickInspector | ( | Inspector * | i | ) |
Add inspector i.
Definition at line 136 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::activateDoubleClickInspector | ( | int | i, |
bool | active | ||
) |
Set active inspector.
Definition at line 141 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::addSolutionInspector | ( | Inspector * | i | ) |
Add inspector i.
Definition at line 147 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::activateSolutionInspector | ( | int | i, |
bool | active | ||
) |
Set active inspector.
Definition at line 152 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::addMoveInspector | ( | Inspector * | i | ) |
Add inspector i.
Definition at line 158 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::activateMoveInspector | ( | int | i, |
bool | active | ||
) |
Set active inspector.
Definition at line 163 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::addComparator | ( | Comparator * | c | ) |
Add comparator c.
Definition at line 169 of file treecanvas.cpp.
void Gecode::Gist::TreeCanvas::activateComparator | ( | int | i, |
bool | active | ||
) |
Set active comparator.
Definition at line 174 of file treecanvas.cpp.
|
slot |
Set scale factor to scale0.
Definition at line 180 of file treecanvas.cpp.
|
slot |
Explore complete subtree of selected node.
Definition at line 447 of file treecanvas.cpp.
|
slot |
Find next solution below selected node.
Definition at line 453 of file treecanvas.cpp.
|
slot |
Toggle hidden state of selected node.
Definition at line 459 of file treecanvas.cpp.
|
slot |
Hide failed subtrees of selected node.
Definition at line 468 of file treecanvas.cpp.
|
slot |
Unhide all nodes below selected node.
Definition at line 477 of file treecanvas.cpp.
|
slot |
Do not stop at selected stop node.
Definition at line 487 of file treecanvas.cpp.
|
slot |
Do not stop at any stop node.
Definition at line 496 of file treecanvas.cpp.
|
slot |
Export pdf of the current subtree.
Definition at line 1051 of file treecanvas.cpp.
|
slot |
Export pdf of the whole tree.
Definition at line 1044 of file treecanvas.cpp.
|
slot |
Print the tree.
Definition at line 1058 of file treecanvas.cpp.
|
slot |
Zoom the canvas so that the whole tree fits.
Definition at line 526 of file treecanvas.cpp.
|
slot |
Center the view on the currently selected node.
Definition at line 562 of file treecanvas.cpp.
|
slot |
Call the double click inspector for the currently selected node.
If fix is true, then the node is inspected after fixpoint computation, otherwise its status after branching but before fixpoint computation is inspected.
Definition at line 616 of file treecanvas.cpp.
|
slot |
Calls inspectCurrentNode(false)
Definition at line 755 of file treecanvas.cpp.
|
slot |
Stop current search.
Definition at line 797 of file treecanvas.cpp.
|
slot |
Reset.
Definition at line 803 of file treecanvas.cpp.
|
slot |
Move selection to the parent of the selected node.
Definition at line 912 of file treecanvas.cpp.
|
slot |
Move selection to the first child of the selected node.
Definition at line 925 of file treecanvas.cpp.
|
slot |
Move selection to the left sibling of the selected node.
Definition at line 948 of file treecanvas.cpp.
|
slot |
Move selection to the right sibling of the selected node.
Definition at line 962 of file treecanvas.cpp.
|
slot |
Move selection to the root node.
Definition at line 976 of file treecanvas.cpp.
|
slot |
Move selection to next solution (in DFS order)
Definition at line 983 of file treecanvas.cpp.
|
slot |
Move selection to previous solution (in DFS order)
Definition at line 996 of file treecanvas.cpp.
|
slot |
Bookmark current node.
Definition at line 836 of file treecanvas.cpp.
|
slot |
Set the current node to be the head of the path.
Definition at line 861 of file treecanvas.cpp.
|
slot |
Call the double click inspector for all nodes on the path from root to head of the path.
Definition at line 875 of file treecanvas.cpp.
|
slot |
Wait for click on node to compare with current node.
Definition at line 891 of file treecanvas.cpp.
|
slot |
Wait for click on node to compare with current node before fixpoint.
Definition at line 899 of file treecanvas.cpp.
|
slot |
Re-emit status change information for current node.
Definition at line 907 of file treecanvas.cpp.
|
slot |
Set recomputation distances.
Definition at line 1368 of file treecanvas.cpp.
|
slot |
Set preference whether to automatically hide failed subtrees.
Definition at line 1373 of file treecanvas.cpp.
|
slot |
Set preference whether to automatically zoom to fit.
Definition at line 1378 of file treecanvas.cpp.
|
slot |
Return preference whether to automatically hide failed subtrees.
Definition at line 1397 of file treecanvas.cpp.
|
slot |
Return preference whether to automatically zoom to fit.
Definition at line 1402 of file treecanvas.cpp.
|
slot |
Set preference whether to show copies in the tree.
Definition at line 1388 of file treecanvas.cpp.
|
slot |
Return preference whether to show copies in the tree.
Definition at line 1392 of file treecanvas.cpp.
|
slot |
Set refresh rate.
Definition at line 1407 of file treecanvas.cpp.
|
slot |
Set refresh pause in msec.
Definition at line 1412 of file treecanvas.cpp.
|
slot |
Return preference whether to use smooth scrolling and zooming.
Definition at line 1419 of file treecanvas.cpp.
|
slot |
Set preference whether to use smooth scrolling and zooming.
Definition at line 1424 of file treecanvas.cpp.
|
slot |
Resize to the outer widget size if auto zoom is enabled.
Definition at line 1159 of file treecanvas.cpp.
|
slot |
Stop search and wait for it to finish.
Definition at line 1263 of file treecanvas.cpp.
|
signal |
The scale factor has changed.
|
signal |
The auto-zoom state was changed.
|
signal |
Context menu triggered.
|
signal |
Status bar update.
|
signal |
Signals that a solution has been found.
|
signal |
Signals that Gist is finished.
|
signal |
Signals that a bookmark has been added.
|
signal |
Signals that a bookmark has been removed.
|
protected |
Return the node corresponding to the event position.
Definition at line 1090 of file treecanvas.cpp.
|
protected |
General event handler, used for displaying tool tips.
Definition at line 1140 of file treecanvas.cpp.
|
protected |
Paint the tree.
Definition at line 1165 of file treecanvas.cpp.
|
protected |
Handle mouse press event.
Definition at line 1314 of file treecanvas.cpp.
|
protected |
Handle mouse double click event.
Definition at line 1204 of file treecanvas.cpp.
|
protected |
Handle context menu event.
Definition at line 1221 of file treecanvas.cpp.
|
protected |
Handle resize event.
Definition at line 1237 of file treecanvas.cpp.
|
protected |
Handle mouse wheel events.
Definition at line 1251 of file treecanvas.cpp.
|
protected |
Set the selected node to n.
Definition at line 1280 of file treecanvas.cpp.
|
protectedvirtual |
Timer invoked for smooth zooming and scrolling.
Definition at line 506 of file treecanvas.cpp.
|
slot |
Update display.
Definition at line 224 of file treecanvas.cpp.
|
slot |
React to scroll events.
Definition at line 254 of file treecanvas.cpp.
|
slot |
Layout done.
Definition at line 259 of file treecanvas.cpp.
|
protected |
Mutex for synchronizing acccess to the tree.
Definition at line 238 of file treecanvas.hh.
|
protected |
Mutex for synchronizing layout and drawing.
Definition at line 240 of file treecanvas.hh.
|
protected |
Search engine thread.
Definition at line 242 of file treecanvas.hh.
|
protected |
Flag signalling the search to stop.
Definition at line 244 of file treecanvas.hh.
|
protected |
Flag signalling that Gist is ready to be closed.
Definition at line 246 of file treecanvas.hh.
|
protected |
Allocator for nodes.
Definition at line 248 of file treecanvas.hh.
|
protected |
The root node of the tree.
Definition at line 250 of file treecanvas.hh.
|
protected |
The currently best solution (for branch-and-bound)
Definition at line 252 of file treecanvas.hh.
|
protected |
The currently selected node.
Definition at line 254 of file treecanvas.hh.
|
protected |
The head of the currently selected path.
Definition at line 256 of file treecanvas.hh.
|
protected |
The registered click inspectors, and whether they are active.
Definition at line 258 of file treecanvas.hh.
|
protected |
The registered solution inspectors, and whether they are active.
Definition at line 260 of file treecanvas.hh.
|
protected |
The registered move inspectors, and whether they are active.
Definition at line 262 of file treecanvas.hh.
|
protected |
The registered comparators, and whether they are active.
Definition at line 264 of file treecanvas.hh.
|
protected |
The bookmarks map.
Definition at line 267 of file treecanvas.hh.
|
protected |
Whether node comparison action is running.
Definition at line 270 of file treecanvas.hh.
|
protected |
Whether node comparison action computes fixpoint.
Definition at line 272 of file treecanvas.hh.
|
protected |
The scale bar.
Definition at line 275 of file treecanvas.hh.
|
protected |
Statistics about the search tree.
Definition at line 278 of file treecanvas.hh.
|
protected |
Current scale factor.
Definition at line 281 of file treecanvas.hh.
|
protected |
Offset on the x axis so that the tree is centered.
Definition at line 283 of file treecanvas.hh.
|
protected |
Whether to hide failed subtrees automatically.
Definition at line 286 of file treecanvas.hh.
|
protected |
Whether to zoom automatically.
Definition at line 288 of file treecanvas.hh.
|
protected |
Whether to show copies in the tree.
Definition at line 290 of file treecanvas.hh.
|
protected |
Refresh rate.
Definition at line 292 of file treecanvas.hh.
|
protected |
Time (in msec) to pause after each refresh.
Definition at line 294 of file treecanvas.hh.
|
protected |
Whether to use smooth scrolling and zooming.
Definition at line 296 of file treecanvas.hh.
|
protected |
The recomputation distance.
Definition at line 299 of file treecanvas.hh.
|
protected |
The adaptive recomputation distance.
Definition at line 301 of file treecanvas.hh.
|
protected |
Timer for smooth zooming.
Definition at line 323 of file treecanvas.hh.
|
protected |
Timer for smooth scrolling.
Definition at line 325 of file treecanvas.hh.
|
protected |
Target x coordinate after smooth scrolling.
Definition at line 327 of file treecanvas.hh.
|
protected |
Source x coordinate after smooth scrolling.
Definition at line 329 of file treecanvas.hh.
|
protected |
Target y coordinate after smooth scrolling.
Definition at line 331 of file treecanvas.hh.
|
protected |
Target y coordinate after smooth scrolling.
Definition at line 333 of file treecanvas.hh.
|
protected |
Target width after layout.
Definition at line 336 of file treecanvas.hh.
|
protected |
Target height after layout.
Definition at line 338 of file treecanvas.hh.
|
protected |
Target scale after layout.
Definition at line 340 of file treecanvas.hh.
|
protected |
Timer id for delaying the update.
Definition at line 342 of file treecanvas.hh.