Maven module :un.api : api-geometry :
Class : un.api.geometry.index.octtrees.OctTreeType
Extends/Implements : -
Subclasses : -

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


Variables : -
Functions : octTreeClear, octTreeGetPositionX, octTreeGetPositionY, octTreeGetPositionZ, octTreeGetSizeX, octTreeGetSizeY, octTreeGetSizeZ, octTreeInsert, octTreeIterateObjects, octTreeQueryRaycast, octTreeQueryVolumeContaining, octTreeQueryVolumeOverlapping, octTreeRemove, octTreeTraverse




Delete all objects, if any, contained within the octtree.
void octTreeClear ()


return  The X axis value of the lower corner of the octtree.
double octTreeGetPositionX ()


return  The Y axis value of the lower corner of the octtree.
double octTreeGetPositionY ()


return  The Z axis value of the lower corner of the octtree.
double octTreeGetPositionZ ()


return  The maximum size of the octtree on the X axis.
double octTreeGetSizeX ()


return  The maximum size of the octtree on the Y axis.
double octTreeGetSizeY ()


return  The maximum size of the octtree on the Z axis.
double octTreeGetSizeZ ()


Insert the object item into the octtree.


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 volume is not well-formed.

@see com.io7m.jspatial.BoundingVolumeCheck#isWellFormed(BBox)
boolean octTreeInsert (T item)


Pass each object in the octtree 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 octTreeIterateObjects (Predicate f)


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.Vector, com.io7m.jtensors.Vector)

@param ray The ray
@param items The returned objects
@throws IllegalArgumentException If the object's bounding volume is not well-formed.

@see com.io7m.jspatial.BoundingVolumeCheck#isWellFormed(BBox)
void octTreeQueryRaycast (Ray ray, SortedSet> items)


Returns all objects in the tree that are completely contained within volume, saving the results to items.
param  volume The volume to examine
param  items The returned items
throws  IllegalArgumentException If the object's bounding volume is not well-formed.
see  com.io7m.jspatial.BoundingVolumeCheck#isWellFormed(BBox)
void octTreeQueryVolumeContaining (BBox volume, SortedSet items)


Returns all objects in the tree that are overlapped by volume, saving the results to items.
param  volume The volume to examine
param  items The returned items
throws  IllegalArgumentException If the object's bounding volume is not well-formed.
see  com.io7m.jspatial.BoundingVolumeCheck#isWellFormed(BBox)
void octTreeQueryVolumeOverlapping (BBox volume, SortedSet items)


Remove the object item from the octtree.


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
@throws IllegalArgumentException If the object's bounding volume is not well-formed.

@see com.io7m.jspatial.BoundingVolumeCheck#isWellFormed(BBox)
boolean octTreeRemove (T item)


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