From 965d4fd48d27d4182625a811c3a25e455d6c5427 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 22 Aug 2023 17:01:46 +0100 Subject: [PATCH] WIP: When we delete a face we have to transfer its isolated vertices --- Nef_2/include/CGAL/Nef_2/PM_const_decorator.h | 7 ++++--- Nef_2/include/CGAL/Nef_2/PM_overlayer.h | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index de2eb257997..3078ac12e6a 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -434,9 +434,10 @@ check_integrity_and_topological_planarity(bool faces) const /* check the source links of out edges and count isolated vertices */ for (vit = vertices_begin() ; vit != vend; ++vit) { if ( is_isolated(vit) ) { - if ( faces ) - CGAL_assertion_msg( vit->face() != Face_const_handle(), - VI(vit).c_str()); + if (faces) { + CGAL_assertion_msg(vit->face() != Face_const_handle(), + VI(vit).c_str()); + } ++iso_vert_num; } else { CGAL_assertion_msg( vit->halfedge() != Halfedge_const_handle(), diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index a28160ed477..0b822458150 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -626,8 +626,11 @@ avoid the simplification for edge pairs referenced by |e|.}*/ for(v = this->vertices_begin(); v != vend; v=vn) { CGAL_NEF_TRACEN("at vertex "<faces_begin(); f != fend; f=fn) { fn=f; ++fn; Union_find_handle pit = Pitem[f]; - if ( unify_faces.find(pit) != pit ) delete_face(f); + if (unify_faces.find(pit) != pit) { + Union_find_handle root = unify_faces.find(pit); + for(Isolated_vertex_iterator ivi = isolated_vertices_begin(f); ivi != isolated_vertices_end(f); ++ivi){ + v->set_face(*root); + link_as_isolated_vertex(*root,v); + } + delete_face(f); + } }