Gecode::Gist::TreeCanvas Class Reference
A canvas that displays the search tree. More...
#include <treecanvas.hh>
Public Slots | |
| void | scaleTree (int scale0) |
| 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 | 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 (void) |
| Call the double click inspector for the currently selected 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 | markCurrentNode (int pit) |
| Recall selection of point in time pit. | |
| 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 | 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. | |
| 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. | |
| 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 | layoutDone (int w, int h, int scale0) |
| Layout done. | |
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 | pointInTimeChanged (int pit) |
| The point in time changed to pit. | |
| void | solution (const Space *) |
| Signals that a solution has been found. | |
| void | finished (void) |
| Signals that Gist is finished. | |
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. | |
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 | setCurrentNode (VisualNode *n) |
| Set the selected node to n. | |
| void | saveCurrentNode (void) |
| Log the current node as new point in time. | |
| virtual void | timerEvent (QTimerEvent *e) |
| Timer invoked for smooth zooming and scrolling. | |
Protected Attributes | |
| QMutex | mutex |
| Mutex for synchronizing acccess to the tree. | |
| QMutex | 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< VisualNode * > | nodeMap |
| The history of inspected nodes. | |
| 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. | |
| 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. | |
| bool | smoothScrollAndZoom |
| Whether to use smooth scrolling and zooming. | |
| int | c_d |
| The recomputation distance. | |
| int | a_d |
| The adaptive recomputation distance. | |
| int | nextPit |
| The next point in time. | |
| int | targetZoom |
| Target zoom value for smooth zooming. | |
| double | metaZoomCurrent |
| Meta current zoom value. | |
| int | zoomTimerId |
| Timer id for smooth zooming. | |
| int | targetScrollX |
| Target x coordinate for smooth scrolling. | |
| int | targetScrollY |
| Target y coordinate for smooth scrolling. | |
| double | metaScrollXCurrent |
| Meta current x coordinate. | |
| double | metaScrollYCurrent |
| Meta current y coordinate. | |
| int | scrollTimerId |
| Timer id for 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. | |
Detailed Description
A canvas that displays the search tree.Definition at line 87 of file treecanvas.hh.
Constructor & Destructor Documentation
| Gecode::Gist::TreeCanvas::~TreeCanvas | ( | void | ) |
Member Function Documentation
| void Gecode::Gist::TreeCanvas::addDoubleClickInspector | ( | Inspector * | i | ) |
| void Gecode::Gist::TreeCanvas::activateDoubleClickInspector | ( | int | i, | |
| bool | active | |||
| ) |
| void Gecode::Gist::TreeCanvas::addSolutionInspector | ( | Inspector * | i | ) |
| void Gecode::Gist::TreeCanvas::activateSolutionInspector | ( | int | i, | |
| bool | active | |||
| ) |
| void Gecode::Gist::TreeCanvas::scaleTree | ( | int | scale0 | ) | [slot] |
| void Gecode::Gist::TreeCanvas::searchAll | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::searchOne | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::toggleHidden | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::hideFailed | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::unhideAll | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::exportPDF | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::exportWholeTreePDF | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::print | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::zoomToFit | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::centerCurrentNode | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::inspectCurrentNode | ( | void | ) | [slot] |
Call the double click inspector for the currently selected node.
Definition at line 493 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::stopSearch | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::reset | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::navUp | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::navDown | ( | void | ) | [slot] |
Move selection to the first child of the selected node.
Definition at line 660 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::navLeft | ( | void | ) | [slot] |
Move selection to the left sibling of the selected node.
Definition at line 685 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::navRight | ( | void | ) | [slot] |
Move selection to the right sibling of the selected node.
Definition at line 699 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::navRoot | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::navNextSol | ( | bool | back = false |
) | [slot] |
| void Gecode::Gist::TreeCanvas::navPrevSol | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::markCurrentNode | ( | int | pit | ) | [slot] |
| void Gecode::Gist::TreeCanvas::setPath | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::inspectPath | ( | void | ) | [slot] |
Call the double click inspector for all nodes on the path from root to head of the path.
Definition at line 626 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::emitStatusChanged | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::setRecompDistances | ( | int | c_d, | |
| int | a_d | |||
| ) | [slot] |
| void Gecode::Gist::TreeCanvas::setAutoHideFailed | ( | bool | b | ) | [slot] |
Set preference whether to automatically hide failed subtrees.
Definition at line 1018 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::setAutoZoom | ( | bool | b | ) | [slot] |
Set preference whether to automatically zoom to fit.
Definition at line 1023 of file treecanvas.cpp.
| bool Gecode::Gist::TreeCanvas::getAutoHideFailed | ( | void | ) | [slot] |
Return preference whether to automatically hide failed subtrees.
Definition at line 1042 of file treecanvas.cpp.
| bool Gecode::Gist::TreeCanvas::getAutoZoom | ( | void | ) | [slot] |
Return preference whether to automatically zoom to fit.
Definition at line 1047 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::setShowCopies | ( | bool | b | ) | [slot] |
| bool Gecode::Gist::TreeCanvas::getShowCopies | ( | void | ) | [slot] |
Return preference whether to show copies in the tree.
Definition at line 1037 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::setRefresh | ( | int | i | ) | [slot] |
| bool Gecode::Gist::TreeCanvas::getSmoothScrollAndZoom | ( | void | ) | [slot] |
Return preference whether to use smooth scrolling and zooming.
Definition at line 1057 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::setSmoothScrollAndZoom | ( | bool | b | ) | [slot] |
Set preference whether to use smooth scrolling and zooming.
Definition at line 1062 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::resizeToOuter | ( | void | ) | [slot] |
Resize to the outer widget size if auto zoom is enabled.
Definition at line 901 of file treecanvas.cpp.
| bool Gecode::Gist::TreeCanvas::finish | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::scaleChanged | ( | int | ) | [signal] |
The scale factor has changed.
| void Gecode::Gist::TreeCanvas::autoZoomChanged | ( | bool | ) | [signal] |
The auto-zoom state was changed.
| void Gecode::Gist::TreeCanvas::contextMenu | ( | QContextMenuEvent * | ) | [signal] |
Context menu triggered.
| void Gecode::Gist::TreeCanvas::statusChanged | ( | VisualNode * | , | |
| const Statistics & | , | |||
| bool | ||||
| ) | [signal] |
Status bar update.
| void Gecode::Gist::TreeCanvas::pointInTimeChanged | ( | int | pit | ) | [signal] |
The point in time changed to pit.
| void Gecode::Gist::TreeCanvas::solution | ( | const Space * | ) | [signal] |
Signals that a solution has been found.
| void Gecode::Gist::TreeCanvas::finished | ( | void | ) | [signal] |
Signals that Gist is finished.
| VisualNode * Gecode::Gist::TreeCanvas::eventNode | ( | QEvent * | event | ) | [protected] |
| bool Gecode::Gist::TreeCanvas::event | ( | QEvent * | event | ) | [protected] |
General event handler, used for displaying tool tips.
Definition at line 882 of file treecanvas.cpp.
| void Gecode::Gist::TreeCanvas::paintEvent | ( | QPaintEvent * | event | ) | [protected] |
| void Gecode::Gist::TreeCanvas::mousePressEvent | ( | QMouseEvent * | event | ) | [protected] |
| void Gecode::Gist::TreeCanvas::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) | [protected] |
| void Gecode::Gist::TreeCanvas::contextMenuEvent | ( | QContextMenuEvent * | event | ) | [protected] |
| void Gecode::Gist::TreeCanvas::setCurrentNode | ( | VisualNode * | n | ) | [protected] |
| void Gecode::Gist::TreeCanvas::saveCurrentNode | ( | void | ) | [protected] |
| void Gecode::Gist::TreeCanvas::timerEvent | ( | QTimerEvent * | e | ) | [protected, virtual] |
| void Gecode::Gist::TreeCanvas::update | ( | void | ) | [slot] |
| void Gecode::Gist::TreeCanvas::layoutDone | ( | int | w, | |
| int | h, | |||
| int | scale0 | |||
| ) | [slot] |
Member Data Documentation
QMutex Gecode::Gist::TreeCanvas::mutex [protected] |
QMutex Gecode::Gist::TreeCanvas::layoutMutex [protected] |
SearcherThread Gecode::Gist::TreeCanvas::searcher [protected] |
bool Gecode::Gist::TreeCanvas::stopSearchFlag [protected] |
bool Gecode::Gist::TreeCanvas::finishedFlag [protected] |
Node::NodeAllocator* Gecode::Gist::TreeCanvas::na [protected] |
VisualNode* Gecode::Gist::TreeCanvas::root [protected] |
BestNode* Gecode::Gist::TreeCanvas::curBest [protected] |
VisualNode* Gecode::Gist::TreeCanvas::currentNode [protected] |
VisualNode* Gecode::Gist::TreeCanvas::pathHead [protected] |
QVector<VisualNode*> Gecode::Gist::TreeCanvas::nodeMap [protected] |
QVector<QPair<Inspector*,bool> > Gecode::Gist::TreeCanvas::doubleClickInspectors [protected] |
The registered click inspectors, and whether they are active.
Definition at line 231 of file treecanvas.hh.
QVector<QPair<Inspector*,bool> > Gecode::Gist::TreeCanvas::solutionInspectors [protected] |
The registered solution inspectors, and whether they are active.
Definition at line 233 of file treecanvas.hh.
QSlider* Gecode::Gist::TreeCanvas::scaleBar [protected] |
Statistics Gecode::Gist::TreeCanvas::stats [protected] |
double Gecode::Gist::TreeCanvas::scale [protected] |
int Gecode::Gist::TreeCanvas::xtrans [protected] |
bool Gecode::Gist::TreeCanvas::autoHideFailed [protected] |
bool Gecode::Gist::TreeCanvas::autoZoom [protected] |
bool Gecode::Gist::TreeCanvas::showCopies [protected] |
int Gecode::Gist::TreeCanvas::refresh [protected] |
bool Gecode::Gist::TreeCanvas::smoothScrollAndZoom [protected] |
int Gecode::Gist::TreeCanvas::c_d [protected] |
int Gecode::Gist::TreeCanvas::a_d [protected] |
int Gecode::Gist::TreeCanvas::nextPit [protected] |
int Gecode::Gist::TreeCanvas::targetZoom [protected] |
double Gecode::Gist::TreeCanvas::metaZoomCurrent [protected] |
int Gecode::Gist::TreeCanvas::zoomTimerId [protected] |
int Gecode::Gist::TreeCanvas::targetScrollX [protected] |
int Gecode::Gist::TreeCanvas::targetScrollY [protected] |
double Gecode::Gist::TreeCanvas::metaScrollXCurrent [protected] |
double Gecode::Gist::TreeCanvas::metaScrollYCurrent [protected] |
int Gecode::Gist::TreeCanvas::scrollTimerId [protected] |
int Gecode::Gist::TreeCanvas::targetW [protected] |
int Gecode::Gist::TreeCanvas::targetH [protected] |
int Gecode::Gist::TreeCanvas::targetScale [protected] |
int Gecode::Gist::TreeCanvas::layoutDoneTimerId [protected] |
The documentation for this class was generated from the following files:
- gecode/gist/treecanvas.hh (Revision: 9107)
- gecode/gist/treecanvas.cpp (Revision: 9124)
