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;
58 if(h == GraphTraits::null_halfedge())
60 std::cout <<
"Failed to retrieve edge from " << source_index <<
" to "
61 << target_index <<
"." << std::endl;
62 std::cout <<
"Exiting";
66 std::cout <<
"Collapsing edge " << source_index <<
" to " << target_index
73 m.garbage_collection();
82 main(
int narg,
char **argv)
84 if(narg < 3 || narg > 4)
87 std::cout <<
"Usage: a.out filename; filename being an off file."
92 std::string to_treat = argv[1];
94 int deletion_case = std::stoi(std::string(argv[2]));
95 std::string output_file_name = std::string(argv[0]) + argv[2] +
".off";
97 if(deletion_case == 0)
100 to_treat, 0, 1, output_file_name);
102 else if(deletion_case == 1)
106 else if(deletion_case == 2)