ConformingDelaunayTriangulationBuilder cdtb = new ConformingDelaunayTriangulationBuilder();
// add geometry collection
cdtb.setSites(this.geometries);
QuadEdgeSubdivision qes = cdtb.getSubdivision();
Collection<QuadEdge> quadEdges = qes.getEdges();
List<QuadEdgeTriangle> qeTriangles = QuadEdgeTriangle.createOn(qes);
Collection<com.vividsolutions.jts.triangulate.quadedge.Vertex> qeVertices =
qes.getVertices(false);
int iV = 0;
for (com.vividsolutions.jts.triangulate.quadedge.Vertex v : qeVertices) {
this.coordinates.put(v.getCoordinate(), iV);
this.vertices.put(iV, new Vertex(iV, v.getCoordinate()));
iV++;
}
// border
List<QuadEdge> qeFrameBorder = new ArrayList<QuadEdge>();
List<QuadEdge> qeFrame = new ArrayList<QuadEdge>();
List<QuadEdge> qeBorder = new ArrayList<QuadEdge>();
for (QuadEdge qe : quadEdges) {
if (qes.isFrameBorderEdge(qe)) {
qeFrameBorder.add(qe);
}
if (qes.isFrameEdge(qe)) {
qeFrame.add(qe);
}
}
// border
for (int j = 0 ; j < qeFrameBorder.size() ; j++) {
QuadEdge q = qeFrameBorder.get(j);
if (! qeFrame.contains(q)) {
qeBorder.add(q);
}
}
// deletion of exterior edges
for (QuadEdge qe : qeFrame) {
qes.delete(qe);
}
HashMap<QuadEdge, Double> qeDistances = new HashMap<QuadEdge, Double>();
for (QuadEdge qe : quadEdges) {
qeDistances.put(qe, qe.toLineSegment().getLength());