Packages

class TreeLayout extends AnyRef

The TreeLayout class is used to display multi-way trees with the root at the top and leaves at the bottom. It is translated from the pseudo-code given in

See also

Appendix A of Christoph Buchheim, Michael Junger and Sebastian Leipert paper.

onlinelibrary.wiley.com/doi/10.1002/spe.713/pdf

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TreeLayout
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TreeLayout(t: Tree)

    t

    the tree to be displayed

Value Members

  1. def ancestor(vim: Int, v: Int): Int

    Return ancestor of 'vim' or default ancestor.

    Return ancestor of 'vim' or default ancestor.

    vim

    the inside left node id

    v

    the current node id

  2. def apportion(v: Int): Unit

    Apportion/combine new subtree with the previous subtrees.

    Apportion/combine new subtree with the previous subtrees. Note: i/o means inside/outside; p/m means +/- (right/left)

    v

    the current node id

  3. def executeShifts(v: Int): Unit

    Executed the shifts computed in 'moveSubtree'.

    Executed the shifts computed in 'moveSubtree'.

    v

    the current node id

  4. def firstWalk(v: Int): Unit

    Compute a preliminary x-coordinate for node 'v'.

    Compute a preliminary x-coordinate for node 'v'.

    v

    the current node id

  5. def layout(): (Array[Int], Array[Int])

    Layout the nodes in tree 't' creating 'x' and 'y' coordinates for each.

  6. def leftmostSibling(v: Int): Int

    Return the leftmost sibling of 'v'.

    Return the leftmost sibling of 'v'.

    v

    the current node id

  7. def moveSubtree(wm: Int, wp: Int, shift: Int): Unit

    Move the subtree rooted at 'wp'.

    Move the subtree rooted at 'wp'.

    wm

    the left node id

    wp

    the right node id

    shift

    the amount of shift in x-coordinate

  8. def nextLeft(v: Int): Int

    Return the leftmost child of 'v', otherwise the thread of 'v'.

    Return the leftmost child of 'v', otherwise the thread of 'v'.

    v

    the current node id

  9. def nextRight(v: Int): Int

    Return the rightmost child of 'v', otherwise the thread of 'v'.

    Return the rightmost child of 'v', otherwise the thread of 'v'.

    v

    the current node id

  10. def secondWalk(v: Int, m: Int): Unit

    Assign 'x' and 'y' coordinates for each node.

    Assign 'x' and 'y' coordinates for each node.

    v

    the current node id

    m

    the x position modifier