Package com.io7m.jspatial.api.quadtrees
Interface QuadTreeReadableDType<A>
-
- Type Parameters:
A- The precise type of quadtree members
- All Superinterfaces:
QuadTreeReadableType
- All Known Subinterfaces:
QuadTreeDType<A>
- All Known Implementing Classes:
QuadTreeD
public interface QuadTreeReadableDType<A> extends QuadTreeReadableType
The type of readable quadtrees withdoubleprecision coordinates.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.io7m.jregions.core.unparameterized.areas.AreaDareaFor(A item)com.io7m.jregions.core.unparameterized.areas.AreaDbounds()voidcontainedBy(com.io7m.jregions.core.unparameterized.areas.AreaD area, java.util.Set<A> items)Returns all objects in the tree that are completely contained withinarea, saving the results toitems.booleancontains(A item)Determine whether or not the object has already been inserted into the tree.<C> voiditerateQuadrants(C context, QuadTreeQuadrantIterationDType<A,C> f)Iterate over all quadrants within the tree.<B> QuadTreeReadableDType<B>map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.areas.AreaD,B> f)Applyfto each element of the tree.voidoverlappedBy(com.io7m.jregions.core.unparameterized.areas.AreaD area, java.util.Set<A> items)Returns all objects in the tree that are overlappedarea, saving the results toitems.voidraycast(Ray2D ray, java.util.SortedSet<QuadTreeRaycastResultD<A>> items)Returns all objects that are intersected by the given ray.-
Methods inherited from interface com.io7m.jspatial.api.quadtrees.QuadTreeReadableType
isEmpty, size
-
-
-
-
Method Detail
-
bounds
com.io7m.jregions.core.unparameterized.areas.AreaD 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> QuadTreeReadableDType<B> map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.areas.AreaD,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
-
iterateQuadrants
<C> void iterateQuadrants(C context, QuadTreeQuadrantIterationDType<A,C> f)Iterate over all quadrants within the tree.- Type Parameters:
C- The type of context values- Parameters:
context- A contextual value passed toff- An iteration function
-
areaFor
com.io7m.jregions.core.unparameterized.areas.AreaD areaFor(A item) throws java.util.NoSuchElementException
- Parameters:
item- The item- Returns:
- The bounding area 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.areas.AreaD area, java.util.Set<A> items)Returns all objects in the tree that are completely contained withinarea, saving the results toitems.- Parameters:
area- The area to examineitems- The returned items
-
overlappedBy
void overlappedBy(com.io7m.jregions.core.unparameterized.areas.AreaD area, java.util.Set<A> items)Returns all objects in the tree that are overlappedarea, saving the results toitems.- Parameters:
area- The area to examineitems- The returned items
-
raycast
void raycast(Ray2D ray, java.util.SortedSet<QuadTreeRaycastResultD<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
-
-