Package com.io7m.jspatial.api.octtrees
Interface OctTreeReadableLType<A>
-
- Type Parameters:
A- The precise type of octtree members
- All Superinterfaces:
OctTreeReadableType
- All Known Subinterfaces:
OctTreeLType<A>
- All Known Implementing Classes:
OctTreeL
public interface OctTreeReadableLType<A> extends OctTreeReadableType
The type of readable octtrees withlonginteger coordinates.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.volumes.VolumeLbounds()voidcontainedBy(com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, java.util.Set<A> items)Returns all objects in the tree that are completely contained withinvolume, saving the results toitems.booleancontains(A item)Determine whether or not the object has already been inserted into the tree.<C> voiditerateOctants(C context, OctTreeOctantIterationLType<A,C> f)Iterate over all octants within the tree.<B> OctTreeReadableLType<B>map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.volumes.VolumeL,B> f)Applyfto each element of the tree.voidoverlappedBy(com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, java.util.Set<A> items)Returns all objects in the tree that are overlappedvolume, saving the results toitems.voidraycast(Ray3D ray, java.util.SortedSet<OctTreeRaycastResultL<A>> items)Returns all objects that are intersected by the given ray.com.io7m.jregions.core.unparameterized.volumes.VolumeLvolumeFor(A item)-
Methods inherited from interface com.io7m.jspatial.api.octtrees.OctTreeReadableType
isEmpty, size
-
-
-
-
Method Detail
-
bounds
com.io7m.jregions.core.unparameterized.volumes.VolumeL bounds()
- Returns:
- The tree bounds
-
contains
boolean contains(A item)
Determine whether or not the object has already been inserted into the tree.- Parameters:
item- The object- Returns:
trueiff the object is in the tree
-
map
<B> OctTreeReadableLType<B> map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.volumes.VolumeL,B> f)
Applyfto each element of the tree.- Type Parameters:
B- The type of result elements- Parameters:
f- A mapping function- Returns:
- A new tree
-
iterateOctants
<C> void iterateOctants(C context, OctTreeOctantIterationLType<A,C> f)Iterate over all octants within the tree.- Type Parameters:
C- The type of context values- Parameters:
context- A contextual value passed toff- An iteration function
-
volumeFor
com.io7m.jregions.core.unparameterized.volumes.VolumeL volumeFor(A item) throws java.util.NoSuchElementException
- Parameters:
item- The item- Returns:
- The bounding volume that was specified for
item - Throws:
java.util.NoSuchElementException- Iff the item is not present in the tree
-
containedBy
void containedBy(com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, java.util.Set<A> items)Returns all objects in the tree that are completely contained withinvolume, saving the results toitems.- Parameters:
volume- The volume to examineitems- The returned items
-
overlappedBy
void overlappedBy(com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, java.util.Set<A> items)Returns all objects in the tree that are overlappedvolume, saving the results toitems.- Parameters:
volume- The volume to examineitems- The returned items
-
raycast
void raycast(Ray3D ray, java.util.SortedSet<OctTreeRaycastResultL<A>> items)
Returns all objects that are intersected by the given ray. The objects are returned in order of distance from the origin of the ray: The first object returned will be the object nearest to the origin.- Parameters:
ray- The rayitems- The intersected items
-
-