org.osm2world.core.math.datastructures
Class IntersectionGrid
Object
IntersectionGrid
public class IntersectionGrid
- extends Object
a data structure that can be used to speed up intersection tests.
An IntersectionTestObject is added to all grid cells that are at least
partially covered by the object's axis-aligned bounding box.
When testing for intersections or inclusions, only elements in the same
cell need to be compared.
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntersectionGrid
public IntersectionGrid(AxisAlignedBoundingBoxXZ gridBounds,
int cellCountX,
int cellCountZ)
IntersectionGrid
public IntersectionGrid(AxisAlignedBoundingBoxXZ gridBounds,
double approxCellSizeX,
double approxCellSizeZ)
- alternative constructor that uses a target cell size to calculate
the number of cells
getCellArray
public Collection<IntersectionTestObject>[][] getCellArray()
getCells
public Iterable<Collection<IntersectionTestObject>> getCells()
- returns the content object collections for all non-empty cells
insert
public void insert(IntersectionTestObject object)