From fa2c353fffc363dc8d9f67f6197ba08a457c8fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 12 Aug 2021 10:35:39 +0200 Subject: [PATCH] move impl outside of the class --- .../Arr_insertion_ss_visitor.h | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h index a9ab34bd676..0cea5889535 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h @@ -73,29 +73,14 @@ private: void update_incident_halfedge_after_split(Subcurve_* sc, Halfedge_handle he, Halfedge_handle new_he, - Tag_true) - { - std::vector leaves; - sc->all_leaves( std::back_inserter(leaves) ); - for(Subcurve* ssc : leaves) - { - Event* last_event_on_ssc = ssc->last_event(); - if (last_event_on_ssc->halfedge_handle() == he) - last_event_on_ssc->set_halfedge_handle(new_he->next()); - } - } + Tag_true); // update halfedge pointing to events, case without overlaps template void update_incident_halfedge_after_split(Subcurve_* sc, Halfedge_handle he, Halfedge_handle new_he, - Tag_false) - { - Event* last_event_on_sc = sc->last_event(); - if (last_event_on_sc->halfedge_handle() == he) - last_event_on_sc->set_halfedge_handle(new_he->next()); - } + Tag_false); public: /*! A notification invoked when a new subcurve is created. */ @@ -129,6 +114,43 @@ public: // Member-function definitions: //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// update halfedge pointing to events, case with overlaps +// +template +template +void Arr_insertion_ss_visitor:: +update_incident_halfedge_after_split(Subcurve_* sc, + Halfedge_handle he, + Halfedge_handle new_he, + Tag_true) +{ + std::vector leaves; + sc->all_leaves( std::back_inserter(leaves) ); + for(Subcurve* ssc : leaves) + { + Event* last_event_on_ssc = ssc->last_event(); + if (last_event_on_ssc->halfedge_handle() == he) + last_event_on_ssc->set_halfedge_handle(new_he->next()); + } +} + +//----------------------------------------------------------------------------- +// update halfedge pointing to events, case without overlaps +// +template +template +void Arr_insertion_ss_visitor:: +update_incident_halfedge_after_split(Subcurve_* sc, + Halfedge_handle he, + Halfedge_handle new_he, + Tag_false) +{ + Event* last_event_on_sc = sc->last_event(); + if (last_event_on_sc->halfedge_handle() == he) + last_event_on_sc->set_halfedge_handle(new_he->next()); +} + //----------------------------------------------------------------------------- // Check if the halfedge associated with the given subcurve will be split // at the given event.