diff --git a/Surface_mesh_parameterization/include/CGAL/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/ARAP_parameterizer_3.h index 71ac15548e5..80b2c1c3e50 100644 --- a/Surface_mesh_parameterization/include/CGAL/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/ARAP_parameterizer_3.h @@ -256,6 +256,23 @@ private: uvmap, vimap, out); } + /// Copy the data from two vectors to the UVmap. + template + void assign_solution(const Vector& Xu, + const Vector& Xv, + const Vertex_set& vertices, + VertexUVMap uvmap, + const VertexIndexMap vimap) + { + BOOST_FOREACH(vertex_descriptor vd, vertices){ + int index = get(vimap, vd); + NT u = Xu(index); + NT v = Xv(index); + put(uvmap, vd, Point_2(u, v)); + } + } + // Private operations private: /// Store the vertices and faces of the mesh in memory. @@ -1073,15 +1090,13 @@ private: BOOST_FOREACH(vertex_descriptor vd, vertices){ if(get(vpmap, vd)){ int index = get(vimap, vd); - std::cout << "at: " << index << " " - << Xu[index] << " " << Xv[index] << std::endl; CGAL_postcondition(std::abs(Xu[index] - Bu[index] ) < 1e-10); CGAL_postcondition(std::abs(Xv[index] - Bv[index] ) < 1e-10); } } ) - assign_solution(Xu, Xv, vertices, uvmap, vimap); + assign_solution(Xu, Xv, vertices, uvmap, vimap); return status; } diff --git a/Surface_mesh_parameterization/include/CGAL/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/MVC_post_processor_3.h index 3ac58284da0..c98e66b46cc 100644 --- a/Surface_mesh_parameterization/include/CGAL/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/MVC_post_processor_3.h @@ -47,36 +47,6 @@ namespace CGAL { -/// Copy the data from two vectors to the UVmap. -template -void assign_solution(const Vector& Xu, - const Vector& Xv, - const Vertex_set& vertices, - VertexUVMap uvmap, - VertexIndexMap vimap) -{ - typedef Parameterizer_traits_3 Traits; - typedef typename Traits::NT NT; - typedef typename Traits::Point_2 Point_2; - - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - - BOOST_FOREACH(vertex_descriptor vd, vertices){ - int index = get(vimap, vd); - NT u = Xu(index); - NT v = Xv(index); - -// Point_2 p = get(uvmap, vd); -// std::cout << "old: " << p << " || new: " << u << " " << v << std::endl; - - put(uvmap, vd, Point_2(u, v)); - } -} - // ------------------------------------------------------------------------------------ // Declaration // ------------------------------------------------------------------------------------ @@ -195,6 +165,23 @@ private: out << std::endl; } + /// Copy the data from two vectors to the UVmap. + template + void assign_solution(const Vector& Xu, + const Vector& Xv, + const Vertex_set& vertices, + VertexUVMap uvmap, + const VertexIndexMap vimap) + { + BOOST_FOREACH(vertex_descriptor vd, vertices){ + int index = get(vimap, vd); + NT u = Xu(index); + NT v = Xv(index); + put(uvmap, vd, Point_2(u, v)); + } + } + // Private operations private: /// Store the vertices and faces of the mesh in memory. @@ -737,7 +724,7 @@ private: status = solve_mvc(A, Bu, Bv, Xu, Xv); // Assign the UV values - assign_solution(Xu, Xv, vertices, uvmap, vimap); + assign_solution(Xu, Xv, vertices, uvmap, vimap); return Base::OK; }