public class PointRegionQuadTree<L> extends Object
Quad tree.
Branch nodes have 4 regions or child nodes that subdivide the parent region in NW/NE/SW/SE.
Nodes can either be leaf nodes or branch nodes. Only leaf nodes have "points". "Points" is modelled as a generic type.
The tree is polymorphic: leaf nodes can become branches and branches can become leafs.
Manipulation and querying of the quad tree is done through tool classes. As the tree can be polymorphic users should not hold on to the root node as it could change.
Constructor and Description |
---|
PointRegionQuadTree(int leafCapacity,
int maxTreeHeight,
PointRegionQuadTreeNode<L> root) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
int |
getLeafCapacity() |
int |
getMaxTreeHeight() |
PointRegionQuadTreeNode<L> |
getRoot() |
void |
setRoot(PointRegionQuadTreeNode<L> root) |
public PointRegionQuadTree(int leafCapacity, int maxTreeHeight, PointRegionQuadTreeNode<L> root)
public int getLeafCapacity()
public int getMaxTreeHeight()
public PointRegionQuadTreeNode<L> getRoot()
public void setRoot(PointRegionQuadTreeNode<L> root)
public void clear()