
A canvas that displays the search tree. More...
#include <gecode/gist/treecanvas.hh>
Public Slots | |
| void | scaleTree (int scale0, int zoomx=-1, int zoomy=-1) |
| Set scale factor to scale0. | |
| void | searchAll (void) |
| Explore complete subtree of selected node. | |
| void | searchOne (void) |
| Find next solution below selected node. | |
| void | toggleHidden (void) |
| Toggle hidden state of selected node. | |
| void | hideFailed (void) |
| Hide failed subtrees of selected node. | |
| void | unhideAll (void) |
| Unhide all nodes below selected node. | |
| void | toggleStop (void) |
| Do not stop at selected stop node. | |
| void | unstopAll (void) |
| Do not stop at any stop node. | |
| void | exportPDF (void) |
| Export pdf of the current subtree. | |
| void | exportWholeTreePDF (void) |
| Export pdf of the whole tree. | |
| void | print (void) |
| Print the tree. | |
| void | zoomToFit (void) |
| Zoom the canvas so that the whole tree fits. | |
| void | centerCurrentNode (void) |
| Center the view on the currently selected node. | |
| void | inspectCurrentNode (bool fix=true, int inspectorNo=-1) |
| Call the double click inspector for the currently selected node. | |
| void | inspectBeforeFP (void) |
| Calls inspectCurrentNode(false). | |
| void | labelBranches (void) |
| Label all branches in subtree under current node. | |
| void | labelPath (void) |
| Label all branches on path to root node. | |
| void | stopSearch (void) |
| Stop current search. | |
| void | reset (void) |
| Reset. | |
| void | navUp (void) |
| Move selection to the parent of the selected node. | |
| void | navDown (void) |
| Move selection to the first child of the selected node. | |
| void | navLeft (void) |
| Move selection to the left sibling of the selected node. | |
| void | navRight (void) |
| Move selection to the right sibling of the selected node. | |
| void | navRoot (void) |
| Move selection to the root node. | |
| void | navNextSol (bool back=false) |
| Move selection to next solution (in DFS order). | |
| void | navPrevSol (void) |
| Move selection to previous solution (in DFS order). | |
| void | bookmarkNode (void) |
| Bookmark current node. | |
| void | setPath (void) |
| Set the current node to be the head of the path. | |
| void | inspectPath (void) |
| Call the double click inspector for all nodes on the path from root to head of the path. | |
| void | startCompareNodes (void) |
| Wait for click on node to compare with current node. | |
| void | startCompareNodesBeforeFP (void) |
| Wait for click on node to compare with current node before fixpoint. | |
| void | emitStatusChanged (void) |
| Re-emit status change information for current node. | |
| void | setRecompDistances (int c_d, int a_d) |
| Set recomputation distances. | |
| void | setAutoHideFailed (bool b) |
| Set preference whether to automatically hide failed subtrees. | |
| void | setAutoZoom (bool b) |
| Set preference whether to automatically zoom to fit. | |
| bool | getAutoHideFailed (void) |
| Return preference whether to automatically hide failed subtrees. | |
| bool | getAutoZoom (void) |
| Return preference whether to automatically zoom to fit. | |
| void | setShowCopies (bool b) |
| Set preference whether to show copies in the tree. | |
| bool | getShowCopies (void) |
| Return preference whether to show copies in the tree. | |
| void | setRefresh (int i) |
| Set refresh rate. | |
| void | setRefreshPause (int i) |
| Set refresh pause in msec. | |
| bool | getSmoothScrollAndZoom (void) |
| Return preference whether to use smooth scrolling and zooming. | |
| void | setSmoothScrollAndZoom (bool b) |
| Set preference whether to use smooth scrolling and zooming. | |
| bool | getMoveDuringSearch (void) |
| Return preference whether to move cursor during search. | |
| void | setMoveDuringSearch (bool b) |
| Set preference whether to move cursor during search. | |
| void | resizeToOuter (void) |
| Resize to the outer widget size if auto zoom is enabled. | |
| bool | finish (void) |
| Stop search and wait for it to finish. | |
| void | update (void) |
| Update display. | |
| void | scroll (void) |
| React to scroll events. | |
| void | layoutDone (int w, int h, int scale0) |
| Layout done. | |
| void | setCurrentNode (VisualNode *n, bool finished=true, bool update=true) |
| Set the selected node to n. | |
Signals | |
| void | scaleChanged (int) |
| The scale factor has changed. | |
| void | autoZoomChanged (bool) |
| The auto-zoom state was changed. | |
| void | contextMenu (QContextMenuEvent *) |
| Context menu triggered. | |
| void | statusChanged (VisualNode *, const Statistics &, bool) |
| Status bar update. | |
| void | solution (const Space *) |
| Signals that a solution has been found. | |
| void | searchFinished (void) |
| Signals that Gist is finished. | |
| void | addedBookmark (const QString &id) |
| Signals that a bookmark has been added. | |
| void | removedBookmark (int idx) |
| Signals that a bookmark has been removed. | |
Public Member Functions | |
| TreeCanvas (Space *rootSpace, bool bab, QWidget *parent, const Options &opt) | |
| Constructor. | |
| ~TreeCanvas (void) | |
| Destructor. | |
| void | addDoubleClickInspector (Inspector *i) |
| Add inspector i. | |
| void | activateDoubleClickInspector (int i, bool active) |
| Set active inspector. | |
| void | addSolutionInspector (Inspector *i) |
| Add inspector i. | |
| void | activateSolutionInspector (int i, bool active) |
| Set active inspector. | |
| void | addMoveInspector (Inspector *i) |
| Add inspector i. | |
| void | activateMoveInspector (int i, bool active) |
| Set active inspector. | |
| void | addComparator (Comparator *c) |
| Add comparator c. | |
| void | activateComparator (int i, bool active) |
| Set active comparator. | |
Protected Member Functions | |
| VisualNode * | eventNode (QEvent *event) |
| Return the node corresponding to the event position. | |
| bool | event (QEvent *event) |
| General event handler, used for displaying tool tips. | |
| void | paintEvent (QPaintEvent *event) |
| Paint the tree. | |
| void | mousePressEvent (QMouseEvent *event) |
| Handle mouse press event. | |
| void | mouseDoubleClickEvent (QMouseEvent *event) |
| Handle mouse double click event. | |
| void | contextMenuEvent (QContextMenuEvent *event) |
| Handle context menu event. | |
| void | resizeEvent (QResizeEvent *event) |
| Handle resize event. | |
| void | wheelEvent (QWheelEvent *event) |
| Handle mouse wheel events. | |
| virtual void | timerEvent (QTimerEvent *e) |
| Timer invoked for smooth zooming and scrolling. | |
Protected Attributes | |
| GecodeQMutex | mutex |
| Mutex for synchronizing access to the tree. | |
| GecodeQMutex | layoutMutex |
| Mutex for synchronizing layout and drawing. | |
| SearcherThread | searcher |
| Search engine thread. | |
| bool | stopSearchFlag |
| Flag signalling the search to stop. | |
| bool | finishedFlag |
| Flag signalling that Gist is ready to be closed. | |
| Node::NodeAllocator * | na |
| Allocator for nodes. | |
| VisualNode * | root |
| The root node of the tree. | |
| BestNode * | curBest |
| The currently best solution (for branch-and-bound). | |
| VisualNode * | currentNode |
| The currently selected node. | |
| VisualNode * | pathHead |
| The head of the currently selected path. | |
| QVector< QPair< Inspector *, bool > > | doubleClickInspectors |
| The registered click inspectors, and whether they are active. | |
| QVector< QPair< Inspector *, bool > > | solutionInspectors |
| The registered solution inspectors, and whether they are active. | |
| QVector< QPair< Inspector *, bool > > | moveInspectors |
| The registered move inspectors, and whether they are active. | |
| QVector< QPair< Comparator *, bool > > | comparators |
| The registered comparators, and whether they are active. | |
| QVector< VisualNode * > | bookmarks |
| The bookmarks map. | |
| bool | compareNodes |
| Whether node comparison action is running. | |
| bool | compareNodesBeforeFP |
| Whether node comparison action computes fixpoint. | |
| QSlider * | scaleBar |
| The scale bar. | |
| Statistics | stats |
| Statistics about the search tree. | |
| double | scale |
| Current scale factor. | |
| int | xtrans |
| Offset on the x axis so that the tree is centered. | |
| bool | autoHideFailed |
| Whether to hide failed subtrees automatically. | |
| bool | autoZoom |
| Whether to zoom automatically. | |
| bool | showCopies |
| Whether to show copies in the tree. | |
| int | refresh |
| Refresh rate. | |
| int | refreshPause |
| Time (in msec) to pause after each refresh. | |
| bool | smoothScrollAndZoom |
| Whether to use smooth scrolling and zooming. | |
| bool | moveDuringSearch |
| Whether to move cursor during search. | |
| int | c_d |
| The recomputation distance. | |
| int | a_d |
| The adaptive recomputation distance. | |
| QTimeLine | zoomTimeLine |
| Timer for smooth zooming. | |
| QTimeLine | scrollTimeLine |
| Timer for smooth scrolling. | |
| int | targetX |
| Target x coordinate after smooth scrolling. | |
| int | sourceX |
| Source x coordinate after smooth scrolling. | |
| int | targetY |
| Target y coordinate after smooth scrolling. | |
| int | sourceY |
| Target y coordinate after smooth scrolling. | |
| int | targetW |
| Target width after layout. | |
| int | targetH |
| Target height after layout. | |
| int | targetScale |
| Target scale after layout. | |
| int | layoutDoneTimerId |
| Timer id for delaying the update. | |
A canvas that displays the search tree.
Definition at line 93 of file treecanvas.hh.
| Gecode::Gist::TreeCanvas::TreeCanvas | ( | Space * | rootSpace, |
| bool | bab, | ||
| QWidget * | parent, | ||
| const Options & | opt ) |
Constructor.
Definition at line 52 of file treecanvas.cpp.
| Gecode::Gist::TreeCanvas::~TreeCanvas | ( | void | ) |
Destructor.
Definition at line 137 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::addDoubleClickInspector | ( | Inspector * | i | ) |
Add inspector i.
Definition at line 146 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::activateDoubleClickInspector | ( | int | i, |
| bool | active ) |
Set active inspector.
Definition at line 151 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::addSolutionInspector | ( | Inspector * | i | ) |
Add inspector i.
Definition at line 157 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::activateSolutionInspector | ( | int | i, |
| bool | active ) |
Set active inspector.
Definition at line 162 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::addMoveInspector | ( | Inspector * | i | ) |
Add inspector i.
Definition at line 168 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::activateMoveInspector | ( | int | i, |
| bool | active ) |
Set active inspector.
Definition at line 173 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::addComparator | ( | Comparator * | c | ) |
Add comparator c.
Definition at line 179 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::activateComparator | ( | int | i, |
| bool | active ) |
Set active comparator.
Definition at line 184 of file treecanvas.cpp.
|
slot |
Set scale factor to scale0.
Definition at line 190 of file treecanvas.cpp.
|
slot |
Explore complete subtree of selected node.
Definition at line 459 of file treecanvas.cpp.
|
slot |
Find next solution below selected node.
Definition at line 465 of file treecanvas.cpp.
|
slot |
Toggle hidden state of selected node.
Definition at line 471 of file treecanvas.cpp.
|
slot |
Hide failed subtrees of selected node.
Definition at line 480 of file treecanvas.cpp.
|
slot |
Unhide all nodes below selected node.
Definition at line 489 of file treecanvas.cpp.
|
slot |
Do not stop at selected stop node.
Definition at line 499 of file treecanvas.cpp.
|
slot |
Do not stop at any stop node.
Definition at line 508 of file treecanvas.cpp.
|
slot |
Export pdf of the current subtree.
Definition at line 1083 of file treecanvas.cpp.
|
slot |
Export pdf of the whole tree.
Definition at line 1076 of file treecanvas.cpp.
|
slot |
Print the tree.
Definition at line 1090 of file treecanvas.cpp.
|
slot |
Zoom the canvas so that the whole tree fits.
Definition at line 538 of file treecanvas.cpp.
|
slot |
Center the view on the currently selected node.
Definition at line 574 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 628 of file treecanvas.cpp.
|
slot |
Calls inspectCurrentNode(false).
Definition at line 764 of file treecanvas.cpp.
|
slot |
Label all branches in subtree under current node.
Definition at line 769 of file treecanvas.cpp.
|
slot |
Label all branches on path to root node.
Definition at line 777 of file treecanvas.cpp.
|
slot |
Stop current search.
Definition at line 820 of file treecanvas.cpp.
|
slot |
Reset.
Definition at line 826 of file treecanvas.cpp.
|
slot |
Move selection to the parent of the selected node.
Definition at line 935 of file treecanvas.cpp.
|
slot |
Move selection to the first child of the selected node.
Definition at line 948 of file treecanvas.cpp.
|
slot |
Move selection to the left sibling of the selected node.
Definition at line 971 of file treecanvas.cpp.
|
slot |
Move selection to the right sibling of the selected node.
Definition at line 985 of file treecanvas.cpp.
|
slot |
Move selection to the root node.
Definition at line 999 of file treecanvas.cpp.
|
slot |
Move selection to next solution (in DFS order).
Definition at line 1006 of file treecanvas.cpp.
|
slot |
Move selection to previous solution (in DFS order).
Definition at line 1019 of file treecanvas.cpp.
|
slot |
Bookmark current node.
Definition at line 859 of file treecanvas.cpp.
|
slot |
Set the current node to be the head of the path.
Definition at line 884 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 898 of file treecanvas.cpp.
|
slot |
Wait for click on node to compare with current node.
Definition at line 914 of file treecanvas.cpp.
|
slot |
Wait for click on node to compare with current node before fixpoint.
Definition at line 922 of file treecanvas.cpp.
|
slot |
Re-emit status change information for current node.
Definition at line 930 of file treecanvas.cpp.
|
slot |
Set recomputation distances.
Definition at line 1421 of file treecanvas.cpp.
|
slot |
Set preference whether to automatically hide failed subtrees.
Definition at line 1426 of file treecanvas.cpp.
|
slot |
Set preference whether to automatically zoom to fit.
Definition at line 1431 of file treecanvas.cpp.
|
slot |
Return preference whether to automatically hide failed subtrees.
Definition at line 1450 of file treecanvas.cpp.
|
slot |
Return preference whether to automatically zoom to fit.
Definition at line 1455 of file treecanvas.cpp.
|
slot |
Set preference whether to show copies in the tree.
Definition at line 1441 of file treecanvas.cpp.
|
slot |
Return preference whether to show copies in the tree.
Definition at line 1445 of file treecanvas.cpp.
|
slot |
Set refresh rate.
Definition at line 1460 of file treecanvas.cpp.
|
slot |
Set refresh pause in msec.
Definition at line 1465 of file treecanvas.cpp.
|
slot |
Return preference whether to use smooth scrolling and zooming.
Definition at line 1472 of file treecanvas.cpp.
|
slot |
Set preference whether to use smooth scrolling and zooming.
Definition at line 1477 of file treecanvas.cpp.
|
slot |
Return preference whether to move cursor during search.
Definition at line 1482 of file treecanvas.cpp.
|
slot |
Set preference whether to move cursor during search.
Definition at line 1487 of file treecanvas.cpp.
|
slot |
Resize to the outer widget size if auto zoom is enabled.
Definition at line 1200 of file treecanvas.cpp.
|
slot |
Stop search and wait for it to finish.
Definition at line 1310 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 1126 of file treecanvas.cpp.
|
protected |
General event handler, used for displaying tool tips.
Definition at line 1181 of file treecanvas.cpp.
|
protected |
Paint the tree.
Definition at line 1206 of file treecanvas.cpp.
|
protected |
Handle mouse press event.
Definition at line 1362 of file treecanvas.cpp.
|
protected |
Handle mouse double click event.
Definition at line 1245 of file treecanvas.cpp.
|
protected |
Handle context menu event.
Definition at line 1262 of file treecanvas.cpp.
|
protected |
Handle resize event.
Definition at line 1278 of file treecanvas.cpp.
|
protected |
Handle mouse wheel events.
Definition at line 1292 of file treecanvas.cpp.
|
protectedvirtual |
Timer invoked for smooth zooming and scrolling.
Definition at line 518 of file treecanvas.cpp.
|
slot |
Update display.
Definition at line 234 of file treecanvas.cpp.
|
slot |
React to scroll events.
Definition at line 264 of file treecanvas.cpp.
|
slot |
Layout done.
Definition at line 269 of file treecanvas.cpp.
|
slot |
Set the selected node to n.
Definition at line 1327 of file treecanvas.cpp.
|
protected |
Mutex for synchronizing access to the tree.
Definition at line 252 of file treecanvas.hh.
|
protected |
Mutex for synchronizing layout and drawing.
Definition at line 254 of file treecanvas.hh.
|
protected |
Search engine thread.
Definition at line 256 of file treecanvas.hh.
|
protected |
Flag signalling the search to stop.
Definition at line 258 of file treecanvas.hh.
|
protected |
Flag signalling that Gist is ready to be closed.
Definition at line 260 of file treecanvas.hh.
|
protected |
Allocator for nodes.
Definition at line 262 of file treecanvas.hh.
|
protected |
The root node of the tree.
Definition at line 264 of file treecanvas.hh.
|
protected |
The currently best solution (for branch-and-bound).
Definition at line 266 of file treecanvas.hh.
|
protected |
The currently selected node.
Definition at line 268 of file treecanvas.hh.
|
protected |
The head of the currently selected path.
Definition at line 270 of file treecanvas.hh.
|
protected |
The registered click inspectors, and whether they are active.
Definition at line 272 of file treecanvas.hh.
|
protected |
The registered solution inspectors, and whether they are active.
Definition at line 274 of file treecanvas.hh.
|
protected |
The registered move inspectors, and whether they are active.
Definition at line 276 of file treecanvas.hh.
|
protected |
The registered comparators, and whether they are active.
Definition at line 278 of file treecanvas.hh.
|
protected |
The bookmarks map.
Definition at line 281 of file treecanvas.hh.
|
protected |
Whether node comparison action is running.
Definition at line 284 of file treecanvas.hh.
|
protected |
Whether node comparison action computes fixpoint.
Definition at line 286 of file treecanvas.hh.
|
protected |
The scale bar.
Definition at line 289 of file treecanvas.hh.
|
protected |
Statistics about the search tree.
Definition at line 292 of file treecanvas.hh.
|
protected |
Current scale factor.
Definition at line 295 of file treecanvas.hh.
|
protected |
Offset on the x axis so that the tree is centered.
Definition at line 297 of file treecanvas.hh.
|
protected |
Whether to hide failed subtrees automatically.
Definition at line 300 of file treecanvas.hh.
|
protected |
Whether to zoom automatically.
Definition at line 302 of file treecanvas.hh.
|
protected |
Whether to show copies in the tree.
Definition at line 304 of file treecanvas.hh.
|
protected |
Refresh rate.
Definition at line 306 of file treecanvas.hh.
|
protected |
Time (in msec) to pause after each refresh.
Definition at line 308 of file treecanvas.hh.
|
protected |
Whether to use smooth scrolling and zooming.
Definition at line 310 of file treecanvas.hh.
|
protected |
Whether to move cursor during search.
Definition at line 312 of file treecanvas.hh.
|
protected |
The recomputation distance.
Definition at line 315 of file treecanvas.hh.
|
protected |
The adaptive recomputation distance.
Definition at line 317 of file treecanvas.hh.
|
protected |
Timer for smooth zooming.
Definition at line 337 of file treecanvas.hh.
|
protected |
Timer for smooth scrolling.
Definition at line 339 of file treecanvas.hh.
|
protected |
Target x coordinate after smooth scrolling.
Definition at line 341 of file treecanvas.hh.
|
protected |
Source x coordinate after smooth scrolling.
Definition at line 343 of file treecanvas.hh.
|
protected |
Target y coordinate after smooth scrolling.
Definition at line 345 of file treecanvas.hh.
|
protected |
Target y coordinate after smooth scrolling.
Definition at line 347 of file treecanvas.hh.
|
protected |
Target width after layout.
Definition at line 350 of file treecanvas.hh.
|
protected |
Target height after layout.
Definition at line 352 of file treecanvas.hh.
|
protected |
Target scale after layout.
Definition at line 354 of file treecanvas.hh.
|
protected |
Timer id for delaying the update.
Definition at line 356 of file treecanvas.hh.