12 #ifndef _SCL_SECURE_NO_WARNINGS
13 #define _SCL_SECURE_NO_WARNINGS
17 #include <OpenMesh/Core/IO/MeshIO.hh>
19 #define CGAL_USE_OM_POINTS
20 #include <CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>
39 const std::string &output_file_name)
41 typedef OpenMesh::PolyMesh_ArrayKernelT< >
Mesh;
44 std::ifstream in(filename);
48 std::cout <<
"failed to open file " << filename <<
"\n";
53 typedef boost::graph_traits< Mesh > GraphTraits;
54 typedef typename GraphTraits::halfedge_descriptor halfedge_descriptor;
59 if(h == GraphTraits::null_halfedge())
61 std::cout <<
"Failed to retrieve edge from " << source_index <<
" to "
62 << target_index <<
"." << std::endl;
63 std::cout <<
"Exiting";
67 std::cout <<
"Collapsing edge " << source_index <<
" to " << target_index
74 m.garbage_collection();
83 main(
int narg,
char **argv)
85 if(narg < 3 || narg > 4)
88 std::cout <<
"Usage: a.out filename; filename being an off file."
93 std::string to_treat = argv[1];
95 int deletion_case = std::stoi(std::string(argv[2]));
96 std::string output_file_name = std::string(argv[0]) + argv[2] +
".off";
98 if(deletion_case == 0)
101 to_treat, 0, 1, output_file_name);
103 else if(deletion_case == 1)
107 else if(deletion_case == 2)