- a property map associating points to the elements of the point range
-
Type: a model of
WritablePropertyMap
with value typegeom_traits::Point_3
-
Default:
CGAL::Identity_property_map<geom_traits::Point_3>
CGAL 5.4 - Point Set Processing
|
Read and write points (with or without additional properties) in PLY format.
Classes | |
struct | CGAL::IO::PLY_property< T > |
Class used to identify a PLY property as a type and a name. More... | |
Functions | |
template<typename PointMap > | |
std::tuple< PointMap, typename Kernel_traits< typename PointMap::value_type >::Kernel::Construct_point_3, PLY_property< FT >, PLY_property< FT >, PLY_property< FT > > | CGAL::IO::make_ply_point_reader (PointMap point_map) |
Generates a PLY property handler to read 3D points. More... | |
template<typename VectorMap > | |
std::tuple< VectorMap, typename Kernel_traits< typename VectorMap::value_type >::Kernel::Construct_vector_3, PLY_property< FT >, PLY_property< FT >, PLY_property< FT > > | CGAL::IO::make_ply_normal_reader (VectorMap normal_map) |
Generates a PLY property handler to read 3D normal vectors. More... | |
template<typename OutputIteratorValueType , typename PointOutputIterator , typename ... PropertyHandler> | |
bool | CGAL::IO::read_PLY_with_properties (std::istream &is, PointOutputIterator output, PropertyHandler &&... properties) |
reads user-selected points properties from a .ply stream (ASCII or binary). More... | |
template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters > | |
bool | CGAL::IO::read_PLY (std::istream &is, PointOutputIterator output, const NamedParameters &np) |
reads points (positions + normals, if available), using the Polygon File Format (PLY). More... | |
template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters > | |
bool | CGAL::IO::read_PLY (const std::string &fname, PointOutputIterator output, const NamedParameters &np) |
reads points (positions + normals, if available), using the Polygon File Format (PLY). More... | |
template<typename PointMap > | |
std::tuple< PointMap, PLY_property< FT >, PLY_property< FT >, PLY_property< FT > > | CGAL::IO::make_ply_point_writer (PointMap point_map) |
Generates a PLY property handler to write 3D points. More... | |
template<typename VectorMap > | |
std::tuple< VectorMap, PLY_property< FT >, PLY_property< FT >, PLY_property< FT > > | CGAL::IO::make_ply_normal_writer (VectorMap normal_map) |
Generates a PLY property handler to write 3D normal vectors. More... | |
template<typename PointRange , typename ... PropertyHandler> | |
bool | CGAL::IO::write_PLY_with_properties (std::ostream &os, const PointRange &points, PropertyHandler &&... properties) |
writes the range of points with properties using Polygon File Format (PLY). More... | |
template<typename PointRange , typename NamedParameters > | |
bool | CGAL::IO::write_PLY (std::ostream &os, const PointRange &points, const NamedParameters &np) |
writes the range of points (positions + normals, if available) using Polygon File Format (PLY). More... | |
template<typename PointRange , typename NamedParameters > | |
bool | CGAL::IO::write_PLY (const std::string &filename, const PointRange &points, const NamedParameters &np) |
writes the range of points (positions + normals, if available) using Polygon File Format (PLY). More... | |
std::tuple<VectorMap, typename Kernel_traits<typename VectorMap::value_type>::Kernel::Construct_vector_3, PLY_property<FT>, PLY_property<FT>, PLY_property<FT> > CGAL::IO::make_ply_normal_reader | ( | VectorMap | normal_map | ) |
#include <CGAL/IO/read_ply_points.h>
Generates a PLY property handler to read 3D normal vectors.
Vectors are constructed from the input using 3 PLY properties of type FT
and named nx
, ny
and nz
. FT
is float
if the points use CGAL::Simple_cartesian<float>
and double
otherwise.
VectorMap | the property map used to store vectors. |
std::tuple<VectorMap, PLY_property<FT>, PLY_property<FT>, PLY_property<FT> > CGAL::IO::make_ply_normal_writer | ( | VectorMap | normal_map | ) |
#include <CGAL/IO/write_ply_points.h>
Generates a PLY property handler to write 3D normal vectors.
Vectors are written as 3 PLY properties of type FT
and named nx
, ny
and nz
. FT
is float
if the vectors use CGAL::Simple_cartesian<float>
and double
otherwise.
VectorMap | the property map used to store vectors. |
std::tuple<PointMap, typename Kernel_traits<typename PointMap::value_type>::Kernel::Construct_point_3, PLY_property<FT>, PLY_property<FT>, PLY_property<FT> > CGAL::IO::make_ply_point_reader | ( | PointMap | point_map | ) |
#include <CGAL/IO/read_ply_points.h>
Generates a PLY property handler to read 3D points.
Points are constructed from the input using 3 PLY properties of type FT
and named x
, y
and z
. FT
is float
if the points use CGAL::Simple_cartesian<float>
and double
otherwise.
PointMap | the property map used to store points. |
std::tuple<PointMap, PLY_property<FT>, PLY_property<FT>, PLY_property<FT> > CGAL::IO::make_ply_point_writer | ( | PointMap | point_map | ) |
#include <CGAL/IO/write_ply_points.h>
Generates a PLY property handler to write 3D points.
Points are written as 3 PLY properties of type FT
and named x
, y
and z
. FT
is float
if the points use CGAL::Simple_cartesian<float>
and double
otherwise.
PointMap | the property map used to store points. |
bool CGAL::IO::read_PLY | ( | std::istream & | is, |
PointOutputIterator | output, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/IO/read_ply_points.h>
reads points (positions + normals, if available), using the Polygon File Format (PLY).
Potential additional point properties and faces are ignored.
std::ios::binary
must be set during the creation of the ifstream
.OutputIteratorValueType | type of objects that can be put in PointOutputIterator . It must be a model of DefaultConstructible and defaults to value_type_traits<PointOutputIterator>::type . It can be omitted when the default is fine. |
PointOutputIterator | iterator over output points. |
NamedParameters | a sequence of Named Parameters |
is | input stream. |
output | output iterator over points. |
np | an optional sequence of Named Parameters among the ones listed below |
| |
| |
|
true
if reading was successful, false
otherwise.read_PLY_with_properties()
bool CGAL::IO::read_PLY | ( | const std::string & | fname, |
PointOutputIterator | output, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/IO/read_ply_points.h>
reads points (positions + normals, if available), using the Polygon File Format (PLY).
Potential additional point properties and faces are ignored.
OutputIteratorValueType | type of objects that can be put in PointOutputIterator . It must be a model of DefaultConstructible and defaults to value_type_traits<PointOutputIterator>::type . It can be omitted when the default is fine. |
PointOutputIterator | iterator over output points. |
NamedParameters | a sequence of Named Parameters |
fname | input file name. |
output | output iterator over points. |
np | optional sequence of Named Parameters among the ones listed below. |
| |
| |
| |
|
true
if reading was successful, false
otherwise.bool CGAL::IO::read_PLY_with_properties | ( | std::istream & | is, |
PointOutputIterator | output, | ||
PropertyHandler &&... | properties | ||
) |
#include <CGAL/IO/read_ply_points.h>
reads user-selected points properties from a .ply stream (ASCII or binary).
Potential additional point properties and faces are ignored.
Properties are handled through a variadic list of property handlers. A PropertyHandler
can either be:
std::pair<PropertyMap, PLY_property<T> >
if the user wants to read a PLY property as a scalar value T (for example, storing an int
PLY property into an int
variable).std::tuple<PropertyMap, Constructor, PLY_property<T>...>
if the user wants to use one or several PLY properties to construct a complex object (for example, storing 3 uchar
PLY properties into a Color object that can for example be a std::array<unsigned char, 3>
). In that case, the second element of the tuple should be a functor that constructs the value type of PropertyMap
from N objects of types T
.std::ios::binary
must be set during the creation of the ifstream
.OutputIteratorValueType | type of objects that can be put in PointOutputIterator . It must be a model of DefaultConstructible and defaults to value_type_traits<PointOutputIterator>::type . It can be omitted when the default is fine. |
PointOutputIterator | iterator over output points. |
PropertyHandler | handlers to recover properties. |
true
if reading was successful, false
otherwise.bool CGAL::IO::write_PLY | ( | std::ostream & | os, |
const PointRange & | points, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/IO/write_ply_points.h>
writes the range of points
(positions + normals, if available) using Polygon File Format (PLY).
std::ios::binary
must be set during the creation of the ofstream
, and the IO::Mode
of the stream must be set to BINARY
.PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
NamedParameters | a sequence of Named Parameters |
os | output stream |
points | input point range |
np | an optional sequence of Named Parameters among the ones listed below |
| |
| |
| |
|
true
if writing was successful, false
otherwise.write_PLY_with_properties()
bool CGAL::IO::write_PLY | ( | const std::string & | filename, |
const PointRange & | points, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/IO/write_ply_points.h>
writes the range of points
(positions + normals, if available) using Polygon File Format (PLY).
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
NamedParameters | a sequence of Named Parameters |
filename | the path to the output file |
points | input point range |
np | an optional sequence of Named Parameters among the ones listed below |
| |
| |
| |
| |
|
true
if writing was successful, false
otherwise.write_PLY_with_properties()
bool CGAL::IO::write_PLY_with_properties | ( | std::ostream & | os, |
const PointRange & | points, | ||
PropertyHandler &&... | properties | ||
) |
#include <CGAL/IO/write_ply_points.h>
writes the range of points
with properties using Polygon File Format (PLY).
Properties are handled through a variadic list of property handlers. A PropertyHandler
can either be:
std::pair<PropertyMap, PLY_property<T> >
if the user wants to write a scalar value T as a PLY property (for example, writing an int
variable as an int
PLY property).std::tuple<PropertyMap, PLY_property<T>...>
if the user wants to write a complex object as several PLY properties. In that case, a specialization of Output_rep
must be provided for PropertyMap::value_type
that handles both ASCII and binary output (see CGAL::IO::get_mode()
).std::ios::binary
must be set during the creation of the ofstream
, and the IO::Mode
of the stream must be set to BINARY
.PointRange | is a model of ConstRange . The value type of its iterator is the key type of the PropertyMap objects provided within the PropertyHandler parameter. |
PropertyHandler | handlers to recover properties. |
true
if writing was successful, false
otherwise.os | output stream. |
points | input point range. |
properties | parameter pack of property handlers |