public class DelaunayTriangulation extends Object
Constructor and Description |
---|
DelaunayTriangulation()
creates an empty Delaunay Triangulation.
|
DelaunayTriangulation(Collection<Point> points) |
DelaunayTriangulation(Point[] ps)
creates a Delaunay Triangulation from all the points.
|
Modifier and Type | Method and Description |
---|---|
Point[] |
calcVoronoiCell(Triangle triangle,
Point p)
Calculates a Voronoi cell for a given neighborhood in this triangulation.
|
boolean |
contains(double x,
double y) |
boolean |
contains(Point p) |
void |
deletePoint(Point pointToDelete)
Deletes the given point from this.
|
Triangle |
find(Point p)
finds the triangle the query point falls in, note if out-side of this
triangulation a half plane triangle will be returned (see contains), the
search has expected time of O(n^0.5), and it starts form a fixed triangle
(this.startTriangle),
|
Triangle |
find(Point p,
Triangle start)
finds the triangle the query point falls in, note if out-side of this
triangulation a half plane triangle will be returned (see contains). the
search starts from the the start triangle
|
Point |
findClosePoint(Point pointToDelete)
return a point from the trangulation that is close to pointToDelete
|
Vector<Triangle> |
findTriangleNeighborhood(Triangle firstTriangle,
Point point) |
BoundingBox |
getBoundingBox() |
int |
getConvexHullSize()
compute the number of vertices in the convex hull.
|
Iterator<Point> |
getConvexHullVerticesIterator()
returns an iterator to the set of all the points on the XY-convex hull
|
Iterator<Triangle> |
getLastUpdatedTriangles()
returns an iterator object involved in the last update.
|
int |
getModeCounter()
returns the changes counter for this triangulation
|
List<Triangle> |
getTriangulation() |
void |
indexData(int xCellCount,
int yCellCount)
Index the triangulation using a grid index
|
void |
insertPoint(Point p)
insert the point to this Delaunay Triangulation.
|
void |
insertPoints(Collection<Point> points) |
Point |
maxBoundingBox()
return the max point of the bounding box of this triangulation
{{x1,y1,z1}}
|
Point |
minBoundingBox()
return the min point of the bounding box of this triangulation
{{x0,y0,z0}}
|
void |
removeIndex()
Remove any existing spatial indexing
|
int |
size()
the number of (different) vertices in this triangulation.
|
Iterator<Triangle> |
trianglesIterator()
computes the current set (vector) of all triangles and return an iterator
to them.
|
int |
trianglesSize() |
Iterator<Point> |
verticesIterator()
returns an iterator to the set of points compusing this triangulation.
|
double |
z(double x,
double y) |
Point |
z(Point q) |
public DelaunayTriangulation()
public DelaunayTriangulation(Point[] ps)
public DelaunayTriangulation(Collection<Point> points)
public int size()
public int trianglesSize()
public int getModeCounter()
public void insertPoints(Collection<Point> points)
public void insertPoint(Point p)
p
- new vertex to be inserted the triangulation.public void deletePoint(Point pointToDelete)
pointToDelete
- The given point to delete.
Implementation of the Mostafavia, Gold & Dakowicz algorithm
(2002).
By Eyal Roth & Doron Ganel (2009).public Point findClosePoint(Point pointToDelete)
pointToDelete
- the point that the user wants to deletepublic Point[] calcVoronoiCell(Triangle triangle, Point p)
triangle
- a triangle in the neighborhoodp
- corner point whose surrounding neighbors will be checkedpublic Iterator<Triangle> getLastUpdatedTriangles()
public int getConvexHullSize()
public Triangle find(Point p)
p
- query pointpublic Triangle find(Point p, Triangle start)
p
- query pointstart
- the triangle the search starts at.public Vector<Triangle> findTriangleNeighborhood(Triangle firstTriangle, Point point)
public boolean contains(Point p)
p
- query pointpublic boolean contains(double x, double y)
x
- - X cordination of the query pointy
- - Y cordination of the query pointpublic Point z(Point q)
q
- Query pointpublic double z(double x, double y)
x
- - X cordination of the query pointy
- - Y cordination of the query pointpublic BoundingBox getBoundingBox()
public Point minBoundingBox()
public Point maxBoundingBox()
public Iterator<Triangle> trianglesIterator()
public Iterator<Point> getConvexHullVerticesIterator()
public Iterator<Point> verticesIterator()
public void indexData(int xCellCount, int yCellCount)
xCellCount
- number of grid cells in a rowyCellCount
- number of grid cells in a columnpublic void removeIndex()
Copyright © 2016. All rights reserved.