|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--jwo.landserf.structure.DelaunayTriang
Creates and stores a Delaunay triangulation. Useful for representing TINs and calculating the Voronoi diagram. Adapted from Zhao and Saalfeld, 1996.
Triangle,
Serialized Form| Field Summary | |
static int |
OUTSIDE
Indicates that a location is outside the convex hull. |
| Constructor Summary | |
DelaunayTriang(int size)
Initialises a triangulation with a given initial size. |
|
| Method Summary | |
void |
deletePoint(float px,
float py)
Deletes the point nearest to the given coordinates and recalculates the trianglulation. |
void |
expandHull(Node nd)
Adds a given node to the convex hull of the triangulation. |
void |
expandTriang(Edge e,
Node nd,
int type)
Expands the triangle. |
Triangle |
findTriangle(Edge edge)
Finds the triangle that contains the given edge. |
Triangle |
findTriangle(float px,
float py)
Finds the triangle that surrounds the given point. |
Node |
findTriangleNode(Edge edge)
Finds the node that makes the triangle with the given edge. |
Triangle[] |
findTriangles(Edge edge)
Finds the triangles that contain the given edge. |
float[] |
getEdgesX()
Returns the x coordinates of the edges of the triangulation. |
float[] |
getEdgesY()
Returns the y coordinates of the edges of the triangulation. |
float[] |
getEdgesZ()
Returns the z coordinates of the edges of the triangulation. |
float |
getHeight(float px,
float py)
Interpolates the z value at a given location based on the plane passing though the triangle surrounding this point. |
float |
getHeight(float px,
float py,
boolean useQuad)
Interpolates the z value at a given location based on the either plane or quadratic surface passing though the triangle surrounding this point. |
float[] |
getMER()
Returns the minimum enclosing rectangle of the last triangles to be affected by the insertion or removal of a new point. |
float[] |
getNodesX()
Returns the x coordinates of the nodes of the triangulation. |
float[] |
getNodesY()
Returns the y coordinates of the nodes of the triangulation. |
float[] |
getNodesZ()
Returns the z coordinates of the nodes of the triangulation. |
int |
getNumTriangles()
Reports the number of triangles stored in the triangulation. |
float[] |
getTrianglesX()
Returns the x coordinates of the triangles that make up the Delaunay triangulation. |
float[] |
getTrianglesY()
Returns the y coordinates of the triangles that make up the Delaunay triangulation. |
float[] |
getTrianglesZ()
Returns the z coordinates of the triangles that make up the Delaunay triangulation. |
float |
getVersion()
Reports the version of the object. |
void |
insertPoint(float px,
float py)
Inserts a new 2d point into the network and recalculates the triangulation. |
void |
insertPoint(float px,
float py,
float pz)
Inserts a new 3d point into the network and recalculates the triangulation. |
boolean |
isNearNode(float x,
float y,
float distance)
Looks for a node within a given distance of the give point. |
Node |
nearestNode(float x,
float y)
Finds the node nearest to the given coordinates. |
void |
recalculateParams()
Recalculates the triangle parameters. |
void |
resetTriangulation()
Resets triangluation by removing all triangles from the network. |
int |
searchEdge(Edge e,
Node nd)
Find the active edge associated with given node. |
void |
setVersion(float version)
Sets the version number of this object. |
void |
swapTest(Edge e11)
Swaps candidate edges and retrianglulates if necessary. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int OUTSIDE
| Constructor Detail |
public DelaunayTriang(int size)
size - Initial number of triangles in network.| Method Detail |
public void resetTriangulation()
public void insertPoint(float px,
float py)
px - x-coord of the new point.py - y-coord of the new point.
public void insertPoint(float px,
float py,
float pz)
px - x-coord of the new point.py - y-coord of the new point.pz - z-coord of the new point.
public void deletePoint(float px,
float py)
px - x-coord of the point to delete.py - y-coord of the point to delete.
public void expandTriang(Edge e,
Node nd,
int type)
e - Edge of triangle to expand.nd - Node to add to the triangle.type - Type of edge (internal or convex hull).public void expandHull(Node nd)
nd - Node to add to the hull.
public int searchEdge(Edge e,
Node nd)
e - Initial edge to search from.nd - Node to compare.
Edge,
Nodepublic void swapTest(Edge e11)
e11 - Candidate edge to consider.
public Node nearestNode(float x,
float y)
x - x-coordinate of point.y - y-coordinate of point.
public boolean isNearNode(float x,
float y,
float distance)
x - x-coordinate of point.y - y-coordinate of point.distance - 'Snapping distance' to compare.
public Triangle findTriangle(float px,
float py)
px - x coordinate of point to query.py - y coordinate of point to query.
public Triangle findTriangle(Edge edge)
edge - edge to search from. Returns null if less than three nodes present.
public Triangle[] findTriangles(Edge edge)
edge - edge to search from.
public Node findTriangleNode(Edge edge)
edge - edge to examine.
public float getHeight(float px,
float py)
px - x coordinate of the location to interpolate.py - y coordinate of the location to interpolate.
public float getHeight(float px,
float py,
boolean useQuad)
px - x coordinate of the location to interpolate.py - y coordinate of the location to interpolate.useQuad - Quadratic interpolation used if true, otherwise planar.
public void recalculateParams()
public float[] getMER()
public float[] getNodesX()
public float[] getNodesY()
public float[] getNodesZ()
public float[] getEdgesX()
public float[] getEdgesY()
public float[] getEdgesZ()
public int getNumTriangles()
public float[] getTrianglesX()
public float[] getTrianglesY()
public float[] getTrianglesZ()
public float getVersion()
public void setVersion(float version)
version - Version number of this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||