CGAL 4.11 - Point Set Processing
|
Read and write points (with or without additional properties) in PLY format.
Classes | |
struct | CGAL::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< double > , PLY_property< double > , PLY_property< double > > | CGAL::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< double > , PLY_property< double > , PLY_property< double > > | CGAL::make_ply_normal_reader (VectorMap normal_map) |
Generates a PLY property handler to read 3D normal vectors. More... | |
template<typename OutputIteratorValueType , typename OutputIterator , typename... PropertyHandler> | |
bool | CGAL::read_ply_points_with_properties (std::istream &stream, OutputIterator output, PropertyHandler &&...properties) |
Reads user-selected points properties from a .ply stream (ASCII or binary). More... | |
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap > | |
bool | CGAL::read_ply_points_and_normals (std::istream &stream, OutputIterator output, PointPMap point_pmap, NormalPMap normal_pmap) |
Reads points (positions + normals, if available) from a .ply stream (ASCII or binary). More... | |
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap > | |
bool | CGAL::read_ply_points (std::istream &stream, OutputIterator output, PointPMap point_pmap) |
Reads points (position only) from a .ply stream (ASCII or binary). More... | |
template<typename PointMap > | |
std::tuple< PointMap, PLY_property< double > , PLY_property< double > , PLY_property< double > > | CGAL::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< double > , PLY_property< double > , PLY_property< double > > | CGAL::make_ply_normal_writer (VectorMap normal_map) |
Generates a PLY property handler to write 3D normal vectors. More... | |
template<typename ForwardIterator , typename... PropertyHandler> | |
bool | CGAL::write_ply_points_with_properties (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PropertyHandler &&...properties) |
Saves the [first, beyond) range of points with properties to a .ply stream. More... | |
template<typename ForwardIterator , typename PointMap , typename VectorMap > | |
bool | CGAL::write_ply_points_and_normals (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointMap point_map, VectorMap normal_map) |
Saves the [first, beyond) range of points (positions + normals) to a .ply stream. More... | |
template<typename ForwardIterator , typename PointMap > | |
bool | CGAL::write_ply_points (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointMap point_map) |
Saves the [first, beyond) range of points (positions only) to a .ply stream. More... | |
std::tuple<VectorMap, typename Kernel_traits<typename VectorMap::value_type>::Kernel::Construct_vector_3, PLY_property<double>, PLY_property<double>, PLY_property<double> > CGAL::make_ply_normal_reader | ( | VectorMap | normal_map) |
Generates a PLY property handler to read 3D normal vectors.
Vectors are constructed from the input using 3 PLY properties of type double
and named nx
, ny
and nz
.
VectorMap | the property map used to store vectors. |
#include <CGAL/IO/read_ply_points.h>
std::tuple<VectorMap, PLY_property<double>, PLY_property<double>, PLY_property<double> > CGAL::make_ply_normal_writer | ( | VectorMap | normal_map) |
Generates a PLY property handler to write 3D normal vectors.
Vectors are written as 3 PLY properties of type double
and named nx
, ny
and nz
.
VectorMap | the property map used to store vectors. |
#include <CGAL/IO/write_ply_points.h>
std::tuple<PointMap, typename Kernel_traits<typename PointMap::value_type>::Kernel::Construct_point_3, PLY_property<double>, PLY_property<double>, PLY_property<double> > CGAL::make_ply_point_reader | ( | PointMap | point_map) |
Generates a PLY property handler to read 3D points.
Points are constructed from the input using 3 PLY properties of type double
and named x
, y
and z
.
PointMap | the property map used to store points. |
#include <CGAL/IO/read_ply_points.h>
std::tuple<PointMap, PLY_property<double>, PLY_property<double>, PLY_property<double> > CGAL::make_ply_point_writer | ( | PointMap | point_map) |
Generates a PLY property handler to write 3D points.
Points are written as 3 PLY properties of type double
and named x
, y
and z
.
PointMap | the property map used to store points. |
#include <CGAL/IO/write_ply_points.h>
bool CGAL::read_ply_points | ( | std::istream & | stream, |
OutputIterator | output, | ||
PointPMap | point_pmap | ||
) |
Reads points (position only) from a .ply stream (ASCII or binary).
Potential additional point properties (including normals) and faces are ignored.
OutputIteratorValueType | type of objects that can be put in OutputIterator . It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine. |
OutputIterator | iterator over output points. |
PointPMap | is a model of WritablePropertyMap with value_type CGAL::Point_3 . It can be omitted if the value type of OutputIterator is convertible to CGAL::Point_3 . |
true
on success.stream | input stream. |
output | output iterator over points. |
point_pmap | property map: value_type of OutputIterator -> Point_3. |
#include <CGAL/IO/read_ply_points.h>
bool CGAL::read_ply_points_and_normals | ( | std::istream & | stream, |
OutputIterator | output, | ||
PointPMap | point_pmap, | ||
NormalPMap | normal_pmap | ||
) |
Reads points (positions + normals, if available) from a .ply stream (ASCII or binary).
Potential additional point properties and faces are ignored.
OutputIteratorValueType | type of objects that can be put in OutputIterator . It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine. |
OutputIterator | iterator over output points. |
PointPMap | is a model of WritablePropertyMap with value type CGAL::Point_3 . |
NormalPMap | is a model of WritablePropertyMap with value type CGAL::Vector_3 . |
true
on success.stream | input stream. |
output | output iterator over points. |
point_pmap | property map: value_type of OutputIterator -> Point_3. |
normal_pmap | property map: value_type of OutputIterator -> Vector_3. |
#include <CGAL/IO/read_ply_points.h>
bool CGAL::read_ply_points_with_properties | ( | std::istream & | stream, |
OutputIterator | output, | ||
PropertyHandler &&... | properties | ||
) |
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 CGAL::cpp11::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
.OutputIteratorValueType | type of objects that can be put in OutputIterator . It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine. |
OutputIterator | iterator over output points. |
PropertyHandler | handlers to recover properties. |
true
on success. #include <CGAL/IO/read_ply_points.h>
bool CGAL::write_ply_points | ( | std::ostream & | stream, |
ForwardIterator | first, | ||
ForwardIterator | beyond, | ||
PointMap | point_map | ||
) |
Saves the [first, beyond) range of points (positions only) to a .ply stream.
PLY is either ASCII or binary depending on the value of CGAL::get_mode(stream)
.
ForwardIterator | iterator over input points. |
PointMap | is a model of ReadablePropertyMap with a value_type = CGAL::Point_3 . It can be omitted if the value type of ForwardIterator is convertible to CGAL::Point_3 . |
true
on success.stream | output stream. |
first | first input point. |
beyond | past-the-end input point. |
point_map | property map: value_type of OutputIterator -> Point_3. |
#include <CGAL/IO/write_ply_points.h>
bool CGAL::write_ply_points_and_normals | ( | std::ostream & | stream, |
ForwardIterator | first, | ||
ForwardIterator | beyond, | ||
PointMap | point_map, | ||
VectorMap | normal_map | ||
) |
Saves the [first, beyond) range of points (positions + normals) to a .ply stream.
PLY is either ASCII or binary depending on the value of CGAL::get_mode(stream)
.
ForwardIterator | iterator over input points. |
PointMap | is a model of ReadablePropertyMap with value type CGAL::Point_3 . It can be omitted if the value type of ForwardIterator is convertible to CGAL::Point_3 . |
VectorMap | is a model of ReadablePropertyMap with a value type CGAL::Vector_3 . |
true
on success.stream | output stream. |
first | first input point. |
beyond | past-the-end input point. |
point_map | property map: value_type of OutputIterator -> Point_3. |
normal_map | property map: value_type of OutputIterator -> Vector_3. |
#include <CGAL/IO/write_ply_points.h>
bool CGAL::write_ply_points_with_properties | ( | std::ostream & | stream, |
ForwardIterator | first, | ||
ForwardIterator | beyond, | ||
PropertyHandler &&... | properties | ||
) |
Saves the [first, beyond) range of points with properties to a .ply stream.
PLY is either ASCII or binary depending on the value of CGAL::get_mode(stream)
.
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::get_mode()
).ForwardIterator | iterator over input points. |
PropertyHandler | handlers to recover properties. |
true
on success. stream | output stream. |
first | iterator over the first input point. |
beyond | past-the-end iterator over the input points. |
properties | parameter pack of property handlers |
#include <CGAL/IO/write_ply_points.h>