I/O Functions for the Polygon File Format (PLY) .
template<class PointRange , class PolygonRange , typename NamedParameters >
bool CGAL::IO::read_PLY (std::istream &is, PointRange &points, PolygonRange &polygons, const NamedParameters &np)
reads the content of is
into points
and polygons
, using the Polygon File Format (PLY) . More...
template<typename PointRange , typename PolygonRange , typename NamedParameters >
bool CGAL::IO::read_PLY (const std::string &fname, PointRange &points, PolygonRange &polygons, const NamedParameters &np)
reads the content of fname
into points
and polygons
, using the Polygon File Format (PLY) . More...
template<class PointRange , class PolygonRange , typename NamedParameters >
bool CGAL::IO::write_PLY (std::ostream &out, const PointRange &points, const PolygonRange &polygons, const NamedParameters &np)
writes the content of points
and polygons
in out
, using the Polygon File Format (PLY) . More...
template<class PointRange , class PolygonRange , typename NamedParameters >
bool CGAL::IO::write_PLY (const std::string &fname, const PointRange &points, const PolygonRange &polygons, const NamedParameters &np)
writes the content of points
and polygons
in the file fname
, using the Polygon File Format (PLY) . More...
◆ read_PLY() [1/2]
template<class PointRange , class PolygonRange , typename NamedParameters >
bool CGAL::IO::read_PLY
(
std::istream &
is ,
PointRange &
points ,
PolygonRange &
polygons ,
const NamedParameters &
np
)
#include <CGAL/IO/PLY.h>
reads the content of is
into points
and polygons
, using the Polygon File Format (PLY) .
Attention The polygon soup is not cleared, and the data from the stream are appended.
To read a binary file, the flag std::ios::binary
must be set during the creation of the ifstream
.
Template Parameters
Parameters
is the input stream
points points of the soup of polygons
polygons a range of polygons. Each element in it describes a polygon using the indices of the points in points
.
np optional Named Parameters described below
Optional Named Parameters
use_binary_mode
indicates whether data should be read in binary (true
) or in ASCII (false
)
Type: Boolean
Default: true
verbose
indicates whether output warnings and error messages should be printed or not.
Type: Boolean
Default: false
Returns true
if the reading was successful, false
otherwise.
◆ read_PLY() [2/2]
template<typename PointRange , typename PolygonRange , typename NamedParameters >
bool CGAL::IO::read_PLY
(
const std::string &
fname ,
PointRange &
points ,
PolygonRange &
polygons ,
const NamedParameters &
np
)
#include <CGAL/IO/PLY.h>
reads the content of fname
into points
and polygons
, using the Polygon File Format (PLY) .
Attention The polygon soup is not cleared, and the data from the file are appended.
Template Parameters
Parameters
fname the path to the input file
points points of the soup of polygons
polygons a range of polygons. Each element in it describes a polygon using the indices of the points in points
.
np optional Named Parameters described below
Optional Named Parameters
use_binary_mode
indicates whether data should be read in binary (true
) or in ASCII (false
)
Type: Boolean
Default: true
verbose
indicates whether output warnings and error messages should be printed or not.
Type: Boolean
Default: false
Returns true
if the reading was successful, false
otherwise.
◆ write_PLY() [1/2]
template<class PointRange , class PolygonRange , typename NamedParameters >
bool CGAL::IO::write_PLY
(
std::ostream &
out ,
const PointRange &
points ,
const PolygonRange &
polygons ,
const NamedParameters &
np
)
#include <CGAL/IO/PLY.h>
writes the content of points
and polygons
in out
, using the Polygon File Format (PLY) .
Attention To write to a binary file, the flag std::ios::binary
must be set during the creation of the ofstream
, and the IO::Mode
of the stream must be set to BINARY
.
Template Parameters
Parameters
out the output stream
points points of the soup of polygons
polygons a range of polygons. Each element in it describes a polygon using the indices of the points in points
.
np optional Named Parameters described below
Optional Named Parameters
stream_precision
a parameter used to set the precision (i.e. how many digits are generated) of the output stream
Type: int
Default: the precision of the stream
os``
Extra: This parameter is only meaningful while using ASCII encoding.
Returns true
if the writing was successful, false
otherwise.
◆ write_PLY() [2/2]
template<class PointRange , class PolygonRange , typename NamedParameters >
bool CGAL::IO::write_PLY
(
const std::string &
fname ,
const PointRange &
points ,
const PolygonRange &
polygons ,
const NamedParameters &
np
)
#include <CGAL/IO/PLY.h>
writes the content of points
and polygons
in the file fname
, using the Polygon File Format (PLY) .
Template Parameters
Parameters
fname the path to the output file
points points of the soup of polygons
polygons a range of polygons. Each element in it describes a polygon using the indices of the points in points
.
np optional Named Parameters described below
Optional Named Parameters
use_binary_mode
indicates whether data should be written in binary (true
) or in ASCII (false
)
Type: Boolean
Default: true
stream_precision
a parameter used to set the precision (i.e. how many digits are generated) of the output stream
Type: int
Default: 6
Extra: This parameter is only meaningful while using ASCII encoding.
Returns true
if the writing was successful, false
otherwise.