Interface BSPSubtree<P extends Point<P>,N extends BSPTree.Node<P,N>>

Type Parameters:
P - Point implementation type
N - Node implementation type
All Known Subinterfaces:
BSPTree<P,N>, BSPTree.Node<P,N>
All Known Implementing Classes:
AbstractBSPTree, AbstractBSPTree.AbstractNode, AbstractRegionBSPTree, AbstractRegionBSPTree.AbstractRegionNode, RegionBSPTree1D, RegionBSPTree1D.RegionNode1D, RegionBSPTree1S, RegionBSPTree1S.RegionNode1S, RegionBSPTree2D, RegionBSPTree2D.RegionNode2D, RegionBSPTree2S, RegionBSPTree2S.RegionNode2S, RegionBSPTree3D, RegionBSPTree3D.RegionNode3D

public interface BSPSubtree<P extends Point<P>,N extends BSPTree.Node<P,N>>
Interface for types that form the root of BSP subtrees. This includes trees themselves as well as each node in a tree.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Accept a visitor instance, calling it with each node from the subtree.
    int
    Return the total number of nodes in the subtree.
    int
    The height of the subtree, ie the length of the longest downward path from the subtree root to a leaf node.
    Get an iterable for accessing the nodes in this subtree.
  • Method Details

    • count

      int count()
      Return the total number of nodes in the subtree.
      Returns:
      the total number of nodes in the subtree.
    • height

      int height()
      The height of the subtree, ie the length of the longest downward path from the subtree root to a leaf node. A leaf node has a height of 0.
      Returns:
      the height of the subtree.
    • accept

      void accept(BSPTreeVisitor<P,N> visitor)
      Accept a visitor instance, calling it with each node from the subtree.
      Parameters:
      visitor - visitor called with each subtree node
    • nodes

      Iterable<N> nodes()
      Get an iterable for accessing the nodes in this subtree. This provides a simple alternative to accept(BSPTreeVisitor) for accessing tree nodes but is not as powerful or flexible since the node iteration order is fixed.
      Returns:
      an iterable for accessing the nodes in this subtree