diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp index 43cd310ad40..2b5d8aa72bb 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp @@ -10,6 +10,7 @@ #include #include +#include #include @@ -17,6 +18,7 @@ #include namespace SMP = CGAL::Surface_mesh_parameterization; +namespace PMP = CGAL::Polygon_mesh_processing; typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_2 Point_2; @@ -94,7 +96,7 @@ int main(int, char**) return EXIT_FAILURE; } - PM_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first; + PM_halfedge_descriptor hd = PMP::longest_border(pm).first; CGAL::Unique_hash_map > uvhm; @@ -113,7 +115,7 @@ int main(int, char**) std::cout << "Parameterized with MVC (POLY)!" << std::endl; } } -#endif +#endif // MVC_POLYHEDRON_MESH // *************************************************************************** // ARAP WITH POLYHEDRON_MESH @@ -131,7 +133,7 @@ int main(int, char**) return EXIT_FAILURE; } - PM_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(pm).first; + PM_halfedge_descriptor hd = PMP::longest_border(pm).first; // UV map CGAL::Unique_hash_map Indices; Indices indices; - CGAL::Polygon_mesh_processing::connected_component( - face(opposite(hd, pm), pm), - pm, - boost::make_function_output_iterator( - SMP::internal::Index_map_filler(pm, indices))); + PMP::connected_component(face(opposite(hd, pm), pm), pm, + boost::make_function_output_iterator( + SMP::internal::Index_map_filler(pm, indices))); boost::associative_property_map vipm(indices); @@ -158,8 +158,8 @@ int main(int, char**) // Parameterizer SMP::ARAP_parameterizer_3 parameterizer; SMP::Error_code status = parameterizer.parameterize(pm, hd, uvpm, vipm, vpm); - - if(status != SMP::OK) { + SMP::Error_code status_bis = SMP::parameterize(pm, parameterizer, hd, uvpm); + if(status != SMP::OK || status_bis != SMP::OK) { std::cout << "Encountered a problem: " << status << std::endl; return EXIT_FAILURE; } @@ -167,7 +167,7 @@ int main(int, char**) std::cout << "Parameterized with ARAP (POLY)!" << std::endl; } } -#endif +#endif // ARAP_POLYHEDRON_MESH // *************************************************************************** // Barycentric mapping @@ -185,7 +185,7 @@ int main(int, char**) return EXIT_FAILURE; } - SM_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(sm).first; + SM_halfedge_descriptor hd = PMP::longest_border(sm).first; assert(hd != SM_halfedge_descriptor()); // UV map @@ -195,11 +195,9 @@ int main(int, char**) // Indices map typedef boost::unordered_map Indices; Indices indices; - CGAL::Polygon_mesh_processing::connected_component( - face(opposite(hd, sm), sm), - sm, - boost::make_function_output_iterator( - SMP::internal::Index_map_filler(sm, indices))); + PMP::connected_component(face(opposite(hd, sm), sm), sm, + boost::make_function_output_iterator( + SMP::internal::Index_map_filler(sm, indices))); boost::associative_property_map vipm(indices); // Vertex parameterized map @@ -210,8 +208,9 @@ int main(int, char**) SMP::Barycentric_mapping_parameterizer_3 parameterizer; SMP::Error_code status = parameterizer.parameterize(sm, hd, uvpm, vipm, vpm); + SMP::Error_code status_bis = SMP::parameterize(sm, parameterizer, hd, uvpm); - if(status != SMP::OK) { + if(status != SMP::OK || status_bis != SMP::OK) { std::cout << "Encountered a problem: " << status << std::endl; return EXIT_FAILURE; } @@ -219,7 +218,7 @@ int main(int, char**) std::cout << "Parameterized with Barycentric (SM)!" << std::endl; } } -#endif +#endif // BARY_SURF_MESH // *************************************************************************** // ARAP WITH SURF_MESH @@ -238,8 +237,7 @@ int main(int, char**) } // halfedge on the longest border - SM_halfedge_descriptor hd = - CGAL::Polygon_mesh_processing::longest_border(sm).first; + SM_halfedge_descriptor hd = PMP::longest_border(sm).first; CGAL::Unique_hash_map > uvhm; @@ -251,11 +249,9 @@ int main(int, char**) // Indices map typedef boost::unordered_map Indices; Indices indices; - CGAL::Polygon_mesh_processing::connected_component( - face(opposite(hd, sm), sm), - sm, - boost::make_function_output_iterator( - SMP::internal::Index_map_filler(sm, indices))); + PMP::connected_component(face(opposite(hd, sm), sm), sm, + boost::make_function_output_iterator( + SMP::internal::Index_map_filler(sm, indices))); boost::associative_property_map vipm(indices); // Parameterized bool pmap @@ -266,7 +262,9 @@ int main(int, char**) SMP::ARAP_parameterizer_3 parameterizer; SMP::Error_code status = parameterizer.parameterize(sm, hd, uv_pm, vipm, vpm); - if(status != SMP::OK) { + SMP::Error_code status_bis = SMP::parameterize(sm, parameterizer, hd, uv_pm); + + if(status != SMP::OK || status_bis != SMP::OK) { std::cout << "Encountered a problem: " << status << std::endl; return EXIT_FAILURE; } @@ -274,7 +272,7 @@ int main(int, char**) std::cout << "Parameterized with ARAP (SM)!" << std::endl; } } -#endif +#endif // ARAP_SURF_MESH #ifdef DCM_PM_SEAM_MESH { @@ -307,16 +305,14 @@ int main(int, char**) PM_UV_pmap uv_pm(uv_hm); // a halfedge on the (possibly virtual) border - PM_SE_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(mesh).first; + PM_SE_halfedge_descriptor hd = PMP::longest_border(mesh).first; // Indices typedef boost::unordered_map Indices; Indices indices; - CGAL::Polygon_mesh_processing::connected_component( - face(opposite(hd, mesh), mesh), - mesh, - boost::make_function_output_iterator( - SMP::internal::Index_map_filler(mesh, indices))); + PMP::connected_component(face(opposite(hd, mesh), mesh), mesh, + boost::make_function_output_iterator( + SMP::internal::Index_map_filler(mesh, indices))); boost::associative_property_map vipm(indices); // Parameterized @@ -326,8 +322,9 @@ int main(int, char**) SMP::Discrete_conformal_map_parameterizer_3 parameterizer; SMP::Error_code status = parameterizer.parameterize(mesh, hd, uv_pm, vipm, vpm); + SMP::Error_code status_bis = SMP::parameterize(mesh, parameterizer, hd, uv_pm); - if(status != SMP::OK) { + if(status != SMP::OK || status_bis != SMP::OK) { std::cout << "Encountered a problem: " << status << std::endl; return EXIT_FAILURE; } @@ -335,7 +332,7 @@ int main(int, char**) std::cout << "Parameterized with DCM (SEAM POLY)!" << std::endl; } } -#endif +#endif // DCM_PM_SEAM_MESH // *************************************************************************** // DAC WITH SEAM_MESH (SM) @@ -373,16 +370,14 @@ int main(int, char**) Point_2>("h:uv").first; // a halfedge on the (possibly virtual) border - SM_SE_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(mesh).first; + SM_SE_halfedge_descriptor hd = PMP::longest_border(mesh).first; // Indices typedef boost::unordered_map Indices; Indices indices; - CGAL::Polygon_mesh_processing::connected_component( - face(opposite(hd, mesh), mesh), - mesh, - boost::make_function_output_iterator( - SMP::internal::Index_map_filler(mesh, indices))); + PMP::connected_component(face(opposite(hd, mesh), mesh), mesh, + boost::make_function_output_iterator( + SMP::internal::Index_map_filler(mesh, indices))); boost::associative_property_map vipm(indices); // Parameterized @@ -392,7 +387,9 @@ int main(int, char**) SMP::Discrete_authalic_parameterizer_3 parameterizer; SMP::Error_code status = parameterizer.parameterize(mesh, hd, uv_pm, vipm, vpm); - if(status != SMP::OK) { + SMP::Error_code status_bis = SMP::parameterize(mesh, parameterizer, hd, uv_pm); + + if(status != SMP::OK || status_bis != SMP::OK) { std::cout << "Encountered a problem: " << status << std::endl; return EXIT_FAILURE; } @@ -400,7 +397,7 @@ int main(int, char**) std::cout << "Parameterized with DAC (SEAM SM)!" << std::endl; } } -#endif +#endif // DAC_SM_SEAM_MESH #ifdef ORBIFOLD_SM_MESH { @@ -464,10 +461,10 @@ int main(int, char**) // a halfedge on the (possibly virtual) border // only used in output (will also be used to handle multiple connected components in the future) - SM_SE_halfedge_descriptor hd = CGAL::Polygon_mesh_processing::longest_border(mesh, - CGAL::Polygon_mesh_processing::parameters::all_default()).first; + SM_SE_halfedge_descriptor hd = PMP::longest_border(mesh, PMP::parameters::all_default()).first; SMP::Error_code status = parameterizer.parameterize(mesh, hd, cmap, uvmap, vimap); + if(status != SMP::OK) { std::cout << "Encountered a problem: " << status << std::endl; return EXIT_FAILURE; @@ -476,7 +473,7 @@ int main(int, char**) std::cout << "Parameterized with Orbifold (SEAM SM)!" << std::endl; } } -#endif +#endif // ORBIFOLD_SM_MESH std::cout << "Done!" << std::endl;