mirror of https://github.com/CGAL/cgal
Documentation + better comment parameter
This commit is contained in:
parent
0d2f06d8a9
commit
2e13c54913
|
|
@ -2158,12 +2158,12 @@ private: //------------------------------------------------------- private data
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES)
|
#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
/// \relates Surface_mesh
|
||||||
|
/// Inserts the surface mesh in an output stream in PLY format.
|
||||||
|
/// All vertex and face properties with simple types are inserted in the stream.
|
||||||
template <typename P>
|
template <typename P>
|
||||||
#ifdef DOXYGEN_RUNNING
|
bool write_ply(std::ostream& os, const Surface_mesh<P>& sm, const std::string& comments = std::string())
|
||||||
bool write_ply(std::ostream& os, const Surface_mesh<P>& sm)
|
|
||||||
#else
|
|
||||||
bool write_ply(std::ostream& os, const Surface_mesh<P>& sm, std::string* comments = NULL)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
typedef Surface_mesh<P> SMesh;
|
typedef Surface_mesh<P> SMesh;
|
||||||
typedef typename SMesh::Vertex_index VIndex;
|
typedef typename SMesh::Vertex_index VIndex;
|
||||||
|
|
@ -2191,9 +2191,9 @@ private: //------------------------------------------------------- private data
|
||||||
<< ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl
|
<< ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl
|
||||||
<< "comment Generated by the CGAL library" << std::endl;
|
<< "comment Generated by the CGAL library" << std::endl;
|
||||||
|
|
||||||
if (comments != NULL)
|
if (comments != std::string())
|
||||||
{
|
{
|
||||||
std::istringstream iss (*comments);
|
std::istringstream iss (comments);
|
||||||
std::string line;
|
std::string line;
|
||||||
while (getline(iss, line))
|
while (getline(iss, line))
|
||||||
{
|
{
|
||||||
|
|
@ -2607,12 +2607,26 @@ private: //------------------------------------------------------- private data
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES)
|
#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
/// \cond SKIP_IN_MANUAL
|
||||||
template <typename P>
|
template <typename P>
|
||||||
#ifdef DOXYGEN_RUNNING
|
|
||||||
bool read_ply(std::istream& is, Surface_mesh<P>& sm)
|
bool read_ply(std::istream& is, Surface_mesh<P>& sm)
|
||||||
#else
|
{
|
||||||
bool read_ply(std::istream& is, Surface_mesh<P>& sm, std::string* comments = NULL)
|
std::string dummy;
|
||||||
#endif
|
return read_ply (is, sm, dummy);
|
||||||
|
}
|
||||||
|
/// \endcond
|
||||||
|
|
||||||
|
/// \relates Surface_mesh
|
||||||
|
/// Extracts the surface mesh from an input stream in Ascii or
|
||||||
|
/// Binary PLY format and appends it to the surface mesh `sm`. The
|
||||||
|
/// operator reads all properties for vertices and faces found in
|
||||||
|
/// the PLY input.
|
||||||
|
/// \pre The data in the stream must represent a two-manifold. If this is not the case
|
||||||
|
/// the `failbit` of `is` is set and the mesh cleared.
|
||||||
|
|
||||||
|
template <typename P>
|
||||||
|
bool read_ply(std::istream& is, Surface_mesh<P>& sm, std::string& comments)
|
||||||
{
|
{
|
||||||
if(!is)
|
if(!is)
|
||||||
{
|
{
|
||||||
|
|
@ -2629,8 +2643,7 @@ private: //------------------------------------------------------- private data
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comments != NULL)
|
comments = reader.comments();
|
||||||
*comments = reader.comments();
|
|
||||||
|
|
||||||
for (std::size_t i = 0; i < reader.number_of_elements(); ++ i)
|
for (std::size_t i = 0; i < reader.number_of_elements(); ++ i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue