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 Summary
ConstructorsConstructorDescriptionUniformGrid4dImpl
(double cellSize) Constructor.UniformGrid4dImpl
(double cellSize, Collection<V> objects, Function<? super V, javax.vecmath.Tuple4d> mapFunc) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addNeighbours
(Collection<javax.vecmath.Tuple4i> points, javax.vecmath.Tuple4i cell) List
<javax.vecmath.Tuple4i> getAdjacentCells
(javax.vecmath.Tuple4d loc) Computes the cell for given location and then all its neighbors.javax.vecmath.Tuple4i
locationToCell
(javax.vecmath.Tuple4d loc) Takes a location in space and return coordinates of the corresponding cell.protected javax.vecmath.Tuple4i
neighbour
(javax.vecmath.Tuple4i p, int x, int y, int z, int w) toString()
Methods inherited from class cz.fidentis.analyst.data.grid.impl.UniformGridImpl
clear, get, getAll, getCellSize, getClosest, getGrid, getNonEmptyCells, numOccupiedCells, remove, store, store
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.data.grid.UniformGrid
clear, get, getAll, getCellSize, getClosest, getNonEmptyCells, numOccupiedCells, remove, store, store
-
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 storedmapFunc
- 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 classUniformGridImpl<javax.vecmath.Tuple4i,
javax.vecmath.Tuple4d, V> - Parameters:
loc
- Location in space- Returns:
- coordinates of the corresponding cell
-
getAdjacentCells
Description copied from class:UniformGridImpl
Computes the cell for given location and then all its neighbors.- Specified by:
getAdjacentCells
in classUniformGridImpl<javax.vecmath.Tuple4i,
javax.vecmath.Tuple4d, V> - Parameters:
loc
- Location in space- Returns:
- the cell for given location and then all its neighbors.
-
toString
-
addNeighbours
-
neighbour
protected javax.vecmath.Tuple4i neighbour(javax.vecmath.Tuple4i p, int x, int y, int z, int w)
-