diff --git a/BGL/include/CGAL/boost/graph/named_function_params.h b/BGL/include/CGAL/boost/graph/named_function_params.h index 067847d3b68..651b158ffa3 100644 --- a/BGL/include/CGAL/boost/graph/named_function_params.h +++ b/BGL/include/CGAL/boost/graph/named_function_params.h @@ -121,6 +121,14 @@ namespace CGAL { typedef cgal_bgl_named_params Params; return Params(p, *this); } + + template + cgal_bgl_named_params + face_index_map(const IndexMap& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } template cgal_bgl_named_params @@ -321,6 +329,9 @@ namespace CGAL { } #endif + + namespace parameters { + template cgal_bgl_named_params vertex_index_map(IndexMap const& p) @@ -337,6 +348,14 @@ namespace CGAL { return Params(p); } + template + cgal_bgl_named_params + face_index_map(IndexMap const& p) + { + typedef cgal_bgl_named_params Params; + return Params(p); + } + template cgal_bgl_named_params vertex_point_map(PointMap const& p) @@ -424,6 +443,9 @@ namespace CGAL { typedef cgal_bgl_named_params Params; return Params(em); } + + } // namespace parameters + } //namespace CGAL #if BOOST_VERSION >= 105100 diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 6c33ef72eea..544bb0e4ac8 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -68,6 +68,7 @@ create_single_source_cgal_program( "fill_polyhedron_example.cpp" ) create_single_source_cgal_program( "refine_polyhedron_example.cpp" ) create_single_source_cgal_program( "triangulate_polyline_example.cpp" ) create_single_source_cgal_program( "connected_component.cpp" ) +create_single_source_cgal_program( "cc_polyhedron.cpp" ) else(EIGEN3_FOUND) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_polyhedron.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_polyhedron.cpp new file mode 100644 index 00000000000..3c2fd3c87e5 --- /dev/null +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/cc_polyhedron.cpp @@ -0,0 +1,79 @@ +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace PMP = CGAL::Polygon_mesh_processing; + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_3 Point; +typedef CGAL::Polyhedron_3 Mesh; + + +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; +typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; +typedef boost::graph_traits::edge_descriptor edge_descriptor; + + +template +struct Constraint { + Constraint() { } + + Constraint(G & g) : g(&g) { } + + bool operator[](const edge_descriptor&) const { + return false; // no constraint + } + + G* g; +}; + + +int main(int, char* argv[]) +{ + Mesh sm; + std::ifstream in(argv[1]); + in >> sm; + + int i=0; + BOOST_FOREACH(face_descriptor f, faces(sm)){ + f->id() = i++; + } + i=0; + BOOST_FOREACH(vertex_descriptor v, vertices(sm)){ + v->id() = i++; + } + + std::vector cc; + face_descriptor fd = *faces(sm).first; + CGAL::Polygon_mesh_processing::connected_component(fd, + sm, + std::back_inserter(cc)); + + + std::cerr << cc.size() << " faces in the CC of " << &*fd << std::endl; + + boost::vector_property_map::type> fccmap(get(boost::face_index,sm)); + + int num = PMP::connected_components(sm, + fccmap// , + // CGAL::parameters::edge_is_constrained_map(Constraint()) + // .face_index_map(get(CGAL::face_index, sm)) + ); + + std::cerr << "The graph has " << num << " connected components (face connectivity)" << std::endl; + BOOST_FOREACH(face_descriptor f , faces(sm)){ + std::cout << &*f << " in connected component " << fccmap[f] << std::endl; + } + + CGAL::Polygon_mesh_processing::keep_largest_connected_components(sm,2); + + std::cout << "mesh:\n" << sm << std::endl; + return 0; +} 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 ef67206829f..2e0a0d2703d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_component.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_component.cpp @@ -5,6 +5,8 @@ #include +namespace PMP = CGAL::Polygon_mesh_processing; + typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; typedef CGAL::Surface_mesh Mesh; @@ -40,7 +42,6 @@ int main(int, char* argv[]) face_descriptor fd = *faces(sm).first; CGAL::Polygon_mesh_processing::connected_component(fd, sm, - Constraint(sm), std::back_inserter(cc)); @@ -48,9 +49,11 @@ int main(int, char* argv[]) Mesh::Property_map fccmap; fccmap = sm.add_property_map("f:CC").first; - int num = CGAL::Polygon_mesh_processing::connected_components(sm, - //Constraint(sm), - fccmap); + int num = PMP::connected_components(sm, + fccmap, + CGAL::parameters::edge_is_constrained_map(Constraint()) + .face_index_map(get(CGAL::face_index, sm)) + ); 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 e9f004b2b61..d171a9d03b7 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 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -468,66 +469,96 @@ connected_component(typename boost::graph_traits::face_descriptor s * 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 EdgeConstraintMap a property map with the edge descriptor as key type and `bool` as value type. - * \tparam FaceComponentIndexMap the property map with the face index as value type, and the index of its connected component + * \tparam FaceComponentMap the property map with the face index as value type, and the index of its connected component * \returns the number of connected components. */ -template + template typename boost::graph_traits::faces_size_type connected_components(PolygonMesh& pmesh, + FaceComponentMap& fcm, EdgeConstraintMap ecmap, - FaceComponentIndexMap& fim) + FaceIndexMap fim) { typedef Dual Dual; typedef boost::filtered_graph > FiniteDual; Dual dual(pmesh); FiniteDual finite_dual(dual,internal::No_border(pmesh,ecmap)); - return boost::connected_components(finite_dual, fim); + return boost::connected_components(finite_dual, fcm); } - + +template +typename boost::graph_traits::faces_size_type +connected_components(PolygonMesh& pmesh, + FaceComponentMap& fcm, + const cgal_bgl_named_params& params) +{ + using boost::choose_param; + using boost::choose_const_pmap; + using boost::get_param; + + return connected_components(pmesh, + fcm, + choose_param(get_param(params,edge_is_constrained),internal::No_constraint(pmesh)), + choose_const_pmap(get_param(params,boost::face_index),pmesh,boost::face_index) + ); +} + + + /*! * \ingroup PkgPolygonMeshProcessing * 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. * \tparam PolygonMesh a model of `FaceGraph` - * \tparam FaceComponentIndexMap the property map with the face index as value type, and the index of its connected component + * \tparam FaceComponentMap the property map with the face index as value type, and the index of its connected component * \returns the number of connected components. */ -template +template typename boost::graph_traits::faces_size_type connected_components(PolygonMesh& pmesh, - FaceComponentIndexMap& fim) + FaceComponentMap& fcm) { - typedef Dual Dual; - typedef boost::filtered_graph > FiniteDual; - - Dual dual(pmesh); - FiniteDual finite_dual(dual,internal::No_border(pmesh)); - return boost::connected_components(finite_dual, fim); + return connected_components(pmesh, + fcm, + internal::No_constraint(pmesh), + get(boost::face_index,pmesh)); } + + + /*! * \ingroup PkgPolygonMeshProcessing * Erases the small connected components and the isolated vertices. * Keep `nb_components_to_keep` largest connected components. * \return the number of connected components erased (ignoring isolated vertices). - * \todo BGLize me */ -template -std::size_t keep_largest_connected_components(PolygonMesh& pmesh, std::size_t nb_components_to_keep) +template +std::size_t keep_largest_connected_components(PolygonMesh& pmesh, + std::size_t nb_components_to_keep, + EdgeConstraintMap ecmap, + VertexIndexMap vim, + FaceIndexMap fim) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::vertex_iterator vertex_iterator; typedef typename boost::graph_traits::face_descriptor face_descriptor; + typedef typename boost::graph_traits::face_iterator face_iterator; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; - boost::vector_property_map::type> face_cc(get(boost::face_index,pmesh)); + typedef typename boost::graph_traits::edge_iterator edge_iterator; + boost::vector_property_map::type> face_cc(fim); - int num = connected_components(pmesh,face_cc); + int num = connected_components(pmesh, + face_cc, + ecmap, + fim); if((num == 1)|| (nb_components_to_keep > num) ){ return 0; } - boost::vector_property_map::type> keep_vertex(get(boost::vertex_index,pmesh)); + boost::vector_property_map::type> keep_vertex(vim); BOOST_FOREACH(vertex_descriptor v, vertices(pmesh)){ keep_vertex[v] = false; } @@ -540,9 +571,13 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, std::size_t nb BOOST_FOREACH(face_descriptor f, faces(pmesh)){ component_size[face_cc[f]].second++; } + +#ifdef CGAL_CC_DEBUG for(int i=0; i < component_size.size(); ++i){ std::cerr << "component " << i << " has " << component_size[i].second << " faces\n"; } +#endif + // we have to sort the range [0, num) by component size internal::MoreSecond ls; std::sort(component_size.begin(), component_size.end(), ls); @@ -551,14 +586,20 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, std::size_t nb } internal::LessFirst lsinv; std::sort(component_size.begin(), component_size.end(), lsinv); + +#ifdef CGAL_CC_DEBUG for(std::size_t i=0; i < num; i++){ std::cout << i << " " << component_size[i].first << " " << component_size[i].second << std::endl; } +#endif + BOOST_FOREACH(face_descriptor f, faces(pmesh)){ face_cc[f] = component_size[face_cc[f]].second; +#ifdef CGAL_CC_DEBUG if(face_cc[f] == 1){ std::cerr << "keep " << f << std::endl; } +#endif } // Now face_cc[f] == 1 means that we want to keep the face @@ -567,11 +608,17 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, std::size_t nb BOOST_FOREACH(halfedge_descriptor h, halfedges_around_face(halfedge(f,pmesh),pmesh)){ vertex_descriptor v = target(h,pmesh); keep_vertex[v] = true; +#ifdef CGAL_CC_DEBUG std::cout << "keep vertex "<< v << std::endl; +#endif } } } - BOOST_FOREACH(edge_descriptor e, edges(pmesh)){ + + edge_iterator eb, ee; + for(boost::tie(eb,ee)= edges(pmesh);eb!= ee;){ + edge_descriptor e = *eb; + ++eb; vertex_descriptor v = source(e,pmesh); vertex_descriptor w = target(e,pmesh); halfedge_descriptor h = halfedge(e,pmesh); @@ -580,10 +627,13 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, std::size_t nb // don't care about connectivity // As vertices are not kept the faces and vertices will be removed later remove_edge(e,pmesh); + std::cerr << "after remove_edge"<< std::endl; } else if( keep_vertex[v] && keep_vertex[w]){ face_descriptor fh = face(h,pmesh), ofh = face(oh,pmesh); if(is_border(h,pmesh) && is_border(oh,pmesh)){ +#ifdef CGAL_CC_DEBUG std::cerr << "null_face on both sides of " << e << " is kept\n"; +#endif } else if( (face_cc[fh] && is_border(oh,pmesh)) || (face_cc[ofh] && is_border(h,pmesh)) || (face_cc[fh] && face_cc[ofh]) ){ @@ -622,21 +672,56 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, std::size_t nb remove_edge(e,pmesh); } } + + face_iterator fb, fe; // We now can remove all vertices and faces not marked as kept - BOOST_FOREACH(face_descriptor f, faces(pmesh)){ + for(boost::tie(fb,fe)=faces(pmesh); fb!=fe;){ + face_descriptor f = *fb; + ++fb; if(face_cc[f] != 1){ remove_face(f,pmesh); } } - BOOST_FOREACH(vertex_descriptor v, vertices(pmesh)){ + vertex_iterator b,e; + for(boost::tie(b,e)=vertices(pmesh); b!=e;){ + vertex_descriptor v = *b; + ++b; if(! keep_vertex[v]){ remove_vertex(v,pmesh); } } - return num - nb_components_to_keep; } +template +std::size_t keep_largest_connected_components(PolygonMesh& pmesh, + std::size_t nb_components_to_keep, + const cgal_bgl_named_params& params) +{ + + using boost::choose_param; + using boost::choose_const_pmap; + using boost::get_param; + + return keep_largest_connected_component(pmesh, + nb_components_to_keep, + choose_param(get_param(params,edge_is_constrained),internal::No_constraint(pmesh)), + choose_const_pmap(get_param(params,boost::vertex_index),pmesh,boost::vertex_index) + choose_const_pmap(get_param(params,boost::face_index),pmesh,boost::face_index) + ); +} + + +template +std::size_t keep_largest_connected_components(PolygonMesh& pmesh, + std::size_t nb_components_to_keep) +{ + return keep_largest_connected_components(pmesh, + nb_components_to_keep, + internal::No_constraint(pmesh), + get(boost::vertex_index, pmesh), + get(boost::face_index, pmesh)); +} } // namespace Polygon_mesh_processing diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp index e6881669c49..4e0fb1c3fdb 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp @@ -68,8 +68,8 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered() namespace SMS = CGAL::Surface_mesh_simplification; SMS::Count_stop_predicate< Polyhedron > stop(nb_edges); // target #edges SMS::edge_collapse( *pMesh, stop, - CGAL::vertex_index_map(get(CGAL::vertex_external_index,*pMesh)) - .halfedge_index_map(get(CGAL::halfedge_external_index,*pMesh))); + CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index,*pMesh)) + .halfedge_index_map(get(CGAL::halfedge_external_index,*pMesh))); std::cout << "ok (" << time.elapsed() << " ms, " << pMesh->size_of_halfedges() / 2 << " edges)" << std::endl; diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp index 095b5510430..45ba0fa1383 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp @@ -80,9 +80,9 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface_mesh ,stop - ,CGAL::halfedge_index_map (get(CGAL::halfedge_index ,surface_mesh)) - .vertex_point_map(get(boost::vertex_point, surface_mesh)) - .edge_is_constrained_map(constraints_map) + ,CGAL::parameters::halfedge_index_map (get(CGAL::halfedge_index ,surface_mesh)) + .vertex_point_map(get(boost::vertex_point, surface_mesh)) + .edge_is_constrained_map(constraints_map) ); surface_mesh.garbage_collection(); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp index e3f858934ad..042458af7c0 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp @@ -130,10 +130,10 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse(surface_mesh ,stop - ,CGAL::vertex_index_map(get(CGAL::vertex_external_index, surface_mesh)) - .halfedge_index_map(get(CGAL::halfedge_external_index, surface_mesh)) - .edge_is_constrained_map(constraints_map) - .get_placement(placement) + ,CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index, surface_mesh)) + .halfedge_index_map(get(CGAL::halfedge_external_index, surface_mesh)) + .edge_is_constrained_map(constraints_map) + .get_placement(placement) ); std::cout << "\nFinished...\n" << r << " edges removed.\n" @@ -170,10 +170,10 @@ int main( int argc, char** argv ) std::cout << "Check that no removable edge has been forgotten..." << std::endl; r = SMS::edge_collapse(surface_mesh ,stop - ,CGAL::vertex_index_map(get(CGAL::vertex_external_index, surface_mesh)) - .halfedge_index_map (get(CGAL::halfedge_external_index, surface_mesh)) - .edge_is_constrained_map(constraints_map) - .get_placement(placement) + ,CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index, surface_mesh)) + .halfedge_index_map (get(CGAL::halfedge_external_index, surface_mesh)) + .edge_is_constrained_map(constraints_map) + .get_placement(placement) ); assert(r==0); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp index 4cb9990cbc2..cfbf1adb3d9 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp @@ -96,10 +96,10 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface_mesh ,stop - ,CGAL::vertex_index_map(get(CGAL::vertex_external_index,surface_mesh)) - .halfedge_index_map (get(CGAL::halfedge_external_index ,surface_mesh)) - .edge_is_constrained_map(bem) - .get_placement(Placement(bem)) + ,CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index,surface_mesh)) + .halfedge_index_map (get(CGAL::halfedge_external_index ,surface_mesh)) + .edge_is_constrained_map(bem) + .get_placement(Placement(bem)) ); std::cout << "\nFinished...\n" << r << " edges removed.\n" diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp index 88d1881d788..d498c2d6ded 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp @@ -94,8 +94,8 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface_mesh ,stop - ,CGAL::edge_is_constrained_map(bem) - .get_placement(Placement(bem)) + ,CGAL::parameters::edge_is_constrained_map(bem) + .get_placement(Placement(bem)) ); std::cout << "\nFinished...\n" << r << " edges removed.\n" diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp index 1a0a648110b..7603fd0a8af 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp @@ -162,9 +162,9 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface_mesh ,stop - ,CGAL::get_cost (SMS::Edge_length_cost ()) - .get_placement(SMS::Midpoint_placement()) - .visitor (vis) + ,CGAL::parameters::get_cost (SMS::Edge_length_cost ()) + .get_placement(SMS::Midpoint_placement()) + .visitor (vis) ); std::cout << "\nEdges collected: " << stats.collected diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp index 60b275ec8c2..ca5fcd19317 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp @@ -38,10 +38,10 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface_mesh ,stop - ,CGAL::vertex_index_map(get(CGAL::vertex_external_index,surface_mesh)) - .halfedge_index_map (get(CGAL::halfedge_external_index ,surface_mesh)) - .get_cost (SMS::Edge_length_cost ()) - .get_placement(SMS::Midpoint_placement()) + ,CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index,surface_mesh)) + .halfedge_index_map (get(CGAL::halfedge_external_index ,surface_mesh)) + .get_cost (SMS::Edge_length_cost ()) + .get_placement(SMS::Midpoint_placement()) ); std::cout << "\nFinished...\n" << r << " edges removed.\n" diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index 4b3a6eaaf75..bcba14d50b0 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -136,9 +136,9 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface_mesh ,stop - ,CGAL::get_cost (SMS::Edge_length_cost ()) - .get_placement(SMS::Midpoint_placement()) - .visitor (vis) + ,CGAL::parameters::get_cost (SMS::Edge_length_cost ()) + .get_placement(SMS::Midpoint_placement()) + .visitor (vis) ); std::cout << "\nEdges collected: " << stats.collected diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp index 017b1bd86e8..e6c6d3d18ac 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp @@ -44,8 +44,8 @@ int main( int argc, char** argv ) int r = SMS::edge_collapse (surface ,stop - ,CGAL::vertex_index_map(get(CGAL::vertex_external_index,surface)) - .halfedge_index_map (get(CGAL::halfedge_external_index ,surface)) + ,CGAL::parameters::vertex_index_map(get(CGAL::vertex_external_index,surface)) + .halfedge_index_map (get(CGAL::halfedge_external_index ,surface)) ); std::cout << "\nFinished...\n" << r << " edges removed.\n" diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index bd5edb1baf2..a599ea403cf 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -392,14 +392,14 @@ bool Test ( string aName ) SMS::Edge_length_cost cost ; SMS::Midpoint_placement placement ; - edge_collapse(lSurface,stop,get_cost(cost).get_placement(placement).visitor(vis) ); + edge_collapse(lSurface,stop,CGAL::parameters::get_cost(cost).get_placement(placement).visitor(vis) ); } else { SMS::LindstromTurk_cost cost ; SMS::LindstromTurk_placement placement ; - edge_collapse(lSurface,stop,get_cost(cost).get_placement(placement).visitor(vis) ); + edge_collapse(lSurface,stop,CGAL::parameters::get_cost(cost).get_placement(placement).visitor(vis) ); } t.stop();