|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jzy3d.plot3d.builder.delaunay.jdt.GridIndex
public class GridIndex
Created by IntelliJ IDEA. User: Aviad Segev Date: 22/11/2009 Time: 20:10:04 Grid Index is a simple spatial index for fast point/triangle location. The idea is to divide a predefined geographic extent into equal sized cell matrix (tiles). Every cell will be associated with a triangle which lies inside. Therfore, one can easily locate a triangle in close proximity of the required point by searching from the point's cell triangle. If the triangulation is more or less uniform and bound in space, this index is very effective, roughly recuing the searched triangles by square(xCellCount * yCellCount), as only the triangles inside the cell are searched. The index takes xCellCount * yCellCount capacity. While more cells allow faster searches, even a small grid is helpfull. This implementation holds the cells in a memory matrix, but such a grid can be easily mapped to a DB table or file where it is usually used for it's fullest. Note that the index is geographically bound - only the region given in the c'tor is indexed. Added Triangles outside the indexed region will cause rebuilding of the whole index. Since triangulation is mostly always used for static raster data, and usually is never updated outside the initial zone (only refininf existing triangles) this is never an issue in real life.
Constructor Summary | |
---|---|
GridIndex(Delaunay_Triangulation delaunay,
int xCellCount,
int yCellCount)
Constructs a grid index holding the triangles of a delaunay triangulation. |
|
GridIndex(Delaunay_Triangulation delaunay,
int xCellCount,
int yCellCount,
BoundingBox region)
Constructs a grid index holding the triangles of a delaunay triangulation. |
Method Summary | |
---|---|
Triangle_dt |
findCellTriangleOf(Point_dt point)
Finds a triangle near the given point |
void |
updateIndex(java.util.Iterator<Triangle_dt> updatedTriangles)
Updates the grid index to reflect changes to the triangulation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GridIndex(Delaunay_Triangulation delaunay, int xCellCount, int yCellCount)
delaunay
- delaunay triangulation to indexxCellCount
- number of grid cells in a rowyCellCount
- number of grid cells in a columnpublic GridIndex(Delaunay_Triangulation delaunay, int xCellCount, int yCellCount, BoundingBox region)
delaunay
- delaunay triangulation to indexxCellCount
- number of grid cells in a rowyCellCount
- number of grid cells in a columnregion
- geographic region to indexMethod Detail |
---|
public Triangle_dt findCellTriangleOf(Point_dt point)
point
- a query point
public void updateIndex(java.util.Iterator<Triangle_dt> updatedTriangles)
updatedTriangles
- changed triangles of the triangulation. This may be added triangles,
removed triangles or both. All that matter is that they cover the
changed area.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |