public class Quadtree<D>
A quadtree recursively partitions two-dimensional space into squares, dividing each square into four equally-sized squares. Each distinct point exists in a unique leaf node; coincident points are represented by a linked list. Quadtrees can accelerate various spatial operations, such as the Barnes–Hut approximation for computing many-body forces, collision detection, and searching for nearby points.
x and y accessor are used to derive the coordinates of data when adding to and removing from the tree. It is also used when finding to re-access the coordinates of data previously added to the tree; therefore, the x- and y-accessors must be consistent, returning the same value given the same input.
| Constructor and Description |
|---|
Quadtree(kotlin.jvm.functions.Function1<? super D,java.lang.Double> x,
kotlin.jvm.functions.Function1<? super D,java.lang.Double> y)
A quadtree recursively partitions two-dimensional space into squares, dividing each square into four equally-sized
squares. Each distinct point exists in a unique leaf node; coincident points are represented by a linked list.
Quadtrees can accelerate various spatial operations, such as the Barnes–Hut approximation for computing
many-body forces, collision detection, and searching for nearby points.
|
| Modifier and Type | Method and Description |
|---|---|
io.data2viz.geom.Extent |
getExtent()
|
QuadtreeNode<D> |
getRoot()
The root node of the quadtree.
|
kotlin.jvm.functions.Function1<D,java.lang.Double> |
getX() |
kotlin.jvm.functions.Function1<D,java.lang.Double> |
getY() |
void |
setExtent(io.data2viz.geom.Extent value)
|
void |
setRoot(QuadtreeNode<D> p)
The root node of the quadtree.
|
public Quadtree(kotlin.jvm.functions.Function1<? super D,java.lang.Double> x,
kotlin.jvm.functions.Function1<? super D,java.lang.Double> y)
A quadtree recursively partitions two-dimensional space into squares, dividing each square into four equally-sized squares. Each distinct point exists in a unique leaf node; coincident points are represented by a linked list. Quadtrees can accelerate various spatial operations, such as the Barnes–Hut approximation for computing many-body forces, collision detection, and searching for nearby points.
x and y accessor are used to derive the coordinates of data when adding to and removing from the tree. It is also used when finding to re-access the coordinates of data previously added to the tree; therefore, the x- and y-accessors must be consistent, returning the same value given the same input.
public QuadtreeNode<D> getRoot()
The root node of the quadtree.
public void setRoot(QuadtreeNode<D> p)
The root node of the quadtree.
public io.data2viz.geom.Extent getExtent()
public void setExtent(io.data2viz.geom.Extent value)
public kotlin.jvm.functions.Function1<D,java.lang.Double> getX()
public kotlin.jvm.functions.Function1<D,java.lang.Double> getY()