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 with long integer coordinates.
    Since:
    3.0.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.io7m.jregions.core.unparameterized.volumes.VolumeL bounds()  
      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 within volume, saving the results to items.
      boolean contains​(A item)
      Determine whether or not the object has already been inserted into the tree.
      <C> void iterateOctants​(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)
      Apply f to each element of the tree.
      void overlappedBy​(com.io7m.jregions.core.unparameterized.volumes.VolumeL volume, java.util.Set<A> items)
      Returns all objects in the tree that are overlapped volume, saving the results to items.
      void raycast​(Ray3D ray, java.util.SortedSet<OctTreeRaycastResultL<A>> items)
      Returns all objects that are intersected by the given ray.
      com.io7m.jregions.core.unparameterized.volumes.VolumeL volumeFor​(A item)  
    • 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:
        true iff 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)
        Apply f to 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 to f
        f - 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 within volume, saving the results to items.
        Parameters:
        volume - The volume to examine
        items - 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 overlapped volume, saving the results to items.
        Parameters:
        volume - The volume to examine
        items - 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 ray
        items - The intersected items