mirror of https://github.com/CGAL/cgal
add missing overloads in OFF
This commit is contained in:
parent
c5e512db08
commit
3d4eb3a5be
|
|
@ -186,7 +186,22 @@ bool write_OFF(std::ostream& os, const FaceGraph& g, const CGAL_BGL_NP_CLASS& np
|
||||||
return IO::internal::write_OFF_BGL(os, g, np);
|
return IO::internal::write_OFF_BGL(os, g, np);
|
||||||
}
|
}
|
||||||
|
|
||||||
// document that too
|
/*!
|
||||||
|
\ingroup PkgBGLIOFct
|
||||||
|
|
||||||
|
writes the graph `g` in the file `fname`, in the OFF format.
|
||||||
|
|
||||||
|
\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
|
||||||
|
|
||||||
|
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||||
|
|
||||||
|
\see \ref IOStreamOFF
|
||||||
|
*/
|
||||||
template <typename FaceGraph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
template <typename FaceGraph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||||
bool write_OFF(const char* fname, const FaceGraph& g, const CGAL_BGL_NP_CLASS& np)
|
bool write_OFF(const char* fname, const FaceGraph& g, const CGAL_BGL_NP_CLASS& np)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,13 @@ bool read_OFF(std::istream& is,
|
||||||
CGAL::Emptyset_iterator()));
|
CGAL::Emptyset_iterator()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \ingroup IOstreamFunctions
|
||||||
|
*
|
||||||
|
* reads the content of the file `fname` into `points` and `polygons`, in the OFF format.
|
||||||
|
*
|
||||||
|
* \see \ref IOStreamOFF
|
||||||
|
*/
|
||||||
template <typename PointRange, typename PolygonRange, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
template <typename PointRange, typename PolygonRange, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||||
bool read_OFF(const char* fname,
|
bool read_OFF(const char* fname,
|
||||||
PointRange& points,
|
PointRange& points,
|
||||||
|
|
@ -185,7 +192,7 @@ bool read_OFF(const char* fname,
|
||||||
std::ifstream in(fname);
|
std::ifstream in(fname);
|
||||||
return read_OFF(in, points, polygons, np);
|
return read_OFF(in, points, polygons, np);
|
||||||
}
|
}
|
||||||
//todo doc this too
|
|
||||||
template <typename PointRange, typename PolygonRange, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
template <typename PointRange, typename PolygonRange, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||||
bool read_OFF(const std::string& fname, PointRange& points, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np)
|
bool read_OFF(const std::string& fname, PointRange& points, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np)
|
||||||
{
|
{
|
||||||
|
|
@ -239,6 +246,50 @@ bool write_OFF(std::ostream& os,
|
||||||
return write_OFF(os, points, polygons, parameters::all_default());
|
return write_OFF(os, points, polygons, parameters::all_default());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \ingroup IOstreamFunctions
|
||||||
|
*
|
||||||
|
* writes the content of `points` and `polygons` in the file `fname`, in the OFF format.
|
||||||
|
*
|
||||||
|
* \see \ref IOStreamOFF
|
||||||
|
*/
|
||||||
|
template <typename PointRange, typename PolygonRange, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||||
|
bool write_OFF(const char* fname,
|
||||||
|
const PointRange& points,
|
||||||
|
const PolygonRange& polygons,
|
||||||
|
const CGAL_BGL_NP_CLASS& np)
|
||||||
|
{
|
||||||
|
std::ofstream os(fname);
|
||||||
|
Generic_writer<std::ostream, File_writer_OFF> writer(os);
|
||||||
|
return writer(points, polygons, np);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename PointRange, typename PolygonRange>
|
||||||
|
bool write_OFF(const char* fname,
|
||||||
|
const PointRange& points,
|
||||||
|
const PolygonRange& polygons)
|
||||||
|
{
|
||||||
|
return write_OFF(fname, points, polygons, parameters::all_default());
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename PointRange, typename PolygonRange, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||||
|
bool write_OFF(const std::string& fname,
|
||||||
|
const PointRange& points,
|
||||||
|
const PolygonRange& polygons,
|
||||||
|
const CGAL_BGL_NP_CLASS& np)
|
||||||
|
{
|
||||||
|
return write_OFF(fname.c_str(), points, polygons, np);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename PointRange, typename PolygonRange>
|
||||||
|
bool write_OFF(const std::string& fname,
|
||||||
|
const PointRange& points,
|
||||||
|
const PolygonRange& polygons)
|
||||||
|
{
|
||||||
|
return write_OFF(fname, points, polygons, parameters::all_default());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_IO_OFF_H
|
#endif // CGAL_IO_OFF_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue