diff --git a/BGL/doc/BGL/Concepts/MutableFaceGraph.h b/BGL/doc/BGL/Concepts/MutableFaceGraph.h index eb7c5c915b2..7df4f7b4b5b 100644 --- a/BGL/doc/BGL/Concepts/MutableFaceGraph.h +++ b/BGL/doc/BGL/Concepts/MutableFaceGraph.h @@ -47,4 +47,4 @@ Indicates the expected size of vertices (`nv`), edges (`ed`) and faces (`nf`). */ template void -reserve(MutableFaceGraph& g, boost::graph_traits::vertices_size_type nv, boost::graph_traits::vertices_size_type ne, boost::graph_traits::vertices_size_type nf); +reserve(MutableFaceGraph& g, boost::graph_traits::vertices_size_type nv, boost::graph_traits::edges_size_type ne, boost::graph_traits::faces_size_type nf); diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index a3aeaf48315..3a869f2838c 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -71,6 +71,10 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, tm_face_descriptor tm_null_face = boost::graph_traits::null_face(); + reserve(tm, static_cast::vertices_size_type>(vertices(sm).size()), + static_cast::edges_size_type>(edges(sm).size()), + static_cast::faces_size_type>(faces(sm).size()) ); + //insert halfedges and create each vertex when encountering its halfedge BOOST_FOREACH(sm_edge_descriptor sm_e, edges(sm)) { @@ -373,7 +377,6 @@ void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v, H2H h2h, F2F f2f, Src_vpm sm_vpm, Tgt_vpm tm_vpm ) { - reserve(tm, vertices(sm).size(), edges(sm).size(), faces(sm).size()); internal::copy_face_graph(sm, tm, CGAL::graph_has_property(), v2v, h2h, f2f, diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h index 06ba56fdaac..ccccdc22843 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h @@ -72,7 +72,10 @@ public: void operator()(PM& pmesh, const bool insert_isolated_vertices = true) { - reserve(pmesh, _points.size(), 2*_polygons.size(), _polygons.size()); + reserve(pmesh, static_cast::vertices_size_type>(_points.size()), + static_cast::edges_size_type>(2*_polygons.size()), + static_cast::faces_size_type>(_polygons.size()) ); + Vpmap vpmap = get(CGAL::vertex_point, pmesh); boost::dynamic_bitset<> not_isolated;