From f81ca24f1b8e89633af9db8ebde98bc33863d678 Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Fri, 9 Aug 2013 08:56:05 +0300 Subject: [PATCH] endpoint of segment code completion case of predicate pqrt of type PPSP: if new point t is on the same side of line pq as the other endpoint of r, then NEGATIVE, else POSITIVE. This fixes inputs of the following form (zppsp1.cin): s -100 50 0 0 p 100 0 p 0 100 With the fix, point p 0 0 has as neighbors both p 100 0 and p 0 100. Before, p 0 100 was not a neighbor. Signed-off-by: Panagiotis Cheilaris --- .../Voronoi_vertex_sqrt_field_new_C2.h | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h index e3ed6a6f702..de9ca3e1224 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h @@ -2122,6 +2122,30 @@ private: CGAL_assertion(v_type == PPS); + // if new point t is on the same side of line pq + // as the other endpoint of r, then CONFLICT + + Line_2 l = compute_line_from_to(p.point(), q.point()); + Oriented_side ost = oriented_side_of_line(l, t.point()); + CGAL_assertion(ost != ON_ORIENTED_BOUNDARY); + Point_2 other_of_r; + if (is_p_endp_of_r) { + other_of_r = (same_points(p, r.source_site()))? + (r.target_site().point()) : (r.source_site().point()); + } else { // is_q_endp_of_r + other_of_r = (same_points(q, r.source_site()))? + (r.target_site().point()) : (r.source_site().point()); + } + Oriented_side osother = oriented_side_of_line(l, other_of_r); + + CGAL_assertion(osother != ON_ORIENTED_BOUNDARY); + + if (osother == ost) { + return NEGATIVE; + } else { + return POSITIVE; + } + } // case r is non-hv and has endpoint p or q CGAL_assertion(num_same_quadrant_as_t == 0);