44 int halfWidth = width / 2;
51 l += deltaL;
r += deltaR;
56 l += delta;
r += delta;
85 static_cast<Shape*
>(
heap.ralloc(
sizeof(Shape)+(d-1)*
sizeof(
Extent)));
101 for (
int i=0; i <= d; i++) {
102 Extent currentExtent = (*this)[i];
103 extent.
l += currentExtent.
l;
104 extent.
r += currentExtent.
r;
115 for (
int i=0; i<
depth(); i++) {
116 lastLeft = lastLeft + (*this)[i].l;
117 lastRight = lastRight + (*this)[i].r;
118 bb.left = std::min(bb.left,lastLeft);
119 bb.right = std::max(bb.right,lastRight);
Extent representing shape of a tree at one depth level
Extent(void)
Default constructor.
void extend(int deltaL, int deltaR)
Extend extent by deltaL and deltaR.
void move(int delta)
Move extent by delta.
const BoundingBox & getBoundingBox(void) const
Return bounding box.
bool getExtentAtDepth(int depth, Extent &extent)
Return if extent exists at depth, if yes return it in extent.
const Extent & operator[](int i) const
Return extent at depth i.
static Shape * allocate(int d)
Construct shape of depth d.
void computeBoundingBox(void)
Compute bounding box.
int depth(void) const
Return depth of the shape.
static Shape * leaf
Static shape for leaf nodes.
static Shape * hidden
Static shape for hidden nodes.
static void deallocate(Shape *)
void setDepth(int d)
Set depth of the shape to d (must be smaller than original depth)
void setStatus(NodeStatus s)
Set status to s.
void setFlag(int flag, bool value)
Set status flag.
NodeStatus getStatus(void) const
Return current status of the node.
bool getFlag(int flag) const
Return status flag.
int offset
Relative offset from the parent node.
void setOnPath(bool onPath0)
Set whether node is on the path.
int getOffset(void)
Return offset off this node from its parent.
bool isBookmarked(void)
Return whether node is bookmarked.
bool isHidden(void)
Return if node is hidden.
void setBookmarked(bool m)
Set bookmark of this node.
Shape * shape
Shape of this node.
void setHidden(bool h)
Set hidden state to h.
bool isMarked(void)
Return whether node is marked.
void setOffset(int n)
Set offset of this node, relative to its parent.
void setDirty(bool d)
Mark node as dirty.
bool childrenLayoutIsDone(void)
Return whether the layout of the node's children has been completed.
BoundingBox getBoundingBox(void)
Return the bounding box.
bool isDirty(void)
Return whether node is marked as dirty.
bool isOnPath(void)
Return whether node is on the path.
void setMarked(bool m)
Set mark of this node.
void setChildrenLayoutDone(bool d)
Mark node whether the layout of the node's children has been completed.
void setStop(bool h)
Set stop state to h.
Shape * getShape(void)
Return the shape of this node.
Heap heap
The single global heap.
The Gecode Interactive Search Tool.
@ UNSTOP
Node representing ignored stop point.
@ STOP
Node representing stop point.
@ BRANCH
Node representing a branch.
Gecode toplevel namespace