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

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int depth()
      Get the depth of the node in the tree.
      HyperplaneConvexSubset<P> getCut()
      Get the cut for the node.
      Hyperplane<P> getCutHyperplane()
      Get the hyperplane containing the node cut, if it exists.
      N getMinus()
      Get the node for the minus region of the cell.
      N getParent()
      Get the parent of the node.
      N getPlus()
      Get the node for the plus region of the cell.
      BSPTree<P,​N> getTree()
      Get the BSPTree that owns the node.
      boolean isInternal()
      Return true if the node is an internal node, meaning that is has a binary partitioner (aka "cut") and therefore two child nodes.
      boolean isLeaf()
      Return true if the node is a leaf node, meaning that it has no binary partitioner (aka "cut") and therefore no child nodes.
      boolean isMinus()
      Return true if the node has a parent and is the parent's minus child.
      boolean isPlus()
      Return true if the node has a parent and is the parent's plus child.
      HyperplaneConvexSubset<P> trim​(HyperplaneConvexSubset<P> sub)
      Trim the given hyperplane subset to the region defined by this node by cutting the argument with the cut hyperplanes (binary partitioners) of all parent nodes up to the root.
    • Method Detail

      • getTree

        BSPTree<P,​N> getTree()
        Get the BSPTree that owns the node.
        Returns:
        the owning tree
      • depth

        int depth()
        Get the depth of the node in the tree. The root node of the tree has a depth of 0.
        Returns:
        the depth of the node in the tree
      • getParent

        N getParent()
        Get the parent of the node. This will be null if the node is the root of the tree.
        Returns:
        the parent node for this instance
      • getCut

        HyperplaneConvexSubset<P> getCut()
        Get the cut for the node. This is a hyperplane convex subset that splits the region for the cell into two disjoint regions, namely the plus and minus regions. This will be null for leaf nodes.
        Returns:
        the cut for the cell
        See Also:
        getPlus(), getMinus(), getCutHyperplane()
      • getCutHyperplane

        Hyperplane<P> getCutHyperplane()
        Get the hyperplane containing the node cut, if it exists.
        Returns:
        the hyperplane containing the node cut, or null if the node does not have a cut
        See Also:
        getCut()
      • getMinus

        N getMinus()
        Get the node for the minus region of the cell. This will be null if the node has not been cut, ie if it is a leaf node.
        Returns:
        the node for the minus region of the cell
      • getPlus

        N getPlus()
        Get the node for the plus region of the cell. This will be null if the node has not been cut, ie if it is a leaf node.
        Returns:
        the node for the plus region of the cell
      • isLeaf

        boolean isLeaf()
        Return true if the node is a leaf node, meaning that it has no binary partitioner (aka "cut") and therefore no child nodes.
        Returns:
        true if the node is a leaf node
      • isInternal

        boolean isInternal()
        Return true if the node is an internal node, meaning that is has a binary partitioner (aka "cut") and therefore two child nodes.
        Returns:
        true if the node is an internal node
      • isMinus

        boolean isMinus()
        Return true if the node has a parent and is the parent's minus child.
        Returns:
        true if the node is the minus child of its parent
      • isPlus

        boolean isPlus()
        Return true if the node has a parent and is the parent's plus child.
        Returns:
        true if the node is the plus child of its parent
      • trim

        HyperplaneConvexSubset<P> trim​(HyperplaneConvexSubset<P> sub)
        Trim the given hyperplane subset to the region defined by this node by cutting the argument with the cut hyperplanes (binary partitioners) of all parent nodes up to the root. Null is returned if the hyperplane subset lies outside of the region defined by the node.
        Parameters:
        sub - the hyperplane subset to trim
        Returns:
        the trimmed hyperplane subset or null if no part of the argument lies within the node's region