diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index 957803fc0b2..9dca86c4eec 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -43,8 +43,9 @@ namespace CGAL { template bool write_PLY(std::ostream& out, const FaceGraph& mesh, - const NamedParameters& np, - const std::string& comments = std::string()) + const std::string& comments, + const NamedParameters& np + ) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -109,12 +110,27 @@ bool write_PLY(std::ostream& out, return out.good(); } +template +bool write_PLY(std::ostream& out, + const FaceGraph& mesh, + const std::string comments) +{ + return write_PLY(out, mesh, comments, parameters::all_default()); +} + +template +bool write_PLY(std::ostream& out, + const FaceGraph& mesh, + const CGAL_BGL_NP_CLASS& np) +{ + return write_PLY(out, mesh, "", np); +} template bool write_PLY(std::ostream& out, const FaceGraph& mesh) { - return write_PLY(out, mesh, parameters::all_default(), ""); + return write_PLY(out, mesh, "", parameters::all_default()); } } // namespace CGAL diff --git a/BGL/test/BGL/test_bgl_read_write.cpp b/BGL/test/BGL/test_bgl_read_write.cpp index a483152aef1..3b25b59be19 100644 --- a/BGL/test/BGL/test_bgl_read_write.cpp +++ b/BGL/test/BGL/test_bgl_read_write.cpp @@ -206,12 +206,24 @@ bool test_PLY() CGAL::make_tetrahedron(Point(0, 0, 0), Point(1, 1, 0), Point(2, 0, 1), Point(3, 0, 0), fg); std::ostringstream out; - CGAL::write_PLY(out, fg); + CGAL::write_PLY(out, fg, "hello"); if(out.fail()) { std::cerr<<"Tetrahedron writing failed."< points; + std::vector > polygons; + + if(!CGAL::read_PLY(in, points, polygons)){ + std::cerr<<"Tetrahedron reading failed."<())); - points.push_back(get<0>(new_vertex)); + points.push_back(new_vertex); } } else if(element.name() == "face" || element.name() == "faces")