From 6a5857cf6781641d05cb2cef175b39a430018c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 10 Dec 2018 07:22:17 +0100 Subject: [PATCH 1/4] add missing : --- .../Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h index 0497ab07c75..0c26fe5caac 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/Straight_skeleton_converter_2.h @@ -100,7 +100,7 @@ boost::shared_ptr operator()( Source_skeleton const& s) const; \tparam SrcSs type of the source straight skeleton \tparam TgtSs type of the target straight skeleton \tparam NTConverter a function object that must -provide `TgtSs:Traits::FT operator()(SrcSs::Traits::FT n)` that converts `n` to an +provide `TgtSs::Traits::FT operator()(SrcSs::Traits::FT n)` that converts `n` to an `TgtSs::Traits::FT` which has the same value. The default value of this parameter is `NT_converter`. \cgalModels `StraightSkeletonItemsConverter_2` From 0f0f03e08bb048eb47efeee0201d41d5a4648188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 19 Dec 2018 16:05:08 +0100 Subject: [PATCH 2/4] handle empty meshes --- .../include/CGAL/Polygon_mesh_processing/bbox.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 033364bac9b..a82985d40a4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -76,13 +76,12 @@ namespace CGAL { GT gt = choose_param(get_param(np, internal_np::geom_traits), GT()); typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object(); - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - halfedge_descriptor h0 = *(halfedges(pmesh).first); - CGAL::Bbox_3 bb = get(vpm, target(h0, pmesh)).bbox(); - BOOST_FOREACH(halfedge_descriptor h, halfedges(pmesh)) + CGAL::Bbox_3 bb; + BOOST_FOREACH(vertex_descriptor v, vertices(pmesh)) { - bb += get_bbox( get(vpm, target(h, pmesh)) ); + bb += get_bbox( get(vpm, v) ); } return bb; } From 2c6e9c2b70b5975827ca1b8cdf6f5a8091aa5992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 20 Dec 2018 15:57:51 +0100 Subject: [PATCH 3/4] Fixed memory leaks in partition code --- .../CGAL/boost/graph/METIS/partition_dual_graph.h | 15 ++++++++++++--- .../CGAL/boost/graph/METIS/partition_graph.h | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h index 8bfeb002ae1..7e2a15870a7 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h @@ -36,12 +36,15 @@ #include #include +#include + namespace CGAL { namespace METIS { template -void partition_dual_graph(const TriangleMesh& tm, int nparts, +void partition_dual_graph(const TriangleMesh& tm, + int nparts, METIS_options options, // options array const NamedParameters& np) { @@ -93,11 +96,11 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts, idx_t objval; // partition info for the nodes - idx_t* npart = (idx_t*) calloc(nn, sizeof(idx_t)); + idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t)); CGAL_assertion(npart != NULL); // partition info for the elements - idx_t* epart = (idx_t*) calloc(ne, sizeof(idx_t)); + idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t)); CGAL_assertion(epart != NULL); // do not support Fortran-style arrays @@ -118,6 +121,12 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts, Output_face_partition_ids fo; vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id)); fo(tm, epart, get_param(np, internal_np::face_partition_id)); + + delete[] eptr; + delete[] eind; + + std::free(npart); + std::free(epart); } template diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h index 65176d37131..d0f3e56b759 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h @@ -34,6 +34,8 @@ #include #include +#include + namespace CGAL { namespace METIS { @@ -76,7 +78,8 @@ struct Output_face_partition_ids }; template -void partition_graph(const TriangleMesh& tm, int nparts, +void partition_graph(const TriangleMesh& tm, + int nparts, METIS_options options, // pointer to the options array const NamedParameters& np) { @@ -125,11 +128,11 @@ void partition_graph(const TriangleMesh& tm, int nparts, idx_t objval; // partition info for the nodes - idx_t* npart = (idx_t*) calloc(nn, sizeof(idx_t)); + idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t)); CGAL_assertion(npart != NULL); // partition info for the elements - idx_t* epart = (idx_t*) calloc(ne, sizeof(idx_t)); + idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t)); CGAL_assertion(epart != NULL); // do not support Fortran-style arrays @@ -150,6 +153,12 @@ void partition_graph(const TriangleMesh& tm, int nparts, Output_face_partition_ids fo; vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id)); fo(tm, epart, get_param(np, internal_np::face_partition_id)); + + delete[] eptr; + delete[] eind; + + std::free(npart); + std::free(epart); } template From fe5c3a77f97b8f3ee1a644ebb2aa74ac2d7a26b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 21 Dec 2018 09:51:58 +0100 Subject: [PATCH 4/4] swap the edge too --- .../internal/Isotropic_remeshing/remesh_impl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 08d90b8f234..0e0596fc1fb 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -686,6 +686,7 @@ namespace internal { if (is_on_border(he) || is_on_mesh(he)) { he = opposite(he, mesh_); //he now is PATCH_BORDER + e = edge(he, mesh_); CGAL_assertion(is_on_patch_border(he)); } }//end if(not on PATCH)