/** * Finds a quadedge of a triangle containing a location * specified by a {@link Vertex}, if one exists. * * @param v the vertex to locate * @return a quadedge on the edge of a triangle which touches or contains the location * or null if no such triangle exists */ public QuadEdge locate(Vertex v) { return locator.locate(v); }
/** * Finds a quadedge of a triangle containing a location * specified by a {@link Coordinate}, if one exists. * * @param p the Coordinate to locate * @return a quadedge on the edge of a triangle which touches or contains the location * or null if no such triangle exists */ public QuadEdge locate(Coordinate p) { return locator.locate(new Vertex(p)); }
/** * Finds a quadedge of a triangle containing a location * specified by a {@link Vertex}, if one exists. * * @param v the vertex to locate * @return a quadedge on the edge of a triangle which touches or contains the location * or null if no such triangle exists */ public QuadEdge locate(Vertex v) { return locator.locate(v); }
/** * Locates the edge between the given vertices, if it exists in the * subdivision. * * @param p0 a coordinate * @param p1 another coordinate * @return the edge joining the coordinates, if present * or null if no such edge exists */ public QuadEdge locate(Coordinate p0, Coordinate p1) { // find an edge containing one of the points QuadEdge e = locator.locate(new Vertex(p0)); if (e == null) return null; // normalize so that p0 is origin of base edge QuadEdge base = e; if (e.dest().getCoordinate().equals2D(p0)) base = e.sym(); // check all edges around origin of base edge QuadEdge locEdge = base; do { if (locEdge.dest().getCoordinate().equals2D(p1)) return locEdge; locEdge = locEdge.oNext(); } while (locEdge != base); return null; }
/** * Finds a quadedge of a triangle containing a location * specified by a {@link Coordinate}, if one exists. * * @param p the Coordinate to locate * @return a quadedge on the edge of a triangle which touches or contains the location * or null if no such triangle exists */ public QuadEdge locate(Coordinate p) { return locator.locate(new Vertex(p)); }
/** * Locates the edge between the given vertices, if it exists in the * subdivision. * * @param p0 a coordinate * @param p1 another coordinate * @return the edge joining the coordinates, if present * or null if no such edge exists */ public QuadEdge locate(Coordinate p0, Coordinate p1) { // find an edge containing one of the points QuadEdge e = locator.locate(new Vertex(p0)); if (e == null) return null; // normalize so that p0 is origin of base edge QuadEdge base = e; if (e.dest().getCoordinate().equals2D(p0)) base = e.sym(); // check all edges around origin of base edge QuadEdge locEdge = base; do { if (locEdge.dest().getCoordinate().equals2D(p1)) return locEdge; locEdge = locEdge.oNext(); } while (locEdge != base); return null; }