From ce72dd895f38f9504784859dd3e3e8d10b48abc5 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 15 Jan 2019 12:38:04 +0100 Subject: [PATCH] First draft of the doc --- .../convert_nef_polyhedron_to_polygon_mesh.h | 26 +++++++++++++++++++ .../convert_nef_polyhedron_to_polygon_mesh.h | 6 ++--- Nef_3/test/Nef_3/test_nef_to_soup.cpp | 4 +-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Nef_3/doc/Nef_3/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/doc/Nef_3/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index 7f074eb22fb..d7a903f5288 100644 --- a/Nef_3/doc/Nef_3/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/doc/Nef_3/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -5,9 +5,35 @@ namespace CGAL { /// Note that contrary to `Nef_polyhedron_3::convert_to_polyhedron()`, the output is not triangulated /// (but faces with more than one connected component of the boundary). /// The polygon mesh can be triangulated by setting `triangulate_all_faces` to `true` or by calling the function `triangulate_faces()`. +/// @tparam Nef_polyhedron an object of type `Nef_polyhedron_3`. +/// @tparam Polygon_mesh a model of `MutableFaceGraph`. +/// +/// @param nef the input. +/// @param pm the output. +/// @param triangulate_all_faces the bool for triangulating the faces. +/// /// \pre `Polygon_mesh` must have an internal point property map with value type being `Nef_polyhedron_3::Point_3`. /// \pre `nef.simple()` template void convert_nef_polyhedron_to_polygon_mesh(const Nef_polyhedron& nef, Polygon_mesh& pm, bool triangulate_all_faces = false); + + /// \ingroup PkgNef3IOFunctions + /// Converts an objet of type `Nef_polyhedron_3` into a polygon soup. + /// The polygons can be triangulated by setting `triangulate_all_faces` to `true`. + /// @tparam Output_kernel the Kernel from which the point type of points come from. + /// @tparam Nef_polyhedron an object of type `Nef_polyhedron_3`. + /// @tparam Polygon_mesh a model of `MutableFaceGraph`. + /// @tparam PolygonRange a container of collections of indices of the points in their range. + /// @tparam PointRange a container of `Output_kernel::Point_3`. + /// + /// @param nef the input. + /// @param pm the output. + /// @param triangulate_all_faces the bool for triangulating the faces. + /// \pre `nef.simple()` + template + void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, + PointRange& points, + PolygonRange& polygons, + bool triangulate_all_faces = false); } diff --git a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h index 60cfd12edf2..c1053f88014 100644 --- a/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h +++ b/Nef_3/include/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h @@ -371,14 +371,14 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef, triangulate_all_faces); } -template +template void convert_nef_polyhedron_to_polygon_mesh(const Nef_polyhedron& nef, Polygon_mesh& pm, bool triangulate_all_faces = false) { typedef typename boost::property_traits::type>::value_type PM_Point; typedef typename Kernel_traits::Kernel PM_Kernel; - PointRange points; - PolygonRange polygons; + std::vector points; + std::vector > polygons; convert_nef_polyhedron_to_polygon_soup(nef, points, polygons, triangulate_all_faces); Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, pm); } diff --git a/Nef_3/test/Nef_3/test_nef_to_soup.cpp b/Nef_3/test/Nef_3/test_nef_to_soup.cpp index 4793a892ea9..42121f341af 100644 --- a/Nef_3/test/Nef_3/test_nef_to_soup.cpp +++ b/Nef_3/test/Nef_3/test_nef_to_soup.cpp @@ -45,9 +45,7 @@ int main() PolygonMesh pm; CGAL::convert_nef_polyhedron_to_polygon_mesh< Nef_polyhedron, - PolygonMesh, - std::vector >, - std::vector >(nef, pm); + PolygonMesh>(nef, pm); return 0; }