diff --git a/Arrangement_2/include/CGAL/Basic_sweep_line_2.h b/Arrangement_2/include/CGAL/Basic_sweep_line_2.h index 4f71fb2e468..ad181ad2a34 100644 --- a/Arrangement_2/include/CGAL/Basic_sweep_line_2.h +++ b/Arrangement_2/include/CGAL/Basic_sweep_line_2.h @@ -485,9 +485,6 @@ public: _init_endpoint(curve, MAX_END, m_subCurves+index); _init_endpoint(curve, MIN_END, m_subCurves+index); - /*(m_subCurves+index)->set_left_event(left_event); - (m_subCurves+index)->set_right_event(right_event);*/ - return; } @@ -901,7 +898,7 @@ protected: // We have a new event Point_2 pt = Point_2(); e = allocate_event(pt, type); - _set_attributes_of_infinity(e, x_inf, y_inf, ind); + _set_attributes_of_infinity(e, x_inf, y_inf); if(sc != NULL) { if(type == Base_event::LEFT_END) @@ -922,7 +919,7 @@ protected: // The event already exsits e = *(pair_res.first); e->set_attribute(type); - _set_attributes_of_infinity(e, x_inf, y_inf, ind); + _set_attributes_of_infinity(e, x_inf, y_inf); if(sc != NULL) { if(type == Base_event::LEFT_END) @@ -938,14 +935,12 @@ protected: } } - return (std::make_pair(e, !exist)); } void _set_attributes_of_infinity(Event* e, Infinity_type x_inf, - Infinity_type y_inf, - Curve_end ind) + Infinity_type y_inf) { if(x_inf == MINUS_INFINITY) e->set_minus_infinite_x(); diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h b/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h index 383bf387e07..f2835a6e9c5 100644 --- a/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Arr_construction_visitor.h @@ -95,11 +95,7 @@ protected: std::list m_subcurves_at_ubf; Event* m_prev_minus_inf_x_event; Event* m_prev_plus_inf_y_event; - - - - private: Arr_construction_visitor (const Self& ); @@ -193,7 +189,10 @@ public: } if(event->get_num_right_curves() == 0) + { + set_prev_inf_event_to_null(event); return true; + } event->get_is_curve_in_arr().resize(event->get_num_right_curves(),false); for(SubCurveIter itr = event->right_curves_begin(); @@ -218,7 +217,7 @@ public: { // we have a handle from the previous insert if ( hhandle != Halfedge_handle(NULL) ) - { + { res = this->insert_from_right_vertex(cv, hhandle, sc); res = res->twin(); } @@ -244,6 +243,8 @@ public: CGAL_assertion(prev->face() == hhandle->face()); bool dummy; + + res = this->insert_at_vertices(cv,hhandle,prev,sc, dummy); res = res->twin(); } @@ -269,6 +270,7 @@ public: if(lastEvent->dec_right_curves_counter() == 0) { + set_prev_inf_event_to_null(lastEvent); (this ->deallocate_event(lastEvent)); } @@ -479,7 +481,7 @@ public: case MINUS_INFINITY: m_arr_access.split_fictitious_edge(m_lh, v_at_inf); event->set_halfedge_handle(m_lh); - if(m_prev_minus_inf_x_event != NULL) + if(m_prev_minus_inf_x_event) m_prev_minus_inf_x_event->set_halfedge_handle(m_lh->next()); m_prev_minus_inf_x_event = event; return; @@ -564,6 +566,15 @@ private: m_sc_he_table[i] = he; } + void set_prev_inf_event_to_null(Event* e) + { + if(e == m_prev_minus_inf_x_event) + m_prev_minus_inf_x_event = NULL; + else + if(e == m_prev_plus_inf_y_event) + m_prev_plus_inf_y_event = NULL; + } + }; CGAL_END_NAMESPACE