diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp index a137e7fb090..3fd6129d1a1 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp @@ -54,7 +54,7 @@ int main(int argc, char * argv[]) // Two property maps to store the seam edges and vertices Seam_edge_pmap seam_edge_pm = sm.add_property_map("e:on_seam", false).first; - Seam_vertex_pmap seam_vertex_pm = sm.add_property_map("v:on_seam",false).first; + Seam_vertex_pmap seam_vertex_pm = sm.add_property_map("v:on_seam", false).first; const char* filename = (argc>2) ? argv[2] : "data/lion.selection.txt"; diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbital.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbital.cpp index 3f70825a292..a0b5b41111d 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbital.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbital.cpp @@ -148,7 +148,7 @@ int main(int argc, char * argv[]) SurfaceMesh sm; // underlying mesh of the seam mesh - const char* mesh_filename = (argc>1) ? argv[1] : "../data/bunny.off"; + const char* mesh_filename = (argc>1) ? argv[1] : "../data/bear.off"; std::ifstream in_mesh(mesh_filename); if(!in_mesh) { std::cerr << "Error: problem loading the input data" << std::endl; @@ -160,7 +160,7 @@ int main(int argc, char * argv[]) // -- the first line for the cones indices // -- the second line must be empty // -- the third line optionally provides the seam edges indices as 'e11 e12 e21 e22 e31 e32' etc. - const char* cone_filename = (argc>2) ? argv[2] : "../data/bunny.selection.txt"; + const char* cone_filename = (argc>2) ? argv[2] : "../data/bear.selection.txt"; // Read the cones and find the corresponding vertex_descriptor in the underlying mesh 'sm' std::vector cone_vds_in_sm(3); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 1f8a83e9a62..03fc0bcf5a0 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -61,14 +60,8 @@ // @todo Handle the case cot = 0 with a local parameterization aligned with the axes // (this produces C2=0 which is problematic to compute a & b) -// @todo test ARAP + SEAM // @todo Add distortion measures // @todo non-simple border in MVC_post_processor -// @todo clean OpenNL from LSCM -// @todo Fix PMP::border_halfedges() (add a "!") - -// @todo look up the matlab code - // @todo Parallelize the local phase? namespace CGAL { @@ -1091,8 +1084,7 @@ private: // Solve "A*Xv = Bv". On success, the solution is (1/Dv) * Xv. NT Du, Dv; if(!get_linear_algebra_traits().linear_solver(A, Bu, Xu, Du) || - !get_linear_algebra_traits().linear_solver(A, Bv, Xv, Dv)) - { + !get_linear_algebra_traits().linear_solver(A, Bv, Xv, Dv)) { std::cout << "Could not solve linear system" << std::endl; status = ERROR_CANNOT_SOLVE_LINEAR_SYSTEM; return status; @@ -1227,19 +1219,6 @@ private: return OK; } - /// Compute the quality of the parameterization. - void compute_quality(const TriangleMesh& mesh, - const Faces_vector& faces) const - { - - BOOST_FOREACH(face_descriptor fd, faces) { - // compute the jacobian - - // compute the singular values - } - - } - // Public operations public: /// Check if the 3D -> 2D mapping is one-to-one. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/IO/File_off.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/IO/File_off.h index edba0c3e119..714eef0618e 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/IO/File_off.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/IO/File_off.h @@ -73,7 +73,7 @@ void output_uvmap_to_off(const TriangleMesh& mesh, vertex_descriptor vd = *vit; os << get(uvmap, vd) << " 0" << '\n'; - // the vertices in 'vertices' are not in the same order as in vimap + // in case the vertices in 'vertices' are not in the same order as in vimap renumbering_vector[get(vimap, vd)] = counter++; } @@ -92,10 +92,9 @@ void output_uvmap_to_off(const TriangleMesh& mesh, } template void output_uvmap_to_off(const TriangleMesh& mesh, - HD bhd, + typename boost::graph_traits::halfedge_descriptor bhd, const VertexUVMap uvmap, std::ostream& os) { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h index 02bf42411ae..dae619af855 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h @@ -31,7 +31,6 @@ #include #include -#include #ifdef CGAL_EIGEN3_ENABLED #include diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbital_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbital_Tutte_parameterizer_3.h index f4205948510..b13b18ac944 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbital_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbital_Tutte_parameterizer_3.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -132,8 +133,8 @@ public: { std::cout << "Constraining " << ind << std::endl; - A.set_coef(2*ind, 2*ind, w, true /*new_coeff*/); - A.set_coef(2*ind + 1, 2*ind + 1, w, true /*new_coeff*/); + A.set_coef(2*ind, 2*ind, w, true /*new_coef*/); + A.set_coef(2*ind + 1, 2*ind + 1, w, true /*new_coef*/); B[2*ind] = rhs[0]; B[2*ind + 1] = rhs[1]; @@ -158,8 +159,8 @@ public: // // obj.A(end+1, 2*sinds(ind)+[-1,0]) = T(vert_ind,:); - A.set_coef(2*s + vert_ind, 2*s, T(vert_ind, 0), true /*new_coeff*/); - A.set_coef(2*s + vert_ind, 2*s + 1, T(vert_ind, 1), true /*new_coeff*/); + A.set_coef(2*s + vert_ind, 2*s, T(vert_ind, 0), true /*new_coef*/); + A.set_coef(2*s + vert_ind, 2*s + 1, T(vert_ind, 1), true /*new_coef*/); // - // obj.A(end, 2*sinds(1)+[-1,0]) = obj.A(end, 2*sinds(1)+[-1,0]) - T(vert_ind,:); @@ -367,7 +368,7 @@ public: const VertexIndexMap vimap) const { std::cout << "size of X: " << X.size() << std::endl; - CGAL_assertion(X.size() == 2*num_vertices(mesh) ); + CGAL_assertion(X.size() == 2 * num_vertices(mesh) ); BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)) { int index = get(vimap, vd); @@ -411,7 +412,7 @@ public: for(int k=0; k::InnerIterator it(L.eigen_object(), k); it; ++it) { - M.set_coef(it.row(), it.col(), it.value(), true /*new_coeff*/); + M.set_coef(it.row(), it.col(), it.value(), true /*new_coef*/); // std::cout << it.row() << " " << it.col() << " " << it.value() << '\n'; } } @@ -421,8 +422,8 @@ public: for(int k=0; k::InnerIterator it(A.eigen_object(), k); it; ++it) { - M.set_coef(it.col(), it.row() + n, it.value(), true /*new_coeff*/); // A - M.set_coef(it.row() + n, it.col(), it.value(), true /*new_coeff*/); // A' + M.set_coef(it.col(), it.row() + n, it.value(), true /*new_coef*/); // A + M.set_coef(it.row() + n, it.col(), it.value(), true /*new_coef*/); // A' // std::cout << it.row() << " " << it.col() << " " << it.value() << '\n'; } } @@ -518,7 +519,7 @@ public: // Energy (Laplacian) // %%%%%%%%%%%%%%%%%%%% - Matrix L(2*nbVertices, 2*nbVertices); + Matrix L(2 * nbVertices, 2 * nbVertices); mean_value_laplacian(mesh, vimap, L); #ifdef CGAL_SMP_OUTPUT_ORBITAL_MATRICES