diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index 7b167f00141..a6676f5e8fd 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -885,24 +885,22 @@ public: { std::pair tmed = CGAL::edge(tmvd_s, tmvd_t, tm); if(!tmed.second) { - std::cout << "was ignored because it is not a valid edge of the mesh (Warning!)" << std::endl; + std::cerr << "Warning: Ignored a constraint because it is not a valid edge of the mesh" << std::endl; return false; } if(!is_border(tmed.first, tm)) { // ignore seams that are also a border edge if(get(sem, tmed.first) == true) { - std::cout << "was ignored because it is already marked as a seam (Warning!)" << std::endl; + std::cerr << "Warning: Ignored a constraint because it is already marked as a seam" << std::endl; return false; } - std::cout << "was added to the seam mesh" << std::endl; - put(sem, tmed.first, true); put(svm, tmvd_s, true); put(svm, tmvd_t, true); ++number_of_seams; } else { - std::cout << "was ignored because it is on the border of the mesh (Warning!)" << std::endl; + std::cerr << "Warning: Ignored a constraint because it is on the border of the mesh" << std::endl; return false; } @@ -960,7 +958,6 @@ public: assert(s < tmvds.size() && t < tmvds.size()); TM_vertex_descriptor tmvd_s = tmvds[s], tmvd_t = tmvds[t]; - std::cout << "Seam " << s << " " << t << " "; if(!add_seam(tmvd_s, tmvd_t)) continue; diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp index 929c78be76a..24ae85c1e28 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp @@ -90,7 +90,6 @@ int main(int argc, char * argv[]) // Add the seams to the seam mesh BOOST_FOREACH(SM_edge_descriptor e, seam_edges) { - std::cout << "Seam " << source(e, sm) << " " << target(e, sm) << " "; mesh.add_seam(source(e, sm), target(e, sm)); } } diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold_mapping.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold_mapping.cpp index 7ec62be4633..055a6bf0005 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold_mapping.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold_mapping.cpp @@ -118,7 +118,6 @@ int main(int argc, char * argv[]) // Add the seams to the seam mesh BOOST_FOREACH(SM_edge_descriptor e, seam_edges_A) { - std::cout << "Seam " << source(e, sm_A) << " " << target(e, sm_A) << " "; mesh_A.add_seam(source(e, sm_A), target(e, sm_A)); } } @@ -188,7 +187,6 @@ int main(int argc, char * argv[]) // Add the seams to the seam mesh BOOST_FOREACH(SM_edge_descriptor e, seam_edges_B) { - std::cout << "Seam " << source(e, sm_B) << " " << target(e, sm_B) << " "; mesh_B.add_seam(source(e, sm_B), target(e, sm_B)); } } 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 988c0dd0c13..c3fb79e2708 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 @@ -263,7 +263,6 @@ private: face(opposite(bhd, mesh), mesh), mesh, boost::make_function_output_iterator(fc)); - std::cout << vertices.size() << " vertices & " << faces.size() << " faces" << std::endl; if (vertices.empty() || faces.empty()) return ERROR_EMPTY_MESH; @@ -304,7 +303,6 @@ private: status = lscm_parameterizer.parameterize(mesh, bhd, uvmap, vimap, vpmap); } - std::cout << "Computed initial parameterization" << std::endl; return status; } @@ -454,7 +452,6 @@ private: return ERROR_NON_TRIANGULAR_MESH; // Set w_ii in matrix -// std::cout << "setting wii at " << i << " : " << w_ii << std::endl; A.set_coef(i, i, w_ii, true /*new*/); return OK; } @@ -482,7 +479,6 @@ private: return status; } else { // fixed vertices int index = get(vimap, vd); - std::cout << index << " is fixed in A " << std::endl; A.set_coef(index, index, 1, true /*new*/); ++count; } @@ -506,9 +502,6 @@ private: if(root_n > 2) roots.push_back(r3); -// std::cout << "coeffs: " << a3 << " " << a2 << " " << a1 << " " << a0 << std::endl; -// std::cout << root_n << " roots: " << r1 << " " << r2 << " " << r3 << std::endl; - return roots.size(); } @@ -551,7 +544,6 @@ private: for(std::size_t i=0; i > roots; solve_2(pol1, pol2, std::back_inserter(roots)); - std::cout << "solved with " << roots.size() << " roots." << std::endl; for(std::size_t i=0; i::const_type PPmap; - const PPmap ppmap = get(vertex_point, mesh); - - std::cout << "Point_3: " << get(ppmap, source(hd, mesh)) << " || " - << get(ppmap, target(hd, mesh)) << std::endl; - - std::cout << "ADD1: " << c * ( p_diff_x*p_diff_x + p_diff_y*p_diff_y ) << std::endl; - std::cout << "ADD2: " << c * ( diff_x*p_diff_x + diff_y*p_diff_y ) << std::endl; - std::cout << "ADD3: " << c * ( diff_x*p_diff_y - diff_y*p_diff_x ) << std::endl; - C1 += c * ( p_diff_x*p_diff_x + p_diff_y*p_diff_y ); C2 += c * ( diff_x*p_diff_x + diff_y*p_diff_y ); C3 += c * ( diff_x*p_diff_y - diff_y*p_diff_x ); } -// std::cout << "C1: " << C1 << " , C2: " << C2 << " , C3: " << C3 << std::endl; - // Compute a and b NT a = 0., b = 0.; @@ -791,8 +758,6 @@ private: a = a_roots[ind]; b = b_roots[ind]; #endif - -// std::cout << "ab: " << a << " " << b << std::endl; } // Update the map faces --> optimal Lt matrices @@ -959,10 +924,6 @@ private: // cot_l * Lt_l * (xi - xj)_l x += ct_l * ( a_l * diff_l_x + b_l * diff_l_y ); y += ct_l * ( -b_l * diff_l_x + a_l * diff_l_y ); - - std::cout << "akbk: " << a_k << " " << b_k << std::endl; - std::cout << "albl: " << a_l << " " << b_l << std::endl; - std::cout << "xy: " << x << " " << y << std::endl; } /// Compute the line i of right hand side vectors Bu and Bv @@ -1044,8 +1005,6 @@ private: Bu.set(index, uv.x()); Bv.set(index, uv.y()); ++count; - std::cout << index << " is fixed in B: "; - std::cout << uv.x() << " " << uv.y() << std::endl; } } return status; @@ -1079,14 +1038,12 @@ private: if (status != OK) return status; - std::cout << "A, B: " << std::endl << A.eigen_object() << std::endl << Bu << std::endl << Bv << std::endl; - // Solve "A*Xu = Bu". On success, the solution is (1/Du) * Xu. // 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)) { - std::cout << "Could not solve linear system" << std::endl; + std::cerr << "Could not solve linear system" << std::endl; status = ERROR_CANNOT_SOLVE_LINEAR_SYSTEM; return status; } @@ -1305,8 +1262,6 @@ public: if(status != OK) return status; - std::cout << "All data structures initialized" << std::endl; - // The matrix A is constant and can be initialized outside of the loop int nbVertices = static_cast(vertices.size()); Matrix A(nbVertices, nbVertices); // the constant matrix using in the linear system A*X = B @@ -1318,6 +1273,7 @@ public: ltmap, uvmap); NT energy_last; std::cout << "Initial energy: " << energy_this << std::endl; + std::cout << m_iterations << " max iterations" << std::endl; // main loop for(unsigned int ite=1; ite<=m_iterations; ++ite) @@ -1354,7 +1310,7 @@ public: if(!is_one_to_one_mapping(mesh, faces, uvmap)) { // Use post processing to handle flipped elements - std::cout << "Parameterization is not valid; calling post processor" << std::endl; + std::cerr << "Parameterization is not valid; calling post processor" << std::endl; status = post_process(mesh, vertices, faces, bhd, uvmap, vimap); } diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index 6638839633c..397c1ad5f75 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -186,7 +186,6 @@ private: face(opposite(bhd, mesh), mesh), mesh, boost::make_function_output_iterator(fc)); - std::cout << vertices.size() << " vertices & " << faces.size() << " faces" << std::endl; } /// Checks whether the polygon's border is simple. @@ -274,7 +273,6 @@ private: typename CT::Vertex_handle vh = ct.insert(sp); vh->info() = s; -// std::cout << "Added point: " << sp << '\n'; } // Insert constraints (the border) @@ -283,7 +281,6 @@ private: Point_2 sp = get(uvmap, s), tp = get(uvmap, t); ct.insert_constraint(sp, tp); -// std::cout << "Constrained edge: " << sp << " " << tp << std::endl; } std::ofstream out("constrained_triangulation.cgal"); @@ -450,7 +447,6 @@ private: // if vh_i is fixed, there is nothing to do: A(i,i)=1 and A(i,j)=0 for j!=i if(get(vpmap, vd_i)) { -// std::cout << i << " is fixed in A " << std::endl; // @fixme unefficient: A(i,i) is written as many times as i has neighbors A.set_coef(i, i, 1); return; @@ -511,7 +507,6 @@ private: // if vh_i is fixed, there is nothing to do: A(i,i)=1 and A(i,j)=0 for j!=i if(get(vpmap, vd_i)) { -// std::cout << i << " is fixed in A " << std::endl; // @fixme unefficient A(i,i) is written as many times as i has neighbors A.set_coef(i, i, 1); return; @@ -566,7 +561,6 @@ private: // but not in 'ct'. // Loop over the "outside" faces of ct -// std::cout << "add from ct" << std::endl; typename CT::Finite_faces_iterator fit = ct.finite_faces_begin(), fend = ct.finite_faces_end(); for(; fit!=fend; ++fit) @@ -578,7 +572,6 @@ private: } // Loop over the faces of 'mesh' -// std::cout << "add from mesh" << std::endl; BOOST_FOREACH(face_descriptor fd, faces) { fill_linear_system_matrix_mvc_from_mesh_face(mesh, fd, uvmap, vimap, vpmap, A); } @@ -709,7 +702,7 @@ public: // Not sure how to handle non-simple yet @fixme if(!is_param_border_simple) { - std::cout << "Border is not simple!" << std::endl; + std::cerr << "Border is not simple!" << std::endl; return ERROR_NON_CONVEX_BORDER; } @@ -726,7 +719,7 @@ public: // Run the MVC parameterize_convex_hull_with_MVC(mesh, vertices, faces, ct, uvmap, vimap, vpmap); - std::cout << "End of post processing: Ok" << std::endl; + std::cout << "End of post processing" << std::endl; return OK; } diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 1b27bd5af1e..8868d4f6be7 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -130,13 +130,6 @@ private: return ERROR_WRONG_PARAMETER; } - std::cout << "cones and ids" << std::endl; - typename ConeMap::const_iterator cit = cmap.begin(), cend = cmap.end(); - for(; cit!=cend; ++cit) { -// std::cout << target(halfedge(cit->first,mesh), mesh.mesh()) -// << " n°: " << get(vimap, cit->first) << std::endl; - } - return OK; } @@ -159,8 +152,6 @@ private: /// Adds a positional constraint on a vertex x_ind, so that x_ind * w = rhs. void addConstraint(Matrix& A, Vector& B, int& id_r, int id_c, double w, Point_2 rhs) const { - std::cout << "Constraining " << id_c << " to " << rhs << std::endl; - A.set_coef(2*id_r, 2*id_c, w, true /*new_coef*/); A.set_coef(2*id_r + 1, 2*id_c + 1, w, true /*new_coef*/); @@ -178,8 +169,6 @@ private: const Eigen::Matrix2d& T, Matrix& A, Vector& B) const { - std::cout << "transconstraints: " << s << " " << t << std::endl; - // Matlab lines are commented for comparison. // Matlab fills together 2*x-1 and 2*x, but C++ fills 2*x and 2*x+1, // as everything (including loops!) starts at 0 and not 1. @@ -218,8 +207,6 @@ private: NT ang, int& current_line_id_in_A, Matrix& A, Vector& B) const { - std::cout << "constraining segment of length " << seam_segment.size() << std::endl; - // check that if there is a common vertex, it is at the beginning const bool is_reversed = (seam_segment.back().first == seam_segment.back().second); @@ -227,8 +214,6 @@ private: ang *= -1; } - std::cout << "with angle " << ang << std::endl; - // the rotation matrix according to the angle 'ang' Eigen::Matrix2d R; R(0,0) = std::cos(2 * CGAL_PI / ang); R(0,1) = - std::sin(2 * CGAL_PI / ang); @@ -237,8 +222,6 @@ private: const int s0 = is_reversed ? seam_segment.back().first : seam_segment.front().first; const int t0 = is_reversed ? seam_segment.back().second : seam_segment.front().second; - std::cout << "s0/t0: " << s0 << " " << t0 << std::endl; - typename std::vector >::const_iterator it = seam_segment.begin(), end = seam_segment.end(); @@ -251,7 +234,6 @@ private: for(; it!=end; ++it) { const int s = it->first; const int t = it->second; - std::cout << "v1/v2: " << s << " " << t << std::endl; CGAL_assertion(s != t); // sending s to t (and _not_ t to s !) @@ -286,8 +268,6 @@ private: internal::find_start_cone(cmap, vimap, start_cone, start_cone_index); CGAL_postcondition(start_cone != vertex_descriptor() && start_cone_index != -1); -// std::cout << "initial cone is " << start_cone << std::endl; - // parameterize the initial cone addConstraint(A, B, current_line_id_in_A, start_cone_index, 1. /*entry in A*/, tcoords[0]); @@ -317,7 +297,6 @@ private: const vertex_descriptor hd2_source = source(hd2, mesh); const int hd1s_index = get(vimap, hd1_source); const int hd2s_index = get(vimap, hd2_source); - std::cout << hd1s_index << " " << hd2s_index << std::endl; // If orbifold type IV and it is second cone in flattening, add constraint if(orb_type == Parallelogram && cmap.find(hd1_source) != cmap.end() @@ -354,7 +333,6 @@ private: break; } - std::cout << "-------------------------" << std::endl; seam_segment.clear(); ++segment_index; } @@ -364,7 +342,6 @@ private: CGAL_postcondition(mesh.has_on_seam(bhd) && is_border(bhd, mesh)); } - std::cout << current_line_id_in_A << " vs " << number_of_linear_constraints(mesh) << std::endl; CGAL_postcondition(current_line_id_in_A == number_of_linear_constraints(mesh)); } @@ -385,8 +362,6 @@ private: const Point_3& pj, int j, const Point_3& pk, int k, Matrix& L) const { -// std::cout << "compute mvc coef at: " << i << " " << j << " " << k << std::endl; - // For MVC, the entry of L(i,j) is - [ tan(gamma_ij/2) + tan(delta_ij)/2 ] / |ij| // where gamma_ij and delta_ij are the angles at i around the edge ij @@ -504,7 +479,6 @@ private: VertexUVMap uvmap, const VertexIndexMap vimap) const { - std::cout << "size of X: " << X.size() << std::endl; CGAL_assertion(X.size() == static_cast(2 * num_vertices(mesh))); BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)) { @@ -528,8 +502,6 @@ private: std::size_t n = L.column_dimension(); std::size_t big_n = n + A.row_dimension(); - std::cout << "n: " << n << " and big_n: " << big_n << std::endl; - // Fill the large system M.Xf = Bf: // ( L A' ) ( Xf ) = ( B ) // ( A 0 ) ( Xf ) = ( 0 ) @@ -543,30 +515,22 @@ private: Bf[n+i] = B[i]; } - std::cout << "filled Bf" << std::endl; - // matrix M for(int k=0; k::InnerIterator it(L.eigen_object(), k); it; ++it) { M.set_coef(it.row(), it.col(), it.value(), true /*new_coef*/); -// std::cout << it.row() << " " << it.col() << " " << it.value() << '\n'; } } - std::cout << "filled topleft of M" << std::endl; - 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_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'; } } - std::cout << "Filled M and Bf" << std::endl; - #ifdef CGAL_SMP_OUTPUT_ORBIFOLD_MATRICES std::ofstream outM("matrices/M.txt"); outM.precision(20); @@ -605,14 +569,12 @@ private: CGAL::Timer task_timer; task_timer.start(); - std::cout << "Solving..." << std::endl; SparseLinearAlgebraTraits_d solver; if(!solver.linear_solver(M, Bf, Xf, D)) { - std::cout << "Could not solve linear system" << std::endl; + std::cerr << "Could not solve linear system" << std::endl; return ERROR_CANNOT_SOLVE_LINEAR_SYSTEM; } CGAL_assertion(D == 1.0); - std::cout << "Solved the linear system in " << task_timer.time() << " seconds" << std::endl; Vector X(n); for(std::size_t i=0; isecond == First_unique_cone) { - std::cout << "Check cones: first at " << it->first << std::endl; if(found_first_unique_cone) { std::cerr << "Error: More than one 'First_unique_cone'" << std::endl; return false; @@ -218,7 +217,6 @@ bool check_input_validity(const SeamMesh& mesh, found_first_unique_cone = true; } else if(it->second == Second_unique_cone) { - std::cout << "Check cones: second at " << it->first << std::endl; if(found_second_unique_cone) { std::cerr << "Error: More than one 'Second_unique_cone'" << std::endl; return false; @@ -340,7 +338,7 @@ Error_code read_cones(const TriangleMesh& pm, const char* filename, cones.push_back(cone_index); } - std::cout << "Cones: "; + std::cout << "Input cones: "; for(std::size_t i=0; i