From 8df7354020dfd8eed78a94e0f2be32ddab9efdfd Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Dey Date: Sat, 5 Jan 2013 01:30:51 +0100 Subject: [PATCH] vertex conf and finite edge conf modified In Vertex conf pqt case we can have infinite vertex even if p is not endpoint of q and so previous assertion is removed, and the case is included when p is not end point of q, and we check for the conflict due to insertion of t In Finite edge conf for p,q,t,sgn functor we removed the assertion of p is endpoint of q, and included the case when p is not end point of q and check for the conflict with t This solves the test case h2.cin --- .../Finite_edge_interior_conflict_C2.h | 7 -- .../Vertex_conflict_C2.h | 91 ++++++++++++------- 2 files changed, 58 insertions(+), 40 deletions(-) diff --git a/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Finite_edge_interior_conflict_C2.h b/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Finite_edge_interior_conflict_C2.h index 975872e9dbc..64638d43046 100644 --- a/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Finite_edge_interior_conflict_C2.h +++ b/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Finite_edge_interior_conflict_C2.h @@ -962,13 +962,6 @@ public: Segment_2 seg = (p.is_point())? q.segment(): p.segment(); if (seg.is_horizontal() or seg.is_vertical()) { - if (p.is_point()) { - CGAL_assertion( same_points(p, q.source_site()) or - same_points(p, q.target_site()) ) ; - } else { - CGAL_assertion( same_points(q, p.source_site()) or - same_points(q, p.target_site()) ) ; - } return false; } diff --git a/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h b/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h index 4a477a48901..4a4f6b5bea5 100644 --- a/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h +++ b/sdgap/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h @@ -372,53 +372,78 @@ namespace CGAL { // wrt perpendicular line passing through p Orientation o; if ( p.is_point() && q.is_segment() ) { - CGAL_assertion( same_points(p, q.source_site()) or - same_points(p, q.target_site()) ); - Point_2 pq = same_points(p, q.source_site()) ? q.target() : q.source(); - o = orientation_linf(p.point(), pq, t.point()); - if ( CGAL::is_certain(o == RIGHT_TURN) ) { + + if(same_points(p, q.source_site()) or + same_points(p, q.target_site()) ) { + + Point_2 pq = same_points(p, q.source_site()) ? q.target() : q.source(); + o = orientation_linf(p.point(), pq, t.point()); + if ( CGAL::is_certain(o == RIGHT_TURN) ) { - //Line_2 l = compute_supporting_line(Segment_2(p.point(), pq)); - Line_2 l = compute_supporting_line(q); - Line_2 lperp = same_points(p, q.source_site()) ? + //Line_2 l = compute_supporting_line(Segment_2(p.point(), pq)); + Line_2 l = compute_supporting_line(q); + Line_2 lperp = same_points(p, q.source_site()) ? compute_cw_perpendicular(l, p.point()) : compute_perpendicular(l, p.point()); - Oriented_side os = - oriented_side_of_line(lperp, t.point()); - CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " + Oriented_side os = + oriented_side_of_line(lperp, t.point()); + CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " << (( os == ON_POSITIVE_SIDE ) ? POSITIVE : NEGATIVE) << std::endl ;); - return ( os == ON_POSITIVE_SIDE ) ? POSITIVE : NEGATIVE; + return ( os == ON_POSITIVE_SIDE ) ? POSITIVE : NEGATIVE; + } + else { + CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " + << POSITIVE + << std::endl ;); + return POSITIVE; + } } else { - CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " - << POSITIVE - << std::endl ;); - return POSITIVE; + // Sandeep: point p is not end point of segment q + Line_2 l = compute_supporting_line(q); + if ( !( oriented_side_of_line(l, t.point()) == oriented_side_of_line(l, p.point()) ) ) { + CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " + << POSITIVE + << std::endl ;); + return POSITIVE; + } } - } else { // p is a segment and q is a point - CGAL_assertion( same_points(q, p.source_site()) or - same_points(q, p.target_site()) ); - Point_2 pp = same_points(q, p.source_site()) ? p.target() : p.source(); - o = orientation_linf(pp, q.point(), t.point()); - if ( CGAL::is_certain(o == RIGHT_TURN) ) { - Line_2 l = compute_supporting_line(p); - //Line_2 lperp = compute_cw_perpendicular(l, q.point()); - Line_2 lperp = same_points(q, p.source_site()) ? + } + else { // p is a segment and q is a point + if ( same_points(q, p.source_site()) or + same_points(q, p.target_site()) ) { + Point_2 pp = same_points(q, p.source_site()) ? p.target() : p.source(); + o = orientation_linf(pp, q.point(), t.point()); + if ( CGAL::is_certain(o == RIGHT_TURN) ) { + Line_2 l = compute_supporting_line(p); + //Line_2 lperp = compute_cw_perpendicular(l, q.point()); + Line_2 lperp = same_points(q, p.source_site()) ? compute_cw_perpendicular(l, q.point()) : compute_perpendicular(l, q.point()); - Oriented_side os = - oriented_side_of_line(lperp, t.point()); - CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " + Oriented_side os = + oriented_side_of_line(lperp, t.point()); + CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " << (( os == ON_POSITIVE_SIDE ) ? POSITIVE : NEGATIVE) << std::endl ;); - return ( os == ON_POSITIVE_SIDE ) ? POSITIVE : NEGATIVE; - } - else { - CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " + return ( os == ON_POSITIVE_SIDE ) ? POSITIVE : NEGATIVE; + } + else { + CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " << POSITIVE << std::endl ;); - return POSITIVE; + return POSITIVE; + } + } + else { + // Sandeep: point q is not end point of segment p + Line_2 l = compute_supporting_line(p); + if ( !( oriented_side_of_line(l, t.point()) == oriented_side_of_line(l, q.point()) ) ) { + CGAL_SDG_DEBUG(std::cout << "sandeep: debug incircle_p about to return " + << POSITIVE + << std::endl ;); + return POSITIVE; + } } }