|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<toxi.geom.mesh2d.DelaunayTriangle>
toxi.geom.mesh2d.DelaunayTriangulation
public class DelaunayTriangulation

A 2D Delaunay DelaunayTriangulation (DT) with incremental site insertion. This is not the fastest way to build a DT, but it's a reasonable way to build a DT incrementally and it makes a nice interactive display. There are several O(n log n) methods, but they require that the sites are all known initially. A DelaunayTriangulation is a Set of Triangles. A DelaunayTriangulation is unmodifiable as a Set; the only way to change it is to add sites (via delaunayPlace).
| Constructor Summary | |
|---|---|
DelaunayTriangulation(toxi.geom.mesh2d.DelaunayTriangle triangle)
All sites must fall within the initial triangle. |
|
| Method Summary | |
|---|---|
boolean |
contains(java.lang.Object triangle)
True iff triangle is a member of this triangulation. |
void |
delaunayPlace(DelaunayVertex site)
Place a new site into the DT. |
java.util.Iterator<toxi.geom.mesh2d.DelaunayTriangle> |
iterator()
|
toxi.geom.mesh2d.DelaunayTriangle |
locate(DelaunayVertex point)
Locate the triangle with point inside it or on its boundary. |
toxi.geom.mesh2d.DelaunayTriangle |
neighborOpposite(DelaunayVertex site,
toxi.geom.mesh2d.DelaunayTriangle triangle)
Report neighbor opposite the given vertex of triangle. |
java.util.Set<toxi.geom.mesh2d.DelaunayTriangle> |
neighbors(toxi.geom.mesh2d.DelaunayTriangle triangle)
Return the set of triangles adjacent to triangle. |
int |
size()
|
java.util.List<toxi.geom.mesh2d.DelaunayTriangle> |
surroundingTriangles(DelaunayVertex site,
toxi.geom.mesh2d.DelaunayTriangle triangle)
Report triangles surrounding site in order (cw or ccw). |
java.lang.String |
toString()
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public DelaunayTriangulation(toxi.geom.mesh2d.DelaunayTriangle triangle)
triangle - the initial triangle| Method Detail |
|---|
public boolean contains(java.lang.Object triangle)
contains in interface java.util.Collection<toxi.geom.mesh2d.DelaunayTriangle>contains in interface java.util.Set<toxi.geom.mesh2d.DelaunayTriangle>contains in class java.util.AbstractCollection<toxi.geom.mesh2d.DelaunayTriangle>triangle - the object to check for membershippublic void delaunayPlace(DelaunayVertex site)
site - the new DelaunayVertex
java.lang.IllegalArgumentException - if site does not lie in any trianglepublic java.util.Iterator<toxi.geom.mesh2d.DelaunayTriangle> iterator()
iterator in interface java.lang.Iterable<toxi.geom.mesh2d.DelaunayTriangle>iterator in interface java.util.Collection<toxi.geom.mesh2d.DelaunayTriangle>iterator in interface java.util.Set<toxi.geom.mesh2d.DelaunayTriangle>iterator in class java.util.AbstractCollection<toxi.geom.mesh2d.DelaunayTriangle>public toxi.geom.mesh2d.DelaunayTriangle locate(DelaunayVertex point)
point - the point to locate
public toxi.geom.mesh2d.DelaunayTriangle neighborOpposite(DelaunayVertex site,
toxi.geom.mesh2d.DelaunayTriangle triangle)
site - a vertex of triangletriangle - we want the neighbor of this triangle
java.lang.IllegalArgumentException - if site is not in this trianglepublic java.util.Set<toxi.geom.mesh2d.DelaunayTriangle> neighbors(toxi.geom.mesh2d.DelaunayTriangle triangle)
triangle - the triangle to check
public int size()
size in interface java.util.Collection<toxi.geom.mesh2d.DelaunayTriangle>size in interface java.util.Set<toxi.geom.mesh2d.DelaunayTriangle>size in class java.util.AbstractCollection<toxi.geom.mesh2d.DelaunayTriangle>
public java.util.List<toxi.geom.mesh2d.DelaunayTriangle> surroundingTriangles(DelaunayVertex site,
toxi.geom.mesh2d.DelaunayTriangle triangle)
site - we want the surrounding triangles for this sitetriangle - a "starting" triangle that has site as a vertex
java.lang.IllegalArgumentException - if site is not in trianglepublic java.lang.String toString()
toString in class java.util.AbstractCollection<toxi.geom.mesh2d.DelaunayTriangle>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||