From c1119ac9fb53a5ad3d47e8907abfd0b236a69c88 Mon Sep 17 00:00:00 2001 From: Eric Berberich Date: Thu, 27 Oct 2011 11:41:18 +0000 Subject: [PATCH] Bugfix: skip common left point only on boundary --- .../CGAL/Sweep_line_2/Sweep_line_2_impl.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_impl.h index b282c930522..49156d59e38 100644 --- a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_2_impl.h @@ -431,7 +431,8 @@ _intersect (Subcurve *c1, Subcurve *c2) this->m_traits->parameter_space_in_y_2_object()(c2->last_curve(), ARR_MIN_END); - if ((ps_x1 == ps_x2) && (ps_y1 == ps_y2) && + if (ps_x1 != CGAL::ARR_INTERIOR && ps_y1 != CGAL::ARR_INTERIOR && + (ps_x1 == ps_x2) && (ps_y1 == ps_y2) && this->m_traits->is_closed_2_object()(c1->last_curve(), ARR_MIN_END) && this->m_traits->is_closed_2_object()(c2->last_curve(), ARR_MIN_END)) { @@ -535,7 +536,9 @@ _intersect (Subcurve *c1, Subcurve *c2) { icv = object_cast (&(*vi)); CGAL_assertion (icv != NULL); + CGAL_PRINT("found an overlap: " << *icv << "\n";); + // TODO EBEB: This code does not work with overlaps that reach the boundary Point_2 left_xp = this->m_traits->construct_min_vertex_2_object()(*icv); xp = this->m_traits->construct_max_vertex_2_object()(*icv); @@ -564,13 +567,14 @@ _create_intersection_point (const Point_2& xp, Event *e = pair_res.first; if(pair_res.second) { + CGAL_PRINT("A new event is created .. (" << xp <<")\n";); // a new event is creatd , which inidicates // that the intersection point cannot be one //of the end-points of two curves e->set_intersection(); - this->m_visitor ->update_event(e, c1, c2, true); + this->m_visitor ->update_event(e, c1, c2, true); e->push_back_curve_to_left(c1); e->push_back_curve_to_left(c2); @@ -606,13 +610,13 @@ _create_intersection_point (const Point_2& xp, } else // the event already exists, so we need to update it accordingly { - CGAL_PRINT("event already exists,updating.. (" << xp <<")\n";); + CGAL_PRINT("Event already exists, updating.. (" << xp <<")\n";); if (e == this->m_currentEvent) { // This can happen when c1 starts at the interior of c2 (or vice versa). return; } - + e->add_curve_to_left(c1); e->add_curve_to_left(c2); @@ -647,8 +651,10 @@ _create_intersection_point (const Point_2& xp, std::swap(c1, c2); } - CGAL_SL_DEBUG(e->Print();) } + + CGAL_SL_DEBUG(e->Print();) + } //-----------------------------------------------------------------------------