diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index 4c9588546a6..6779fccb616 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -74,7 +74,7 @@ int main(int argc, char** argv) // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. boost::vector_property_map - normals(get(CGAL::face_index, lcc)); + normals(num_faces(lcc), get(CGAL::face_index, lcc)); calculate_face_normals( lcc // Graph diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index 5de0ba63f70..dbdca040ef5 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -82,7 +82,7 @@ int main(int argc, char** argv) // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. boost::vector_property_map - normals(get(CGAL::face_index, P)); + normals(num_faces(P), get(CGAL::face_index, P)); calculate_face_normals( P // Graph 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 b98a70c63c5..ef715e096d2 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 @@ -387,7 +387,7 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, Output_iterator out = choose_parameter(get_parameter(np, internal_np::output_iterator)); // vector_property_map - boost::vector_property_map face_cc(fimap); + boost::vector_property_map face_cc(num_faces(pmesh), fimap); std::size_t num = connected_components(pmesh, face_cc, np); // Even if we do not want to keep anything we need to first @@ -518,7 +518,7 @@ std::size_t keep_large_connected_components(PolygonMesh& pmesh, Output_iterator out = choose_parameter(get_parameter(np, internal_np::output_iterator)); // vector_property_map - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(num_faces(pmesh), fim); std::size_t num = connected_components(pmesh, face_cc, np); std::vector component_size(num, 0); @@ -595,10 +595,10 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh for(std::size_t i : components_to_keep) cc_to_keep.insert(i); - boost::vector_property_map keep_vertex(vim); - for(vertex_descriptor v : vertices(pmesh)){ + boost::vector_property_map keep_vertex(num_vertices(pmesh), vim); + for(vertex_descriptor v : vertices(pmesh)) keep_vertex[v] = false; - } + for(face_descriptor f : faces(pmesh)){ if (cc_to_keep.find(get(fcm,f)) != cc_to_keep.end()) put(fcm, f, keep ? 1 : 0); @@ -821,7 +821,7 @@ void remove_connected_components(PolygonMesh& pmesh typedef typename CGAL::GetInitializedFaceIndexMap::type FaceIndexMap; FaceIndexMap fim = CGAL::get_initialized_face_index_map(pmesh, np); - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(num_faces(pmesh), fim); connected_components(pmesh, face_cc, np); std::vector cc_to_remove; @@ -871,7 +871,7 @@ void keep_connected_components(PolygonMesh& pmesh typedef typename CGAL::GetInitializedFaceIndexMap::type FaceIndexMap; FaceIndexMap fim = CGAL::get_initialized_face_index_map(pmesh, np); - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(num_faces(pmesh), fim); connected_components(pmesh, face_cc, np); std::vector cc_to_keep; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 127f6c1b31c..5bfa2a7a839 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -179,7 +179,7 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, return 0; // Compute the connected components only once - boost::vector_property_map face_cc(fim); + boost::vector_property_map face_cc(num_faces(tmesh), fim); std::size_t num = connected_components(tmesh, face_cc, np); #ifdef CGAL_PMP_DEBUG_SMALL_CC_REMOVAL diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp index 9b5a81b4855..c4eaac08ec5 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp @@ -38,7 +38,7 @@ void mesh_with_id(const char* argv1, const bool save_output) boost::vector_property_map::type> - fccmap(get(CGAL::face_index,sm)); + fccmap(num_faces(sm), get(CGAL::face_index,sm)); std::size_t num = PMP::connected_components(sm, fccmap); if (strcmp(argv1, "data/blobby_3cc.off") == 0) @@ -92,7 +92,7 @@ void mesh_no_id(const char* argv1, const bool save_output) boost::vector_property_map::type> - fccmap(fim); + fccmap(num_faces(sm), fim); std::size_t num = PMP::connected_components(sm, fccmap); @@ -133,7 +133,7 @@ void test_border_cases() boost::vector_property_map::type> - fccmap(get(boost::face_index,sm)); + fccmap(num_faces(sm), get(boost::face_index,sm)); PMP::connected_components(sm, fccmap); std::size_t nb_faces=num_faces(sm); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp index 1c1e7f3bd70..f64b7f2da36 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Join_and_split_polyhedra_plugin.cpp @@ -237,7 +237,7 @@ void Polyhedron_demo_join_and_split_polyhedra_plugin::on_actionColorConnectedCom = get(boost::face_index, pmesh); boost::vector_property_map::type> - fccmap(fim); + fccmap(num_faces(pmesh),fim); boost::property_map >::type pid = get(CGAL::face_patch_id_t(), pmesh); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h index 3ec4c1871b7..6331d623a70 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h @@ -273,7 +273,7 @@ public Q_SLOTS: boost::vector_property_map::type> - fccmap; + fccmap(num_faces(poly)); //get connected componant from the picked face std::set final_sel; diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 19e7013495b..c904ac3ff38 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -1606,7 +1606,7 @@ QString Scene_surface_mesh_item::computeStats(int type) { boost::vector_property_map::type> - fccmap(get(boost::face_index, *(d->smesh_))); + fccmap(num_faces(*(d->smesh_)), get(boost::face_index, *(d->smesh_))); return QString::number(CGAL::Polygon_mesh_processing::connected_components(*(d->smesh_), fccmap)); } case NB_BORDER_EDGES: