P
- Point implementation typeN
- Node implementation typepublic interface BSPTree<P extends Point<P>,N extends BSPTree.Node<P,N>> extends BSPSubtree<P,N>
This interface contains a number of methods for extracting information from existing trees, but it does not include methods for constructing trees or modifying tree structure. This is due to the large number of possible use cases for BSP trees. Each use case is likely to have its own specific methods and rules for tree construction, making it difficult to define a single API at this level. Thus, it is left to implementation classes to define their own API for tree construction and modification.
Modifier and Type | Interface and Description |
---|---|
static class |
BSPTree.FindNodeCutRule
Enum specifying possible behaviors when a point used to locate a node
falls directly on the cut of an internal node.
|
static interface |
BSPTree.Node<P extends Point<P>,N extends BSPTree.Node<P,N>>
Interface for Binary Space Partitioning (BSP) tree nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(BSPTree<P,N> src)
Make the current instance a deep copy of the argument.
|
void |
extract(N node)
Set this instance to the region represented by the given node.
|
default N |
findNode(P pt)
Find a node in this subtree containing the given point or its interior or boundary.
|
N |
findNode(P pt,
BSPTree.FindNodeCutRule cutRule)
Find a node in this subtree containing the given point on its interior or boundary.
|
N |
getRoot()
Get the root node of the tree.
|
void |
transform(Transform<P> transform)
Transform this tree.
|
accept, count, height, nodes
default N findNode(P pt)
subtree.findNode(pt, FindNodeCutRule.MINUS)
and always returns a leaf node.pt
- test point used to locate a node in the treefindNode(Point, FindNodeCutRule)
N findNode(P pt, BSPTree.FindNodeCutRule cutRule)
cutRule
argument specifies what should happen in this case.
BSPTree.FindNodeCutRule.MINUS
- continue the search in the minus subtreeBSPTree.FindNodeCutRule.PLUS
- continue the search in the plus subtreeBSPTree.FindNodeCutRule.NODE
- stop the search and return the internal nodept
- test point used to locate a node in the treecutRule
- value used to determine the search behavior when the test point lies
exactly on the cut of an internal nodefindNode(Point)
void copy(BSPTree<P,N> src)
src
- the tree to copyvoid extract(N node)
node
- the node to extractCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.