// examples/Planar_map/example9.C // ------------------------------ #include #include #include #include #include #include #include #include // #define CGAL_POSTSCRIPT #if defined(CGAL_USE_LEDA) && defined(CGAL_POSTSCRIPT) #include #endif typedef CGAL::Quotient NT; typedef CGAL::Cartesian Kernel; typedef CGAL::Pm_segment_traits_2 Traits; typedef CGAL::Pm_default_dcel Dcel; typedef CGAL::Planar_map_2 Planar_map; typedef CGAL::Pm_file_writer Pm_writer; int main() { Planar_map pm; Pm_writer verbose_writer(std::cout, pm, true); Pm_writer writer(std::cout, pm); std::cout << "* * * Demonstrating a trivial use of IO functions" << std::endl << std::endl; std::cin >> pm; std::cout << pm; std::cout << std::endl; std::cout << "* * * Presenting the use of verbose format" << std::endl; std::cout << std::endl; CGAL::write_pm(pm, verbose_writer, std::cout); std::cout << std::endl; std::cout << "* * * Demonstrating the use of the writer class interface." << std::endl; std::cout << "* * * Printing all halfedges in non verbose format" << std::endl << std::endl; writer.write_halfedges(pm.halfedges_begin(), pm.halfedges_end()); std::cout << std::endl; std::cout << "* * * Printing all halfedges in a verbose format" << std::endl << std::endl; verbose_writer.write_halfedges(pm.halfedges_begin(), pm.halfedges_end()); #if defined(CGAL_USE_LEDA) && defined(CGAL_POSTSCRIPT) // Print to Postscript file: CGAL::Postscript_file_stream LPF(500, 500 ,"pm.ps"); LPF.init(-3,3,-3); LPF.set_line_width(1); LPF << pm; #endif return 0; }