diff --git a/Envelope_3/include/CGAL/Envelope_3/Arrangement_2_incremental_insert.h b/Envelope_3/include/CGAL/Envelope_3/Arrangement_2_incremental_insert.h index b2144503cd8..d12eba2eb57 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Arrangement_2_incremental_insert.h +++ b/Envelope_3/include/CGAL/Envelope_3/Arrangement_2_incremental_insert.h @@ -37,95 +37,6 @@ CGAL_BEGIN_NAMESPACE - -//----------------------------------------------------------------------------- -// Insert a curve into the arrangement (incremental insertion). -// The inserted x-monotone curve may intersect the existing arrangement. -// Use the given zone visitor. -// -template -void insert_x_monotone_curve (Arrangement_2& arr, - const typename Traits::X_monotone_curve_2& c, - const PointLocation& pl, - ZoneVisitor& visitor) -{ - - - // Obtain an arrangement accessor. - typedef Arrangement_2 Arrangement_2; - - Arr_accessor arr_access (arr); - Arrangement_zone_2 arr_zone (arr, &visitor); - - arr_zone.init (c, pl); - - // Notify the arrangement observers that a global operation is about to - // take place. - arr_access.notify_before_global_change(); - - // Insert the current x-monotone curve into the arrangement. - arr_zone.compute_zone(); - - // Notify the arrangement observers that the global operation has been - // completed. - arr_access.notify_after_global_change(); - - //// Break the input curve into x-monotone subcurves and isolated points. - //typedef Arr_traits_adaptor_2 Traits_wrapper_2; - - //Traits_wrapper_2 *traits = - // static_cast(arr.get_traits()); - - //std::list x_objects; - //std::list::const_iterator obj_iter; - //typename Traits::X_monotone_curve_2 x_curve; - //typename Traits::Point_2 iso_p; - //Object obj; - //bool assign_success; - - /* traits->make_x_monotone_2_object() (c, - std::back_inserter (x_objects));*/ - - //// Insert each x-monotone curve into the arrangement. - //for (obj_iter = x_objects.begin(); obj_iter != x_objects.end(); ++obj_iter) - //{ - // // Act according to the type of the current object. - // if (assign (x_curve, *obj_iter)) - // { - // // Inserting an x-monotone curve: - // // Initialize the zone-computation object with the given curve. - // arr_zone.init (x_curve, pl); - - // // Notify the arrangement observers that a global operation is about to - // // take place. - // arr_access.notify_before_global_change(); - - // // Insert the current x-monotone curve into the arrangement. - // arr_zone.compute_zone(); - - // // Notify the arrangement observers that the global operation has been - // // completed. - // arr_access.notify_after_global_change(); - // } - // else - // { - // assign_success = assign (iso_p, *obj_iter); - - // CGAL_assertion (assign_success); - // if (! assign_success) - // continue; - - // // Inserting a point into the arrangement: - // //insert_vertex (arr, iso_p, pl); - // // we use the version with the visitor - // insert_point(arr, iso_p, pl, visitor); - // - // } - //} - - return; -} - //----------------------------------------------------------------------------- // Insert a vertex that corresponds to a given point into the arrangement. // The inserted point may lie on any existing arrangement feature. diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index b83c4956d09..41553987e26 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -284,7 +284,7 @@ public: else if (assign(curve, cur_obj)) { zone_visitor.set_current_intersection_type(curve.second); - insert_x_monotone_curve(copied_face_arr, curve.first, pl, zone_visitor); + insert (copied_face_arr, curve.first, pl, zone_visitor); } else CGAL_assertion_msg(false, "wrong projected intersection type"); @@ -2443,8 +2443,10 @@ protected: // the zone visitor functions /*! Initialize the visitor with an arrangement object. */ - void init (Minimization_diagram_2 *arr) + void init (typename Minimization_diagram_2::Base *base_arr) { + Minimization_diagram_2 *arr = + dynamic_cast(base_arr); CGAL_assertion(&copied_arr == arr); insert_visitor.init(arr); }