diff --git a/Nef_3/examples/Nef_3/draw_nef_3.cpp b/Nef_3/examples/Nef_3/draw_nef_3.cpp index d15584675db..06727eac187 100644 --- a/Nef_3/examples/Nef_3/draw_nef_3.cpp +++ b/Nef_3/examples/Nef_3/draw_nef_3.cpp @@ -1,60 +1,27 @@ #include -//#include -//#include #include #include #include -#include -#include #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -//typedef CGAL::Exact_integer NT; -//typedef CGAL::Extended_homogeneous Kernel; -typedef CGAL::Surface_mesh Surface_mesh; -typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; -typedef Nef_polyhedron::Plane_3 Plane_3; -typedef CGAL::Polyhedron_3 Polyhedron; +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Polyhedron; +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; int main(int argc, char *argv[]) { + // read OFF file into a polyhedron Polyhedron P; std::ifstream ifs((argc > 1) ? argv[1] : "data/cross.off"); ifs >> P; - std::cout << "============== Polyhedron =============" << std::endl - << std::endl; - std::cout << "Number of vertices: " << P.size_of_vertices() << std::endl; - std::cout << "Number of halfedges: " << P.size_of_halfedges() << std::endl; - std::cout << "Number of facets: " << P.size_of_facets() << std::endl - << std::endl; + // initialize nef from polyhedron Nef_polyhedron N(P); - std::cout << "================= Nef ==================" << std::endl - << std::endl; - std::cout << "Number of volumes: " << N.number_of_volumes() << std::endl; - std::cout << "Number of vertices: " << N.number_of_vertices() << std::endl; - std::cout << "Number of edges: " << N.number_of_edges() << std::endl; - std::cout << "Number of facets: " << N.number_of_facets() << std::endl - << std::endl; - std::cout << "Number of halfedges: " << N.number_of_halfedges() << std::endl; - std::cout << "Number of halffacets: " << N.number_of_halffacets() << std::endl - << std::endl; - std::cout << "Number of sfaces: " << N.number_of_sfaces() << std::endl; - std::cout << "Number of shalfedges : " << N.number_of_shalfedges() - << std::endl; - std::cout << "Number of shalfloops: " << N.number_of_shalfloops() << std::endl - << std::endl; - - // output the result into a Surface_mesh - Surface_mesh output; - CGAL::convert_nef_polyhedron_to_polygon_mesh(N, output); - std::ofstream out; - out.open("out.off"); - out << output; - out.close(); - + // draw Nef Polyhedron CGAL::draw(N); + + return EXIT_SUCCESS; }