|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdelaunay.delaunay.ConstrainedMesh
public class ConstrainedMesh
This class is used to compute the constrained delaunay triangulation on a set of points and constraint edges. The constraints can be validated before the triangulation.
After the processing of the mesh with processDelaunay, the ConstrainedMesh can be identified with three set of data, plus its input constraint edges. The three sets are : * The points of the mesh.
| Field Summary | |
|---|---|
static int |
MAXITER
|
static int |
MIN_POINTS_NUMBER
|
static int |
REFINEMENT_MAX_AREA
|
static int |
REFINEMENT_MIN_ANGLE
|
static int |
REFINEMENT_OBTUSE_ANGLE
|
static int |
REFINEMENT_SOFT_INTERPOLATE
|
| Constructor Summary | |
|---|---|
ConstrainedMesh()
Build a new, empty, ConstrainedMesh. |
|
| Method Summary | |
|---|---|
void |
addConstraintEdge(DEdge e)
Add an edge to the list of constraint edges. |
void |
addEdge(DEdge e)
Add an edge to the list of edges. |
void |
addPoint(DPoint point)
Add a new point in the list that will be used to perform the triangulation. |
void |
addTriangle(DTriangle triangle)
Add a triangle to the current constrained mesh |
boolean |
containsTriangle(DTriangle tri)
Return true if tri is one of the triangles of this mesh. |
void |
dataQualification(double epsilon)
Ensure points are at least at epsilon from other points NB : points are supposed to be already sorted |
void |
displayObject(Graphics g)
Draw Mesh in the JPanel : triangles and edges. |
void |
forceConstraintIntegrity()
This method will force the integrity of the constraints used to compute the delaunay triangulation. |
com.vividsolutions.jts.geom.Envelope |
getBoundingBox()
Get the bounding box of this mesh. |
List<DEdge> |
getConstraintEdges()
Get the list of edges that are used as constraints during the triangulation |
List<DEdge> |
getConstraintFromLPVertical(DPoint left)
Get the list of constraint edges whose left point is left, vertically sorted. |
List<DEdge> |
getConstraintsFromLeftPoint(DPoint left)
Get the list of constraint edges whose left point is left. |
List<DEdge> |
getEdges()
Get the list of edges |
List<DPoint> |
getExtensionPoints()
Get the extension points that would be added to the mesh while computing DT or CDT with the current set of points. |
DPoint |
getPoint(double x,
double y,
double z)
Try to retrieve the point (x,y,z) in the points' structure. |
List<DPoint> |
getPoints()
Get the points contained in this mesh |
double |
getPrecision()
Get the precision |
double |
getTolerance()
Get the value used to compute the minimum distance between two points |
List<DTriangle> |
getTriangleList()
Get the list of triangles already computed and added in this mesh |
Map<Integer,Integer> |
getWeights()
Get the table that currently contains the weights used to attribute the Z value when processing the intersection. |
int |
insertEdgeVerticalList(DEdge edge,
List<DEdge> edgeList,
double abs)
This method will insert a new DEdge in a vertically sorted list, as described in sortEdgesVertically. |
DEdge |
insertIfNotEncroached(DPoint pt,
DTriangle container,
double minLength)
Insert pt in container only if it does not create a new encroached edge in the mesh. |
void |
insertPointInTriangle(DPoint pt,
DTriangle container,
double minLength)
Insert the point pt in the triangle container. |
DEdge |
insertTriangleCircumCenter(DTriangle tri,
boolean revertible,
double minLength)
Insert the circumcenter of the given triangle in the mesh. |
boolean |
intersectsExistingEdges(DEdge edge)
Checks that edge does not intersect the existing edges of the mesh. |
boolean |
isMeshComputed()
Can be used to know if the mesh has been computed or not |
boolean |
isVerbose()
Says if the verbose mode is activated or not |
int |
listContainsPoint(DPoint p)
This methods will search the point p in the list. |
void |
processDelaunay()
Generate the Delaunay's triangularization with a flip-flap algorithm. |
void |
refineMesh(double minLength,
InsertionEvaluator ev)
Refine the mesh, using the Ruppert's algorithm. |
void |
refineTriangles(double minLength,
InsertionEvaluator ev)
Refine the mesh, using a derivate of the Ruppert algorithm. |
void |
removeEdge(DEdge e)
Remove an DEdge from the list of edges. |
void |
removeFlatTriangles()
This operation remove the flat triangles by inserting new points in the mesh, that come from the skeleton of the already computed mesh. |
void |
removeTriangle(DTriangle tri)
Remove a triangle from the list of triangles |
int |
searchEdge(DEdge edge)
Search an edge in the list of edges. |
void |
setConstraintEdges(ArrayList<DEdge> constraint)
Set the list of edges that are used as constraints during triangulation |
void |
setEdges(List<DEdge> inEdges)
Set the list of edges |
void |
setPoints(List<DPoint> pts)
Set the list of points to be used during the triangulation If using this method. |
void |
setPrecision(double precision)
Set the precision |
void |
setTolerance(double tolerance)
Set the value used to compute the minimum distance between two points |
void |
setVerbose(boolean verb)
Set the verbosity level |
void |
setWeights(Map<Integer,Integer> weights)
Set the table of weights that are used when processing the intersection between edges, during the call to forceConstraintsIntegrity(). |
List<DEdge> |
sortEdgesLeft(List<DEdge> inputList)
This method will sort the edges using the coordinates of the left point of the edges. |
void |
sortEdgesVertically(List<DEdge> edgeList,
double abs)
This method will sort the edges contained in the ArrayList list by considering their intersection point with the line of equation x=abs, where a is given in parameter. |
void |
sortEdgesVertically(List<DEdge> edgeList,
DPoint p)
This method will vertically sort the edges in edgeList, using the absciss of the point p given in parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MIN_POINTS_NUMBER
public static final int MAXITER
public static final int REFINEMENT_MAX_AREA
public static final int REFINEMENT_MIN_ANGLE
public static final int REFINEMENT_SOFT_INTERPOLATE
public static final int REFINEMENT_OBTUSE_ANGLE
| Constructor Detail |
|---|
public ConstrainedMesh()
| Method Detail |
|---|
public final List<DEdge> getConstraintEdges()
public final void setConstraintEdges(ArrayList<DEdge> constraint)
throws DelaunayError
constraint -
DelaunayError
public final void addConstraintEdge(DEdge e)
throws DelaunayError
e - the edge we want to add
DelaunayErrorpublic final List<DEdge> getEdges()
public final void setEdges(List<DEdge> inEdges)
throws DelaunayError
inEdges -
DelaunayErrorpublic final void addEdge(DEdge e)
e - the edge we want to addpublic final void removeEdge(DEdge e)
e - public final List<DEdge> sortEdgesLeft(List<DEdge> inputList)
public final int searchEdge(DEdge edge)
edge -
public final double getPrecision()
public final void setPrecision(double precision)
precision - public final double getTolerance()
public final void setTolerance(double tolerance)
tolerance - public final List<DTriangle> getTriangleList()
public final void addTriangle(DTriangle triangle)
triangle - public final boolean containsTriangle(DTriangle tri)
BE EXTREMELY CAREFUL ! : this method will be completely inefficient, as the triangle's data structure is not kept sorted. To obtain a data structure that can be queried efficiently, sort the triangle's data structure (as triangle are sortable, cf DTriangle), or put them in an external spatial index (RTree/R+Tree)
tri -
public final void removeTriangle(DTriangle tri)
tri - public final List<DPoint> getPoints()
public final DPoint getPoint(double x,
double y,
double z)
throws DelaunayError
x - y - z -
DelaunayErrorpublic final boolean isMeshComputed()
public final com.vividsolutions.jts.geom.Envelope getBoundingBox()
public final boolean isVerbose()
public final void setVerbose(boolean verb)
verb -
public final void setPoints(List<DPoint> pts)
throws DelaunayError
pts -
DelaunayError
public final void addPoint(DPoint point)
throws DelaunayError
point -
DelaunayError
public final List<DPoint> getExtensionPoints()
throws DelaunayError
DelaunayErrorpublic final int listContainsPoint(DPoint p)
p -
public final Map<Integer,Integer> getWeights()
public final void setWeights(Map<Integer,Integer> weights)
forceConstraintsIntegrity().
Keys of the map match the property of each edge. Note that we are working on bits,
and than the expected wlues will certainly be power of 2 (ie 1, 2, 4, 8...).
Check the Element javadoc for more information about
property
weights -
public final void forceConstraintIntegrity()
throws DelaunayError
DelaunayError
public final void sortEdgesVertically(List<DEdge> edgeList,
DPoint p)
throws DelaunayError
edgeList - p -
DelaunayError
public final void sortEdgesVertically(List<DEdge> edgeList,
double abs)
throws DelaunayError
edgeList - abs -
DelaunayError
public final int insertEdgeVerticalList(DEdge edge,
List<DEdge> edgeList,
double abs)
throws DelaunayError
edge - edgeList -
DelaunayError
public final boolean intersectsExistingEdges(DEdge edge)
throws DelaunayError
edge -
true if edge intersects an edge of the mesh.
DelaunayErrorpublic final List<DEdge> getConstraintsFromLeftPoint(DPoint left)
left -
public final List<DEdge> getConstraintFromLPVertical(DPoint left)
left -
public final void processDelaunay()
throws DelaunayError
DelaunayError
public final void removeFlatTriangles()
throws DelaunayError
DelaunayError
public final void refineMesh(double minLength,
InsertionEvaluator ev)
throws DelaunayError
minLength - The minimum length of an edge that could be inserted during the refinement.
DelaunayError
IllegalArgumentException - if minLength is inferior or equal to 0
public final void refineTriangles(double minLength,
InsertionEvaluator ev)
throws DelaunayError
minLength - The minimum length of an edge that could be inserted during the refinement.
DelaunayError
IllegalArgumentException - if minLength is inferior or equal to 0
public final DEdge insertTriangleCircumCenter(DTriangle tri,
boolean revertible,
double minLength)
throws DelaunayError
tri - revertible - If set to true, the insertion won't be performed if it creates a new encroached
edge in the mesh.minLength - If the distance between the circumcenter and the closest point of the
containing triangle is inferior to minLength, the circumcenter is not inserted.
DelaunayError
public final DEdge insertIfNotEncroached(DPoint pt,
DTriangle container,
double minLength)
throws DelaunayError
pt - container - minLength - The minimum length between the new point and the point of the triangle
that is the closest to it. If this distance is less than minLength,
the point is not inserted.
DelaunayError
public final void insertPointInTriangle(DPoint pt,
DTriangle container,
double minLength)
throws DelaunayError
pt - The point to be inserted.container - The triangle of the mesh that contains pt.minLength - The minimum length between the new point and the point of the triangle
that is the closest to it. If this distance is less than minLength,
the point is not inserted.
DelaunayError - if pt is not inside container. If a search is needed,
it must be made before trying to insert the point.
public final void dataQualification(double epsilon)
throws DelaunayError
epsilon -
DelaunayErrorpublic final void displayObject(Graphics g)
g -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||