Maven module :un.api : api-geometry :
Class : un.api.geometry.index.quadtrees.QuadTreeType
Extends/Implements : -
Subclasses : -

The interface provided by quadtree implementations.
param   The precise type of quadtree members.
author  Mark Raynsford


Variables : -
Functions : quadTreeClear, quadTreeGetPositionX, quadTreeGetPositionY, quadTreeGetSizeX, quadTreeGetSizeY, quadTreeInsert, quadTreeIterateObjects, quadTreeQueryAreaContaining, quadTreeQueryAreaOverlapping, quadTreeQueryRaycast, quadTreeQueryRaycastQuadrants, quadTreeRemove, quadTreeTraverse




Delete all objects, if any, contained within the quadtree.
void quadTreeClear ()


return  The position of the lower corner of the quadtree on the X axis.
double quadTreeGetPositionX ()


return  The position of the lower corner of the quadtree on the Y axis.
double quadTreeGetPositionY ()


return  The maximum size of the quadtree on the X axis.
double quadTreeGetSizeX ()


return  The maximum size of the quadtree on the Y axis.
double quadTreeGetSizeY ()


Insert the object item into the quadtree.


The function returns false if the object could not be inserted for any reason (perhaps due to being too large).



@param item The object to insert

@return true if the object was inserted
@throws IllegalArgumentException If the object's bounding area is not well-formed.

@see com.io7m.jspatial.BoundingAreaCheck#isWellFormed(BBox)
boolean quadTreeInsert (T item)


Pass each object in the quadtree to f.call(), in no particular order. Iteration stops if f.call() returns false,
or raises an exception.
param  f The function that will receive each object
void quadTreeIterateObjects (Predicate f)


Returns all objects in the tree that are completely contained within area, saving the results to items.
param  area The area to examine
param  items The returned items
throws  IllegalArgumentException Iff area is not well formed
see  com.io7m.jspatial.BoundingAreaCheck#isWellFormed(BBox)
void quadTreeQueryAreaContaining (BBox area, SortedSet items)


Returns all objects in the tree that are at least partially contained within area, saving the results to items.
param  area The area to examine
param  items The returned items
throws  IllegalArgumentException Iff area is not well formed
see  com.io7m.jspatial.BoundingAreaCheck#isWellFormed(BBox)
void quadTreeQueryAreaOverlapping (BBox area, SortedSet items)


Returns the objects intersected by the ray ray in items.

The objects are returned in order of increasing scalar distance from the origin of ray. That is, the nearest object to the origin of
ray will be the first item in items.

@see com.io7m.jtensors.Vector#distance(com.io7m.jtensors.VectorReadable2DType, com.io7m.jtensors.VectorReadable2DType)

@param items The returned objects
@param ray The ray
void quadTreeQueryRaycast (Ray ray, SortedSet> items)


Return the set of quadrants intersected by ray.
param  ray The ray
param  items The resulting set of quadrants
void quadTreeQueryRaycastQuadrants (Ray ray, SortedSet> items)


Remove the object item from the quadtree.


The function returns false if the object could not be removed for any reason (perhaps due to not being in the tree in the first place).



@param item The object to remove

@return true if the object was removed
boolean quadTreeRemove (T item)


Pass each node of the given quadtree to traversal.visit(), in depth-first order.
param  traversal The traversal
throws  E Propagated from traversal.visit()
param   The type of raised exceptions
void quadTreeTraverse (QuadTreeTraversalType traversal)