Module vecmath

Class Octree.Cell

java.lang.Object
de.grogra.vecmath.geom.Octree.Cell
Enclosing class:
Octree

public abstract static class Octree.Cell extends Object
A Cell represents a cell of an Octree. The array children contains the eight children of this cell, if it is an inner node of the octree, otherwise it is null. The children are equal in size and represent a decomposition of their parent.

A leaf Cell also includes a list of volumes whose boundaries are contained in the cell.

Author:
Michael Tauer, Ole Kniemeyer
  • Field Details

  • Constructor Details

    • Cell

      public Cell(int position)
  • Method Details

    • getVolumeCount

      public abstract int getVolumeCount()
      Returns the number of volumes in this cell. Volumes contained in child cells are not counted.
      Returns:
      number of volumes
    • clearVolumes

      public abstract void clearVolumes()
      Clears the list of volumes of this cell.
    • getVolume

      public abstract Volume getVolume(int index, Octree.State state)
      Returns the indexth volume of the list of volumes of this cell. The returned volume may only be used up to the next invocation of this method with the same state, so that the state is allowed to store information about the volume.
      Parameters:
      index - index of volume in list
      state - instance of State as returned by Octree.createState()
      Returns:
      volume at index
    • addVolume

      public abstract void addVolume(Volume v)
      Adds a volume to this cell. v must be a volume which has been returned previously by the invocation of getVolume(int, de.grogra.vecmath.geom.Octree.State) on the parent cell.
      Parameters:
      v - volume of parent cell which has to be added to this cell
    • createChild

      protected abstract Octree.Cell createChild(int position)
      This factory method creates a new cell of the same class as this cell. It will be used as child of this cell.
      Parameters:
      position - value for position
      Returns:
      newly created cell
    • getExtent

      public void getExtent(Octree tree, Tuple3d min, Tuple3d max)
      Determines the spatial extent of this cell.
      Parameters:
      tree - the octree to which this cell belongs
      min - the minimum coordinates will be placed in here
      max - the maximum coordinates will be placed in here