Class UniformGrid3dImpl<V>
java.lang.Object
cz.fidentis.analyst.data.grid.impl.UniformGridImpl<javax.vecmath.Tuple3i,javax.vecmath.Tuple3d,V>
cz.fidentis.analyst.data.grid.impl.UniformGrid3dImpl<V>
- Type Parameters:
V
- the type of elements to be stored in the grid
- All Implemented Interfaces:
UniformGrid<javax.vecmath.Tuple3d,
,V> UniformGrid3d<V>
public class UniformGrid3dImpl<V>
extends UniformGridImpl<javax.vecmath.Tuple3i,javax.vecmath.Tuple3d,V>
implements UniformGrid3d<V>
A 3D uniform grid. This grid is infinite with given cell size (only occupied cells are remembered)
-
Constructor Summary
ConstructorsConstructorDescriptionUniformGrid3dImpl
(double cellSize) Constructor.UniformGrid3dImpl
(double cellSize, Collection<V> objects, Function<? super V, javax.vecmath.Tuple3d> mapFunc) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addNeighbours
(Collection<javax.vecmath.Tuple3i> points, javax.vecmath.Tuple3i cell) List
<javax.vecmath.Tuple3i> getAdjacentCells
(javax.vecmath.Tuple3d loc) Computes the cell for given location and then all its neighbors.javax.vecmath.Tuple3i
locationToCell
(javax.vecmath.Tuple3d loc) Takes a location in space and return coordinates of the corresponding cell.protected javax.vecmath.Tuple3i
neighbour
(javax.vecmath.Tuple3i p, int x, int y, int z) 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, toString, 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
-
UniformGrid3dImpl
public UniformGrid3dImpl(double cellSize) Constructor.- Parameters:
cellSize
- Cell size. Must be bigger that one.
-
UniformGrid3dImpl
public UniformGrid3dImpl(double cellSize, Collection<V> objects, Function<? super V, javax.vecmath.Tuple3d> mapFunc) Constructor. As the mapping function, use(MeshPoint mp) -> mp.getPosition()
or(Point3d 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.Tuple3i locationToCell(javax.vecmath.Tuple3d 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.Tuple3i,
javax.vecmath.Tuple3d, 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.Tuple3i,
javax.vecmath.Tuple3d, V> - Parameters:
loc
- Location in space- Returns:
- the cell for given location and then all its neighbors.
-
addNeighbours
-
neighbour
protected javax.vecmath.Tuple3i neighbour(javax.vecmath.Tuple3i p, int x, int y, int z)
-