Package com.io7m.jspatial.api.octtrees
Interface OctTreeIType<A>
-
- Type Parameters:
A- The precise type of octtree members
- All Superinterfaces:
OctTreeReadableIType<A>,OctTreeReadableType
- All Known Implementing Classes:
OctTreeI
public interface OctTreeIType<A> extends OctTreeReadableIType<A>
The type of mutable octtrees withintcoordinates.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Remove all objects from the tree.booleaninsert(A item, com.io7m.jregions.core.unparameterized.volumes.VolumeI bounds)Insert the objectiteminto the octtree.<B> OctTreeIType<B>map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.volumes.VolumeI,B> f)Applyfto each element of the tree.booleanremove(A item)Remove the objectitemfrom the octtree.voidtrim()Trim all empty quadrants from the tree.-
Methods inherited from interface com.io7m.jspatial.api.octtrees.OctTreeReadableIType
bounds, containedBy, contains, iterateOctants, overlappedBy, raycast, volumeFor
-
Methods inherited from interface com.io7m.jspatial.api.octtrees.OctTreeReadableType
isEmpty, size
-
-
-
-
Method Detail
-
insert
boolean insert(A item, com.io7m.jregions.core.unparameterized.volumes.VolumeI bounds)
Insert the object
iteminto the octtree.The function returns
falseif the object could not be inserted for any reason (perhaps due to being too large).If the object is already in the tree, it is replaced. This can be used to update the bounds of an object within the tree.
- Parameters:
item- The object to insertbounds- The object's bounds- Returns:
trueif the object was inserted
-
remove
boolean remove(A item)
Remove the object
itemfrom the octtree.The function returns
falseif the object could not be removed for any reason (perhaps due to not being in the tree in the first place).- Parameters:
item- The object to remove- Returns:
trueif the object was removed
-
clear
void clear()
Remove all objects from the tree.
-
trim
void trim()
Trim all empty quadrants from the tree.
-
map
<B> OctTreeIType<B> map(java.util.function.BiFunction<A,com.io7m.jregions.core.unparameterized.volumes.VolumeI,B> f)
Applyfto each element of the tree.- Specified by:
mapin interfaceOctTreeReadableIType<A>- Type Parameters:
B- The type of result elements- Parameters:
f- A mapping function- Returns:
- A new tree
-
-