Gecode::Gist::VisualNode Class Reference

Node class that supports visual layout More...

`#include <visualnode.hh>`

## Public Member Functions

| VisualNode (int p)
| Construct with parent p.
| VisualNode (Space *root)
| Constructor for root node from root and b.
bool | isHidden (void)
| Return if node is hidden.
void | setHidden (bool h)
| Set hidden state to h.
void | setStop (bool h)
| Set stop state to h.
void | dirtyUp (const NodeAllocator &na)
| Mark all nodes up the path to the parent as dirty.
void | layout (const NodeAllocator &na)
| Compute layout for the subtree of this node.
int | getOffset (void)
| Return offset off this node from its parent.
void | setOffset (int n)
| Set offset of this node, relative to its parent.
bool | isDirty (void)
| Return whether node is marked as dirty.
void | setDirty (bool d)
| Mark node as dirty.
bool | childrenLayoutIsDone (void)
| Return whether the layout of the node's children has been completed.
void | setChildrenLayoutDone (bool d)
| Mark node whether the layout of the node's children has been completed.
bool | isMarked (void)
| Return whether node is marked.
void | setMarked (bool m)
| Set mark of this node.
bool | isBookmarked (void)
| Return whether node is bookmarked.
void | setBookmarked (bool m)
| Set bookmark of this node.
void | pathUp (const NodeAllocator &na)
| Set all nodes from the node to the root to be on the path.
void | unPathUp (const NodeAllocator &na)
| Set all nodes from the node to the root not to be on the path.
bool | isOnPath (void)
| Return whether node is on the path.
int | getPathAlternative (const NodeAllocator &na)
| Return the alternative of the child that is on the path (-1 if none).
void | setOnPath (bool onPath0)
| Set whether node is on the path.
void | toggleHidden (const NodeAllocator &na)
| Toggle whether this node is hidden.
void | hideFailed (const NodeAllocator &na, bool onlyDirty=false)
| Hide all failed subtrees of this node.
void | unhideAll (const NodeAllocator &na)
| Unhide all nodes in the subtree of this node.
void | toggleStop (const NodeAllocator &na)
| Do not stop at this node.
void | unstopAll (const NodeAllocator &na)
| Do not stop at any stop node in the subtree of this node.
Shape * | getShape (void)
| Return the shape of this node.
void | setShape (Shape *s)
| Set the shape of this node.
void | computeShape (const NodeAllocator &na)
| Compute the shape according to the shapes of the children.
BoundingBox | getBoundingBox (void)
| Return the bounding box.
void | changedStatus (const NodeAllocator &na)
| Signal that the status has changed.
VisualNode * | findNode (const NodeAllocator &na, int x, int y)
| Find a node in this subtree at coordinates x, y.
void | labelBranches (NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
| Create or clear branch labels in subtree.
void | labelPath (NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
| Create or clear branch labels on path to root.
std::string | getBranchLabel (NodeAllocator &na, VisualNode *p, const Choice *c, BestNode *curBest, int c_d, int a_d, int alt)
| Return string that describes the branch.
std::string | toolTip (NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
| Return string that is used as a tool tip.
void | dispose (void)
| Free allocated memory.
Public Member Functions inherited from Gecode::Gist::SpaceNode
| SpaceNode (int p)
| Construct node with parent p.
| SpaceNode (Space *root)
| Construct root node from Space root and branch-and-bound object better.
Space * | getSpace (NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
| Return working space. Receiver must delete the space.
const Space * | getWorkingSpace (void) const
| Return working space (if present).
void | purge (const NodeAllocator &na)
| Clear working space and copy (if present and this is not the root).
void | dispose (void)
| Free allocated memory.
bool | isCurrentBest (BestNode *curBest)
| Return whether this node is the currently best solution.
int | getNumberOfChildNodes (NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d)
| Compute and return the number of children.
NodeStatus | getStatus (void) const
| Return current status of the node.
bool | isOpen (void)
| Return whether this node still has open children.
bool | hasFailedChildren (void)
| Return whether the subtree of this node has any failed children.
bool | hasSolvedChildren (void)
| Return whether the subtree of this node has any solved children.
bool | hasOpenChildren (void)
| Return whether the subtree of this node has any open children.
int | getNoOfOpenChildren (const NodeAllocator &na)
| Return number of open children.
void | setNoOfOpenChildren (int n)
| Set number of open children to n.
bool | hasCopy (void)
| Return whether the node has a copy.
bool | hasWorkingSpace (void)
| Return whether the node has a working space.
int | getAlternative (const NodeAllocator &na) const
| Return alternative number of this node.
const Choice * | getChoice (void)
| Return choice of this node.
Public Member Functions inherited from Gecode::Gist::Node
| Node (int p, bool failed=false)
| Construct node with parent p.
int | getParent (void) const
| Return the parent.
VisualNode * | getParent (const NodeAllocator &na) const
| Return the parent.
VisualNode * | getChild (const NodeAllocator &na, int n) const
| Return child no n.
int | getIndex (const NodeAllocator &na) const
| Return index of this node.
bool | isRoot (void) const
| Check if this node is the root of a tree.
void | setNumberOfChildren (unsigned int n, NodeAllocator &na)
| Set the number of children to n and initialize children.
unsigned int | getNumberOfChildren (void) const
| Return the number of children.

## Protected Types

enum | VisualNodeFlags { DIRTY = SpaceNode::LASTBIT+1 , CHILDRENLAYOUTDONE , HIDDEN , MARKED , ONPATH , BOOKMARKED }
| Flags for VisualNodes. More...
Protected Types inherited from Gecode::Gist::SpaceNode
enum | SpaceNodeFlags { HASOPENCHILDREN = FIRSTBIT , HASFAILEDCHILDREN , HASSOLVEDCHILDREN }
| Flags for SpaceNodes. More...

## Protected Member Functions

bool | containsCoordinateAtDepth (int x, int depth)
| Check if the x at depth depth lies in this subtree.
Protected Member Functions inherited from Gecode::Gist::SpaceNode
void | setDistance (unsigned int d)
| Set distance from copy.
unsigned int | getDistance (void) const
| Return distance from copy.
void | setFlag (int flag, bool value)
| Set status flag.
bool | getFlag (int flag) const
| Return status flag.
void | setStatus (NodeStatus s)
| Set status to s.
void | acquireSpace (NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
| Acquire working space, either from parent or by recomputation.
Protected Member Functions inherited from Gecode::Gist::Node
bool | isUndetermined (void) const
| Return whether this node is undetermined.
int | getChild (int n) const
| Return index of child no n.

## Protected Attributes

int | offset
| Relative offset from the parent node.
Shape * | shape
| Shape of this node.
Protected Attributes inherited from Gecode::Gist::SpaceNode
Space * | copy
| A copy used for recomputation, or NULL.
const Choice * | choice
unsigned int | nstatus
| Status of the node.

## Additional Inherited Members

Public Types inherited from Gecode::Gist::Node
typedef NodeAllocatorBase< VisualNode > | NodeAllocator
Static Protected Attributes inherited from Gecode::Gist::SpaceNode
static const int | LASTBIT = HASSOLVEDCHILDREN
| Last bit used for SpaceNode flags.

## Detailed Description

Node class that supports visual layout

Definition at line 125 of file visualnode.hh.

## Member Enumeration Documentation

## VisualNodeFlags

enum Gecode::Gist::VisualNode::VisualNodeFlags

protected

Flags for VisualNodes.

Enumerator
DIRTY |
CHILDRENLAYOUTDONE |
HIDDEN |
MARKED |
ONPATH |
BOOKMARKED |

Definition at line 128 of file visualnode.hh.

## Constructor & Destructor Documentation

## VisualNode() [1/2]

Gecode::Gist::VisualNode::VisualNode | ( | int | p | ) |

Construct with parent p.

Definition at line 69 of file visualnode.cpp.

## VisualNode() [2/2]

Gecode::Gist::VisualNode::VisualNode | ( | Space * | root | ) |

Constructor for root node from root and b.

Definition at line 82 of file visualnode.cpp.

## Member Function Documentation

## containsCoordinateAtDepth()

bool Gecode::Gist::VisualNode::containsCoordinateAtDepth | ( | int | x,
|  | int | depth )

protected

Check if the x at depth depth lies in this subtree.

Definition at line 233 of file visualnode.cpp.

## isHidden()

bool Gecode::Gist::VisualNode::isHidden | ( | void |  | ) |

inline

Return if node is hidden.

Definition at line 129 of file visualnode.hpp.

## setHidden()

void Gecode::Gist::VisualNode::setHidden | ( | bool | h | ) |

inline

Set hidden state to h.

Definition at line 134 of file visualnode.hpp.

## setStop()

void Gecode::Gist::VisualNode::setStop | ( | bool | h | ) |

inline

Set stop state to h.

Definition at line 139 of file visualnode.hpp.

## dirtyUp()

void Gecode::Gist::VisualNode::dirtyUp | ( | const NodeAllocator & | na | ) |

Mark all nodes up the path to the parent as dirty.

Definition at line 102 of file visualnode.cpp.

## layout()

void Gecode::Gist::VisualNode::layout | ( | const NodeAllocator & | na | ) |

Compute layout for the subtree of this node.

Definition at line 113 of file visualnode.cpp.

## getOffset()

int Gecode::Gist::VisualNode::getOffset | ( | void |  | ) |

inline

Return offset off this node from its parent.

Definition at line 147 of file visualnode.hpp.

## setOffset()

void Gecode::Gist::VisualNode::setOffset | ( | int | n | ) |

inline

Set offset of this node, relative to its parent.

Definition at line 150 of file visualnode.hpp.

## isDirty()

bool Gecode::Gist::VisualNode::isDirty | ( | void |  | ) |

inline

Return whether node is marked as dirty.

Definition at line 153 of file visualnode.hpp.

## setDirty()

void Gecode::Gist::VisualNode::setDirty | ( | bool | d | ) |

inline

Mark node as dirty.

Definition at line 158 of file visualnode.hpp.

## childrenLayoutIsDone()

bool Gecode::Gist::VisualNode::childrenLayoutIsDone | ( | void |  | ) |

inline

Return whether the layout of the node's children has been completed.

Definition at line 163 of file visualnode.hpp.

## setChildrenLayoutDone()

void Gecode::Gist::VisualNode::setChildrenLayoutDone | ( | bool | d | ) |

inline

Mark node whether the layout of the node's children has been completed.

Definition at line 168 of file visualnode.hpp.

## isMarked()

bool Gecode::Gist::VisualNode::isMarked | ( | void |  | ) |

inline

Return whether node is marked.

Definition at line 173 of file visualnode.hpp.

## setMarked()

void Gecode::Gist::VisualNode::setMarked | ( | bool | m | ) |

inline

Set mark of this node.

Definition at line 178 of file visualnode.hpp.

## isBookmarked()

bool Gecode::Gist::VisualNode::isBookmarked | ( | void |  | ) |

inline

Return whether node is bookmarked.

Definition at line 183 of file visualnode.hpp.

## setBookmarked()

void Gecode::Gist::VisualNode::setBookmarked | ( | bool | m | ) |

inline

Set bookmark of this node.

Definition at line 188 of file visualnode.hpp.

## pathUp()

void Gecode::Gist::VisualNode::pathUp | ( | const NodeAllocator & | na | ) |

Set all nodes from the node to the root to be on the path.

Definition at line 127 of file visualnode.cpp.

## unPathUp()

void Gecode::Gist::VisualNode::unPathUp | ( | const NodeAllocator & | na | ) |

Set all nodes from the node to the root not to be on the path.

Definition at line 135 of file visualnode.cpp.

## isOnPath()

bool Gecode::Gist::VisualNode::isOnPath | ( | void |  | ) |

inline

Return whether node is on the path.

Definition at line 193 of file visualnode.hpp.

## getPathAlternative()

int Gecode::Gist::VisualNode::getPathAlternative | ( | const NodeAllocator & | na | ) |

Return the alternative of the child that is on the path (-1 if none).

Definition at line 144 of file visualnode.cpp.

## setOnPath()

void Gecode::Gist::VisualNode::setOnPath | ( | bool | onPath0 | ) |

inline

Set whether node is on the path.

Definition at line 198 of file visualnode.hpp.

## toggleHidden()

void Gecode::Gist::VisualNode::toggleHidden | ( | const NodeAllocator & | na | ) |

Toggle whether this node is hidden.

Definition at line 153 of file visualnode.cpp.

## hideFailed()

void Gecode::Gist::VisualNode::hideFailed | ( | const NodeAllocator & | na,
|  | bool | onlyDirty = false )

Hide all failed subtrees of this node.

Definition at line 159 of file visualnode.cpp.

## unhideAll()

void Gecode::Gist::VisualNode::unhideAll | ( | const NodeAllocator & | na | ) |

Unhide all nodes in the subtree of this node.

Definition at line 207 of file visualnode.cpp.

## toggleStop()

void Gecode::Gist::VisualNode::toggleStop | ( | const NodeAllocator & | na | ) |

Do not stop at this node.

Definition at line 214 of file visualnode.cpp.

## unstopAll()

void Gecode::Gist::VisualNode::unstopAll | ( | const NodeAllocator & | na | ) |

Do not stop at any stop node in the subtree of this node.

Definition at line 223 of file visualnode.cpp.

## getShape()

Shape * Gecode::Gist::VisualNode::getShape | ( | void |  | ) |

inline

Return the shape of this node.

Definition at line 203 of file visualnode.hpp.

## setShape()

void Gecode::Gist::VisualNode::setShape | ( | Shape * | s | ) |

Set the shape of this node.

Definition at line 391 of file visualnode.cpp.

## computeShape()

void Gecode::Gist::VisualNode::computeShape | ( | const NodeAllocator & | na | ) |

Compute the shape according to the shapes of the children.

Definition at line 399 of file visualnode.cpp.

## getBoundingBox()

BoundingBox Gecode::Gist::VisualNode::getBoundingBox | ( | void |  | ) |

inline

Return the bounding box.

Definition at line 208 of file visualnode.hpp.

## changedStatus()

void Gecode::Gist::VisualNode::changedStatus | ( | const NodeAllocator & | na | ) |

Signal that the status has changed.

Definition at line 230 of file visualnode.cpp.

## findNode()

VisualNode * Gecode::Gist::VisualNode::findNode | ( | const NodeAllocator & | na,
|  | int | x,
|  | int | y )

Find a node in this subtree at coordinates x, y.

Definition at line 249 of file visualnode.cpp.

## labelBranches()

void Gecode::Gist::VisualNode::labelBranches | ( | NodeAllocator & | na,
|  | BestNode * | curBest,
|  | int | c_d,
|  | int | a_d )

Create or clear branch labels in subtree.

Definition at line 166 of file visualnode.cpp.

## labelPath()

void Gecode::Gist::VisualNode::labelPath | ( | NodeAllocator & | na,
|  | BestNode * | curBest,
|  | int | c_d,
|  | int | a_d )

Create or clear branch labels on path to root.

Definition at line 175 of file visualnode.cpp.

## getBranchLabel()

std::string Gecode::Gist::VisualNode::getBranchLabel | ( | NodeAllocator & | na,
|  | VisualNode * | p,
|  | const Choice * | c,
|  | BestNode * | curBest,
|  | int | c_d,
|  | int | a_d,
|  | int | alt )

Return string that describes the branch.

Definition at line 284 of file visualnode.cpp.

## toolTip()

std::string Gecode::Gist::VisualNode::toolTip | ( | NodeAllocator & | na,
|  | BestNode * | curBest,
|  | int | c_d,
|  | int | a_d )

Return string that is used as a tool tip.

Definition at line 279 of file visualnode.cpp.

## dispose()

void Gecode::Gist::VisualNode::dispose | ( | void |  | ) |

Free allocated memory.

Definition at line 96 of file visualnode.cpp.

## Member Data Documentation

## offset

int Gecode::Gist::VisualNode::offset

protected

Relative offset from the parent node.

Definition at line 138 of file visualnode.hh.

## shape

Shape* Gecode::Gist::VisualNode::shape

protected

Shape of this node.

Definition at line 140 of file visualnode.hh.

The documentation for this class was generated from the following files:

- gecode/gist/visualnode.hh
- gecode/gist/visualnode.cpp
- gecode/gist/visualnode.hpp