From b7583f43d57d6e5312edf5e8c4ac8112e9804f94 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 13 Aug 2020 09:19:50 +0200 Subject: [PATCH] Add indexed sweep with isolated points --- .../include/CGAL/Arr_overlay_2.h | 12 ++++++++++-- .../CGAL/No_intersection_surface_sweep_2.h | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h index 3cb975e4b0b..2d7c0185fa0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h @@ -297,8 +297,16 @@ overlay(const Arrangement_on_surface_2& arr1 // Clear the result arrangement and perform the sweep to construct it. arr.clear(); - surface_sweep.sweep(xcvs_vec.begin(), xcvs_vec.end(), - pts_vec.begin(), pts_vec.end()); + if (std::is_same::value) + surface_sweep.sweep(xcvs_vec.begin(), xcvs_vec.end(), + pts_vec.begin(), pts_vec.end()); + else + surface_sweep.indexed_sweep (xcvs_vec, + Indexed_sweep_accessor + + (arr1, arr2), + pts_vec.begin(), pts_vec.end()); xcvs_vec.clear(); pts_vec.clear(); } diff --git a/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h b/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h index 99660eb4c63..4bc47c4def0 100644 --- a/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h @@ -322,6 +322,24 @@ public: m_visitor->after_sweep(); } + template + void indexed_sweep (const EdgeRange& edges, + const Accessor& accessor, + PointInputIterator action_points_begin, + PointInputIterator action_points_end) + { + m_visitor->before_sweep(); + accessor.before_init(); + _init_indexed_sweep(edges, accessor); + accessor.after_init(); + _init_points(action_points_begin, action_points_end, Event::ACTION); + //m_visitor->after_init(); + _sweep(); + _complete_sweep(); + m_visitor->after_sweep(); + } + /*! Get an iterator for the first subcurve in the status line. */ Status_line_iterator status_line_begin() { return m_statusLine.begin(); }