FlexibleQuadTree

Parameters

the type of objects stored in the quadtree

Constructors

Link copied to clipboard
constructor(elemPerQuad: Int = DEFAULT_CAPACITY)

Builds a FlexibleQuadTree with the default node capacity.

Types

Link copied to clipboard
object Companion

Constants.

Properties

Link copied to clipboard
open override val dimensions: Int = 2
Link copied to clipboard

Functions

Link copied to clipboard
open override fun insert(element: E, vararg position: Double)

Inserts an element in the SpatialIndex.

fun insert(element: E, x: Double, y: Double)

Same of .insert, but with explicit parameters.

Link copied to clipboard
open override fun move(element: E, start: DoubleArray, end: DoubleArray): Boolean

If an element is moved, updates the SpatialIndex accordingly.

fun move(e: E, sx: Double, sy: Double, fx: Double, fy: Double): Boolean

Same of .move, but with explicit parameters.

Link copied to clipboard
open override fun query(vararg parallelotope: DoubleArray): MutableList<E>

Queries the SpatialIndex, searching for elements in a parallelotope. "Parallelotope" is a fancy word for "N-dimensional rectangle". A 2-parallelotope is a rectangle, a 3-parallelotope is a parallelepiped, and so on.

fun query(x1: Double, y1: Double, x2: Double, y2: Double): MutableList<E>

Same of querying with arrays, but with explicit parameters.

Link copied to clipboard
open override fun remove(element: E, vararg position: Double): Boolean

Deletes an element from the SpatialIndex.

fun remove(e: E, x: Double, y: Double): Boolean

Same of .remove with explicit parameters.

Link copied to clipboard
open override fun toString(): String