Re-add doc of high level BGL I/O functions

This commit is contained in:
Mael Rouxel-Labbé 2020-05-22 18:57:16 +02:00
parent 8a7753d05c
commit 9de30a6d56
1 changed files with 59 additions and 4 deletions

View File

@ -12,9 +12,11 @@
#include <CGAL/boost/graph/io.h> #include <CGAL/boost/graph/io.h>
//doc in doc/ namespace CGAL {
namespace CGAL{ ////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
/// Read
//not for now. //not for now.
/* /*
@ -60,7 +62,34 @@ bool read_polygon_mesh(std::istream& is,
} }
*/ */
/*!
* \ingroup PkgBGLIOFct
* \brief reads a polygon mesh from a file.
* \tparam FaceGraph a model of `FaceGraph`
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
*
* \param fname the name of the file. Its extension must be one of the following :
* `.off` (\ref IOStreamOFF "OFF file format") , `.obj` (\ref IOStreamOBJ "OBJ file format"),
* `.stl` (\ref IOStreamSTL "STL file format"), `.ply` (\ref IOStreamPLY "PLY file format"),
* `.vtp`(\ref IOStreamVTK "VTP file format") or `.ts`(\ref IOStreamGocad "GOCAD file format").
* \param g the mesh
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
*
* \cgalNamedParamsBegin
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`.
* If this parameter is omitted, an internal property map for
* `CGAL::vertex_point_t` should be available in `FaceGraph`\cgalParamEnd
* \cgalNamedParamsEnd
* Other named parameters may be used according to the file extension.
* See `PkgBGLIOFct` for an exhaustive list.
* \return `true` if the reading worked, `false` otherwise.
*
* \pre The data must represent a 2-manifold
*
* \see \ref IOStreamOFF
*
*/
template <class FaceGraph, typename NamedParameters> template <class FaceGraph, typename NamedParameters>
bool read_polygon_mesh(const std::string& fname, bool read_polygon_mesh(const std::string& fname,
FaceGraph& g, FaceGraph& g,
@ -119,7 +148,34 @@ bool read_polygon_mesh(const char* fname,
return read_polygon_mesh(fname, g, parameters::all_default()); return read_polygon_mesh(fname, g, parameters::all_default());
} }
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
/// Write
/*!
* \ingroup PkgBGLIOFct
* \brief writes a polygon mesh in a file.
* \tparam FaceGraph a model of `FaceGraph`
* \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
*
* \param fname the name of the file. Its extension must be one of the following :
* `.off` (\ref IOStreamOFF "OFF file format") , `.obj` (\ref IOStreamOBJ "OBJ file format"),
* `.stl` (\ref IOStreamSTL "STL file format"), `.ply` (\ref IOStreamPLY "PLY file format"),
* `.vtp`(\ref IOStreamVTK "VTP file format") or `.ts`(\ref IOStreamGocad "GOCAD file format").
* \param g the mesh
* \param np optional \ref pmp_namedparameters "Named Parameters" described below
*
* \cgalNamedParamsBegin
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`.
* If this parameter is omitted, an internal property map for
* `CGAL::vertex_point_t` should be available in `FaceGraph`\cgalParamEnd
* \cgalNamedParamsEnd
* Other named parameters may be used according to the file extension.
* See `PkgBGLIOFct` for an exhaustive list.
* \return `true` if the writing worked, `false` otherwise.
*
* \see \ref IOStreamOFF
*/
template <class FaceGraph, typename NamedParameters> template <class FaceGraph, typename NamedParameters>
bool write_polygon_mesh(const std::string& fname, bool write_polygon_mesh(const std::string& fname,
FaceGraph& g, FaceGraph& g,
@ -160,8 +216,6 @@ bool write_polygon_mesh(const std::string& fname,
return write_polygon_mesh(fname, g, parameters::all_default()); return write_polygon_mesh(fname, g, parameters::all_default());
} }
template <class FaceGraph, typename NamedParameters> template <class FaceGraph, typename NamedParameters>
bool write_polygon_mesh(const char* fname, bool write_polygon_mesh(const char* fname,
FaceGraph& g, FaceGraph& g,
@ -176,6 +230,7 @@ bool write_polygon_mesh(const char* fname,
{ {
return write_polygon_mesh(fname, g, parameters::all_default()); return write_polygon_mesh(fname, g, parameters::all_default());
} }
}//end CGAL }//end CGAL
#endif // CGAL_BOOST_GRAPH_POLYGON_MESH_IO_H #endif // CGAL_BOOST_GRAPH_POLYGON_MESH_IO_H