From 25105714486143362edb1ec0a70ee98b6c0d6b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Feb 2021 16:26:47 +0100 Subject: [PATCH 1/2] always init faces of patches --- .../internal/Corefinement/face_graph_utils.h | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h index c188231238c..c15a4f60ef6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h @@ -437,22 +437,18 @@ void extract_patch_simplices( typedef typename GT::vertex_descriptor vertex_descriptor; typedef typename GT::face_descriptor face_descriptor; - for(face_descriptor f : faces(pm)) + for(face_descriptor f : patch_faces) { - if ( patch_ids[ get(fids, f) ]==patch_id ) + for(halfedge_descriptor h : + halfedges_around_face(halfedge(f, pm),pm)) { - patch_faces.push_back( f ); - for(halfedge_descriptor h : - halfedges_around_face(halfedge(f, pm),pm)) + if ( !is_intersection_edge.count(edge(h, pm)) ) { - if ( !is_intersection_edge.count(edge(h, pm)) ) - { - if ( h < opposite(h,pm) || is_border(opposite(h,pm),pm) ) - interior_edges.push_back( h ); - } - else - shared_edges.push_back(h); + if ( h < opposite(h,pm) || is_border(opposite(h,pm),pm) ) + interior_edges.push_back( h ); } + else + shared_edges.push_back(h); } } @@ -494,7 +490,13 @@ struct Patch_container{ , patch_ids(patch_ids) , fids(fids) , is_intersection_edge(is_intersection_edge) - {} + { + typedef boost::graph_traits GT; + typedef typename GT::face_descriptor face_descriptor; + + for(face_descriptor f : faces(pm)) + patches[patch_ids[ get(fids, f) ]].faces.push_back( f ); + } Patch_description& operator[](std::size_t i) { if ( !patches[i].is_initialized ) From b5277495e2b1111be2cea1cf7327c700fda776d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 19 Feb 2021 16:10:32 +0100 Subject: [PATCH 2/2] remove no longer needed variables --- .../internal/Corefinement/face_graph_utils.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h index c15a4f60ef6..d17227966f0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h @@ -420,12 +420,9 @@ struct Patch_description{ // shared_edges will be filled by halfedges pointing in the patch // that are inside `is_intersection_edge`, thus mesh boundary halfedges // are not necessarily inside. -template +template void extract_patch_simplices( - std::size_t patch_id, PolygonMesh& pm, - const FaceIndexMap fids, - const std::vector& patch_ids, std::vector::face_descriptor>& patch_faces, std::set::vertex_descriptor>& interior_vertices, std::vector::halfedge_descriptor>& interior_edges, @@ -502,8 +499,7 @@ struct Patch_container{ if ( !patches[i].is_initialized ) { extract_patch_simplices( - i, pm, - fids, patch_ids, + pm, patches[i].faces, patches[i].interior_vertices, patches[i].interior_edges, patches[i].shared_edges, is_intersection_edge