Package com.io7m.jspatial.api.octtrees
Interface OctTreeReadableIType<A>
-
- Type Parameters:
A- The precise type of octtree members
- All Superinterfaces:
OctTreeReadableType
- All Known Subinterfaces:
OctTreeIType<A>
- All Known Implementing Classes:
OctTreeI
public interface OctTreeReadableIType<A> extends OctTreeReadableType
The type of readable octtrees withintcoordinates.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.volumes.VolumeIbounds()voidcontainedBy(com.io7m.jregions.core.unparameterized.volumes.VolumeI 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, OctTreeOctantIterationIType<A,C> f)Iterate over all octants within the tree.<B> OctTreeReadableIType<B>map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.volumes.VolumeI,B> f)Applyfto each element of the tree.voidoverlappedBy(com.io7m.jregions.core.unparameterized.volumes.VolumeI 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<OctTreeRaycastResultI<A>> items)Returns all objects that are intersected by the given ray.com.io7m.jregions.core.unparameterized.volumes.VolumeIvolumeFor(A item)-
Methods inherited from interface com.io7m.jspatial.api.octtrees.OctTreeReadableType
isEmpty, size
-
-
-
-
Method Detail
-
bounds
com.io7m.jregions.core.unparameterized.volumes.VolumeI 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> OctTreeReadableIType<B> map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.volumes.VolumeI,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, OctTreeOctantIterationIType<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.VolumeI 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.VolumeI 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.VolumeI 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<OctTreeRaycastResultI<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
-
-