diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_component.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_component.cpp index 2e0a0d2703d..1cde09f74c6 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_component.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_component.cpp @@ -47,13 +47,12 @@ int main(int, char* argv[]) std::cerr << cc.size() << " faces in the CC of " << fd << std::endl; - Mesh::Property_map fccmap; - fccmap = sm.add_property_map("f:CC").first; - int num = PMP::connected_components(sm, - fccmap, - CGAL::parameters::edge_is_constrained_map(Constraint()) - .face_index_map(get(CGAL::face_index, sm)) - ); + Mesh::Property_map fccmap; + fccmap = sm.add_property_map("f:CC").first; + std::size_t num = PMP::connected_components(sm, + fccmap, + CGAL::parameters::edge_is_constrained_map(Constraint()) + ); std::cerr << "The graph has " << num << " connected components (face connectivity)" << std::endl; BOOST_FOREACH(face_descriptor f , faces(sm)){ diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Connected_components.h index 44a1f6c20c9..7977cbabc86 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Connected_components.h @@ -468,12 +468,14 @@ connected_component(typename boost::graph_traits::face_descriptor s * computes for each face the index of the connected components to which it belongs. * Two faces are considered to be in the same connected component if they share an edge that is not constrained. * \tparam PolygonMesh a model of `FaceGraph` + * \tparam FaceComponentMap the property map with the face descriptor as key type, and the index of its connected component as value type * \tparam EdgeConstraintMap a property map with the edge descriptor as key type and `bool` as value type. - * \tparam FaceComponentMap the property map with the face index as value type, and the index of its connected component + * \tparam FaceIndexMap a property map for the face index + * \tparam * \returns the number of connected components. */ template -typename boost::graph_traits::faces_size_type +typename boost::property_traits::value_type connected_components(PolygonMesh& pmesh, FaceComponentMap& fcm, EdgeConstraintMap ecmap, @@ -489,7 +491,7 @@ connected_components(PolygonMesh& pmesh, template -typename boost::graph_traits::faces_size_type +typename boost::property_traits::value_type connected_components(PolygonMesh& pmesh, FaceComponentMap& fcm, const cgal_bgl_named_params& params) @@ -516,7 +518,7 @@ connected_components(PolygonMesh& pmesh, * \returns the number of connected components. */ template -typename boost::graph_traits::faces_size_type +typename boost::property_traits::value_type connected_components(PolygonMesh& pmesh, FaceComponentMap& fcm) {