From 33d5de45ada86568d0ff6f939c1cffddc3cd7e30 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 28 Aug 2007 14:18:41 +0000 Subject: [PATCH] really finish traits copy-constructor bug fix --- .../Arrangement_on_surface_2_global.h | 647 ++++++------------ 1 file changed, 209 insertions(+), 438 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index 80d1ce35050..404d86ffd33 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -196,217 +197,124 @@ void insert(Arrangement_on_surface_2& arr, } /*! Insert a range of x-monotone curves into an empty arrangement - * This generic functor is instantiated when the type - * Construct_visitor::Traits_2 is not the same as the type GeomTraits. - * In this case, we instantiate a local variable of the former and provide - * the later as a single parameter to the constructor + * \param arr the resulting arrangement + * \param begin the begining of the curve range + * \param end past-the-end curve range */ -template -struct Arr_empty_inserter { - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, +template +void insert_empty(Arrangement_on_surface_2& arr, InputIterator begin_xcurves, InputIterator end_xcurves) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 traits(*geom_traits); +{ + typedef typename TopTraits::Sweep_line_construction_visitor + Construct_visitor; + typedef typename Construct_visitor::Traits_2 Construct_traits; - // Define a sweep-line instance and perform the sweep: - Sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves); - } + GeomTraits * geom_traits = arr.geometry_traits(); + Construct_visitor visitor(&arr); - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range + /* If the type Construct_visitor::Traits_2 is the same as the type GeomTraits, + * use a reference to GeomTraits to avoid constructing a new one. + * Otherwise, instantiate a local variable of the former and provide + * the later as a single parameter to the constructor */ - template - void operator()(Arrangement_on_surface_2& arr, + typename boost::mpl::if_, + Construct_traits&, Construct_traits>::type + traits = *geom_traits; + + // Define a sweep-line instance and perform the sweep: + Sweep_line_2 + sweep_line(&traits, &visitor); + sweep_line.sweep(begin_xcurves, end_xcurves); +} + +/*! Insert a range of x-monotone curves and a range of isolated points into + * an empty arrangement + * \param arr the resulting arrangement + * \param begin_xcurves the begining of the curve range + * \param end_xcurves past-the-end curve range + * \param begin_points the begining of the point range + * \param end_points past-the-end point range + */ +template +void insert_empty(Arrangement_on_surface_2& arr, XcInputIterator begin_xcurves, XcInputIterator end_xcurves, PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 traits(*geom_traits); - // Define a sweep-line instance and perform the sweep. - Sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves, begin_points, end_points); - } -}; +{ + typedef typename TopTraits::Sweep_line_construction_visitor + Construct_visitor; + typedef typename Construct_visitor::Traits_2 Construct_traits; + + GeomTraits * geom_traits = arr.geometry_traits(); + Construct_visitor visitor(&arr); -/*! Insert a range of x-monotone curves into an empty arrangement - * This specialized functor is instantiated when the type - * Construct_visitor::Traits_2 is the same as the type GeomTraits. - * In this case, we simply assign the former to a reference of the later - * to avoid an erroneous call to a copy constructor. - */ -template <> -struct Arr_empty_inserter { - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range + /* If the type Construct_visitor::Traits_2 is the same as the type GeomTraits, + * use a reference to GeomTraits to avoid constructing a new one. + * Otherwise, instantiate a local variable of the former and provide + * the later as a single parameter to the constructor */ - template - void operator()(Arrangement_on_surface_2& arr, - InputIterator begin_xcurves, InputIterator end_xcurves) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 & traits = *geom_traits; - - // Define a sweep-line instance and perform the sweep: - Sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves); - } - - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 & traits = *geom_traits; - // Define a sweep-line instance and perform the sweep. - Sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves, end_points, end_points); - } -}; + typename boost::mpl::if_, + Construct_traits&, Construct_traits>::type + traits = *geom_traits; + + // Define a sweep-line instance and perform the sweep. + Sweep_line_2 + sweep_line(&traits, &visitor); + sweep_line.sweep(begin_xcurves, end_xcurves, begin_points, end_points); +} /*! Insert a range of x-monotone curves into a non-empty arrangement - * This generic functor is instantiated when the type - * Construct_visitor::Traits_2 is not the same as the type GeomTraits. - * In this case, we instantiate a local variable of the former and provide - * the later as a single parameter to the constructor + * \param arr the resulting arrangement + * \param begin the begining of the curve range + * \param end past-the-end curve range */ -template -struct Arr_non_empty_inserter { - /*! Insert a range of x-monotone curves into a non-empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_insertion_visitor - Insert_visitor; - Insert_visitor visitor(&arr); - typename Insert_visitor::Traits_2 traits(*geom_traits); - - // Create a set of existing as well as new curves and points. - typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 +template +void insert_non_empty(Arrangement_on_surface_2& arr, + XcInputIterator begin_xcurves, + XcInputIterator end_xcurves, + PInputIterator begin_points, PInputIterator end_points) +{ + typedef typename TopTraits::Sweep_line_insertion_visitor + Insert_visitor; + typedef typename Insert_visitor::Traits_2 Insert_traits; + typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 Ex_x_monotone_curve_2; - typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; - std::list ex_cvs; - std::list ex_pts; - - prepare_for_sweep(arr, - begin_xcurves, end_xcurves, // the x-monotone curves - begin_points, end_points, // the points (if any) - std::back_inserter(ex_cvs), - std::back_inserter(ex_pts), - &traits); + typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; + + GeomTraits * geom_traits = arr.geometry_traits(); + Insert_visitor visitor(&arr); - // Define a basic sweep-line instance and perform the sweep. - Sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep (ex_cvs.begin(), ex_cvs.end(), - ex_pts.begin(), ex_pts.end()); - } -}; - -/*! Insert a range of x-monotone curves into a non-empty arrangement - * This specialized functor is instantiated when the type - * Construct_visitor::Traits_2 is the same as the type GeomTraits. - * In this case, we simply assign the former to a reference of the later - * to avoid an erroneous call to a copy constructor. - */ -template <> -struct Arr_non_empty_inserter { - /*! Insert a range of x-monotone curves into a non-empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range + /* If the type Insert_visitor::Traits_2 is the same as the type GeomTraits, + * use a reference to GeomTraits to avoid constructing a new one. + * Otherwise, instantiate a local variable of the former and provide + * the later as a single parameter to the constructor */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_insertion_visitor - Insert_visitor; - Insert_visitor visitor(&arr); - typename Insert_visitor::Traits_2 & traits = geom_traits; + typename boost::mpl::if_, + Insert_traits&, Insert_traits>::type + traits = *geom_traits; - // Create a set of existing as well as new curves and points. - typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 - Ex_x_monotone_curve_2; - typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; - std::list ex_cvs; - std::list ex_pts; + // Create a set of existing as well as new curves and points. + std::list ex_cvs; + std::list ex_pts; - prepare_for_sweep(arr, - begin_xcurves, end_xcurves, // the x-monotone curves - begin_points, end_points, // the points (if any) - std::back_inserter(ex_cvs), - std::back_inserter(ex_pts), - &traits); + prepare_for_sweep(arr, + begin_xcurves, end_xcurves, // the x-monotone curves + begin_points, end_points, // the points (if any) + std::back_inserter(ex_cvs), + std::back_inserter(ex_pts), + &traits); - // Define a basic sweep-line instance and perform the sweep. - Sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep (ex_cvs.begin(), ex_cvs.end(), - ex_pts.begin(), ex_pts.end()); - } + // Define a basic sweep-line instance and perform the sweep. + Sweep_line_2 + sweep_line(&traits, &visitor); + sweep_line.sweep(ex_cvs.begin(), ex_cvs.end(),ex_pts.begin(), ex_pts.end()); }; //----------------------------------------------------------------------------- @@ -449,24 +357,12 @@ void insert (Arrangement_on_surface_2& arr, std::back_inserter(xcurves), std::back_inserter(iso_points), geom_traits); - if (arr.is_empty()) { - // The arrangement is empty: use the construction visitor. - typedef typename TopTraits::Sweep_line_construction_visitor - Construct_visitor; - typedef typename Construct_visitor::Traits_2 Visitor_traits; - Arr_empty_inserter::value> - insert_empty; + if (arr.is_empty()) insert_empty(arr, xcurves.begin(), xcurves.end(), iso_points.begin(), iso_points.end()); - } else { - // The arrangement is not empty: use the insertion visitor. - typedef typename TopTraits::Sweep_line_insertion_visitor Insert_visitor; - typedef typename Insert_visitor::Traits_2 Visitor_traits; - Arr_non_empty_inserter::value> - insert_non_empty; + else insert_non_empty(arr, xcurves.begin(), xcurves.end(), iso_points.begin(), iso_points.end()); - } // Notify the arrangement observers that the global operation has been // completed. @@ -504,23 +400,11 @@ void insert(Arrangement_on_surface_2& arr, // Choose the operation depending on whether the input arrangement is // empty (then we construct it from scratch), or not (where we just insert // the new curves). - if (arr.is_empty()) { - // The arrangement is empty: use the construction visitor. - typedef typename TopTraits::Sweep_line_construction_visitor - Construct_visitor; - typedef typename Construct_visitor::Traits_2 Visitor_traits; - Arr_empty_inserter::value> - insert_empty; + if (arr.is_empty()) insert_empty(arr, begin, end); - } else { // The arrangement is not empty: use the insertion visitor. - typedef typename TopTraits::Sweep_line_insertion_visitor Insert_visitor; - typedef typename Insert_visitor::Traits_2 Visitor_traits; - typedef typename GeomTraits::Point_2 Point_2; - Arr_non_empty_inserter::value> - insert_non_empty; - std::list empty; + std::list empty; insert_non_empty(arr, begin, end, empty.begin(), empty.end()); } @@ -803,222 +687,121 @@ insert_non_intersecting_curve } /*! Insert a range of x-monotone curves into an empty arrangement - * This generic functor is instantiated when the type - * Construct_visitor::Traits_2 is not the same as the type GeomTraits. - * In this case, we instantiate a local variable of the former and provide - * the later as a single parameter to the constructor + * \param arr the resulting arrangement + * \param begin the begining of the curve range + * \param end past-the-end curve range */ -template -struct Arr_empty_basic_inserter { - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, - InputIterator begin_xcurves, InputIterator end_xcurves) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor +template +void non_intersecting_insert_empty(Arrangement_on_surface_2& arr, + InputIterator begin_xcurves, + InputIterator end_xcurves) +{ + GeomTraits * geom_traits = arr.geometry_traits(); + typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 traits(*geom_traits); - - // Define a basic sweep-line instance (which is not supposed to handle - // insersections) and perform the sweep. - Basic_sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves); - } - - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 traits(*geom_traits); - // Define a basic sweep-line instance (which is not supposed to handle - // insersections) and perform the sweep. - Basic_sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves, begin_points, end_points); - } -}; + Construct_visitor visitor(&arr); + typename Construct_visitor::Traits_2 traits(*geom_traits); + + // Define a basic sweep-line instance (which is not supposed to handle + // insersections) and perform the sweep. + Basic_sweep_line_2 + sweep_line(&traits, &visitor); + sweep_line.sweep(begin_xcurves, end_xcurves); +} /*! Insert a range of x-monotone curves into an empty arrangement - * This specialized functor is instantiated when the type - * Construct_visitor::Traits_2 is the same as the type GeomTraits. - * In this case, we simply assign the former to a reference of the later - * to avoid an erroneous call to a copy constructor. + * \param arr the resulting arrangement + * \param begin the begining of the curve range + * \param end past-the-end curve range */ -template <> -struct Arr_empty_basic_inserter { - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range +template +void non_intersecting_insert_empty(Arrangement_on_surface_2& arr, + XcInputIterator begin_xcurves, + XcInputIterator end_xcurves, + PInputIterator begin_points, + PInputIterator end_points) +{ + typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor + Construct_visitor; + typedef typename Construct_visitor::Traits_2 Construct_traits; + + GeomTraits * geom_traits = arr.geometry_traits(); + Construct_visitor visitor(&arr); + + /* If the type Construct_visitor::Traits_2 is the same as the type GeomTraits, + * use a reference to GeomTraits to avoid constructing a new one. + * Otherwise, instantiate a local variable of the former and provide + * the later as a single parameter to the constructor */ - template - void operator()(Arrangement_on_surface_2& arr, - InputIterator begin_xcurves, InputIterator end_xcurves) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 & traits = *geom_traits; + typename boost::mpl::if_, + Construct_traits&, Construct_traits>::type + traits = *geom_traits; - // Define a basic sweep-line instance (which is not supposed to handle - // insersections) and perform the sweep. - Basic_sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves); - } - - /*! Insert a range of x-monotone curves into an empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor - Construct_visitor; - Construct_visitor visitor(&arr); - typename Construct_visitor::Traits_2 & traits = *geom_traits; - - // Define a basic sweep-line instance (which is not supposed to handle - // insersections) and perform the sweep. - Basic_sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(begin_xcurves, end_xcurves, begin_points, end_points); - } -}; + // Define a basic sweep-line instance (which is not supposed to handle + // insersections) and perform the sweep. + Basic_sweep_line_2 + sweep_line(&traits, &visitor); + sweep_line.sweep(begin_xcurves, end_xcurves, begin_points, end_points); +} /*! Insert a range of x-monotone curves into a non-empty arrangement - * This generic functor is instantiated when the type - * Construct_visitor::Traits_2 is not the same as the type GeomTraits. - * In this case, we instantiate a local variable of the former and provide - * the later as a single parameter to the constructor + * \param arr the resulting arrangement + * \param begin the begining of the curve range + * \param end past-the-end curve range */ -template -struct Arr_non_empty_basic_inserter { - /*! Insert a range of x-monotone curves into a non-empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range - */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_non_intersecting_insertion_visitor - Insert_visitor; - Insert_visitor visitor(&arr); - typename Insert_visitor::Traits_2 traits(*geom_traits); - - // Create a set of existing as well as new curves and points. - typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 +template +void non_intersecting_insert_non_empty(Arrangement_on_surface_2& arr, + XcInputIterator begin_xcurves, + XcInputIterator end_xcurves, + PInputIterator begin_points, + PInputIterator end_points) +{ + typedef typename TopTraits::Sweep_line_non_intersecting_insertion_visitor + Insert_visitor; + typedef typename Insert_visitor::Traits_2 Insert_traits; + typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 Ex_x_monotone_curve_2; - typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; - std::list ex_cvs; - std::list ex_pts; - - prepare_for_sweep(arr, - begin_xcurves, end_xcurves, // the x-monotone curves - begin_points, end_points, // the points (if any) - std::back_inserter(ex_cvs), - std::back_inserter(ex_pts), - &traits); + typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; - // Define a basic sweep-line instance and perform the sweep. - Basic_sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep (ex_cvs.begin(), ex_cvs.end(), - ex_pts.begin(), ex_pts.end()); - } -}; + GeomTraits * geom_traits = arr.geometry_traits(); + Insert_visitor visitor(&arr); -/*! Insert a range of x-monotone curves into a non-empty arrangement - * This specialized functor is instantiated when the type - * Construct_visitor::Traits_2 is the same as the type GeomTraits. - * In this case, we simply assign the former to a reference of the later - * to avoid an erroneous call to a copy constructor. - */ -template <> -struct Arr_non_empty_basic_inserter { - /*! Insert a range of x-monotone curves into a non-empty arrangement - * \param arr the resulting arrangement - * \param begin the begining of the curve range - * \param end past-the-end curve range + /* If the type Construct_visitor::Traits_2 is the same as the type GeomTraits, + * use a reference to GeomTraits to avoid constructing a new one. + * Otherwise, instantiate a local variable of the former and provide + * the later as a single parameter to the constructor */ - template - void operator()(Arrangement_on_surface_2& arr, - XcInputIterator begin_xcurves, XcInputIterator end_xcurves, - PInputIterator begin_points, PInputIterator end_points) - { - GeomTraits * geom_traits = arr.geometry_traits(); - typedef typename TopTraits::Sweep_line_non_intersecting_insertion_visitor - Insert_visitor; - Insert_visitor visitor(&arr); - typename Insert_visitor::Traits_2 & traits = geom_traits; - - // Create a set of existing as well as new curves and points. - typedef typename Insert_visitor::Traits_2::X_monotone_curve_2 - Ex_x_monotone_curve_2; - typedef typename Insert_visitor::Traits_2::Point_2 Ex_point_2; - std::list ex_cvs; - std::list ex_pts; + typename boost::mpl::if_, + Insert_traits&, Insert_traits>::type + traits = *geom_traits; - prepare_for_sweep(arr, - begin_xcurves, end_xcurves, // The x-monotone curves - begin_points, end_points, // The points (if any) - std::back_inserter(ex_cvs), - std::back_inserter(ex_pts), - &traits); + // Create a set of existing as well as new curves and points. + std::list ex_cvs; + std::list ex_pts; + + prepare_for_sweep(arr, + begin_xcurves, end_xcurves, // the x-monotone curves + begin_points, end_points, // the points (if any) + std::back_inserter(ex_cvs), + std::back_inserter(ex_pts), + &traits); - // Define a basic sweep-line instance and perform the sweep. - Basic_sweep_line_2 - sweep_line(&traits, &visitor); - sweep_line.sweep(ex_cvs.begin(), ex_cvs.end(), - ex_pts.begin(), ex_pts.end()); - } -}; + sweep_line(&traits, &visitor); + sweep_line.sweep(ex_cvs.begin(), ex_cvs.end(), ex_pts.begin(), ex_pts.end()); +} //----------------------------------------------------------------------------- // Insert a range of pairwise interior-disjoint x-monotone curves into @@ -1042,24 +825,12 @@ void insert_non_intersecting_curves // Choose the operation depending on whether the input arrangement is // empty (then we construct it from scratch), or not (where we just insert // the new curves). - if (arr.is_empty()) { - // The arrangement is empty: use the construction visitor. - typedef typename TopTraits::Sweep_line_non_intersecting_construction_visitor - Construct_visitor; - typedef typename Construct_visitor::Traits_2 Visitor_traits; - Arr_empty_basic_inserter::value> - insert_empty; - insert_empty(arr, begin, end); - } else { - // The arrangement is not empty: use the insertion visitor. - typedef typename TopTraits::Sweep_line_non_intersecting_insertion_visitor - Insert_visitor; - typedef typename Insert_visitor::Traits_2 Visitor_traits; - typedef typename GeomTraits::Point_2 Point_2; - Arr_non_empty_basic_inserter:: - value> insert_non_empty; - std::list empty; - insert_non_empty(arr, begin, end, empty.begin(), empty.end()); + if (arr.is_empty()) + non_intersecting_insert_empty(arr, begin, end); + else { + std::list empty; + non_intersecting_insert_non_empty(arr, begin, end, + empty.begin(), empty.end()); } // Notify the arrangement observers that the global operation has been