Class UniformGrid4dImpl<V>

java.lang.Object
cz.fidentis.analyst.data.grid.impl.UniformGridImpl<javax.vecmath.Tuple4i,javax.vecmath.Tuple4d,V>
cz.fidentis.analyst.data.grid.impl.UniformGrid4dImpl<V>
Type Parameters:
V - the type of elements to be stored in the grid
All Implemented Interfaces:
UniformGrid<javax.vecmath.Tuple4d,V>, UniformGrid4d<V>

public class UniformGrid4dImpl<V> extends UniformGridImpl<javax.vecmath.Tuple4i,javax.vecmath.Tuple4d,V> implements UniformGrid4d<V>
A 4D uniform grid. This grid is infinite with given cell size (only occupied cells are remembered)
  • Constructor Details

    • UniformGrid4dImpl

      public UniformGrid4dImpl(double cellSize)
      Constructor.
      Parameters:
      cellSize - Cell size. Must be bigger that one.
    • UniformGrid4dImpl

      public UniformGrid4dImpl(double cellSize, Collection<V> objects, Function<? super V,javax.vecmath.Tuple4d> mapFunc)
      Constructor. As the mapping function, use (Point4d p) -> p, for instance.
      Parameters:
      cellSize - Cell size. Must be bigger that one.
      objects - Objects to be stored
      mapFunc - A function that computes a 3D space location from an object
  • Method Details

    • locationToCell

      public javax.vecmath.Tuple4i locationToCell(javax.vecmath.Tuple4d loc)
      Description copied from class: UniformGridImpl
      Takes a location in space and return coordinates of the corresponding cell.
      Specified by:
      locationToCell in class UniformGridImpl<javax.vecmath.Tuple4i,javax.vecmath.Tuple4d,V>
      Parameters:
      loc - Location in space
      Returns:
      coordinates of the corresponding cell
    • getAdjacentCells

      public List<javax.vecmath.Tuple4i> getAdjacentCells(javax.vecmath.Tuple4d loc)
      Description copied from class: UniformGridImpl
      Computes the cell for given location and then all its neighbors.
      Specified by:
      getAdjacentCells in class UniformGridImpl<javax.vecmath.Tuple4i,javax.vecmath.Tuple4d,V>
      Parameters:
      loc - Location in space
      Returns:
      the cell for given location and then all its neighbors.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addNeighbours

      protected void addNeighbours(Collection<javax.vecmath.Tuple4i> points, javax.vecmath.Tuple4i cell)
    • neighbour

      protected javax.vecmath.Tuple4i neighbour(javax.vecmath.Tuple4i p, int x, int y, int z, int w)