template<typename PointRange, typename RegionOutputIterator, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_VG (std::ifstream &is, PointRange &points, RegionOutputIterator rout, const NamedParameters &np=parameters::default_values ())
reads the content of the input stream is into points and rout using the VG VertexGroup File Format .
template<typename PointRange, typename RegionRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_VG (std::ostream &os, const PointRange &points, const RegionRange ®ions, const NamedParameters &np=parameters::default_values ())
writes the content of points and regions to the output stream os in the VG VertexGroup File Format .
◆ read_VG()
template<typename PointRange, typename RegionOutputIterator, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_VG
(
std::ifstream & is ,
PointRange & points ,
RegionOutputIterator rout ,
const NamedParameters & np = parameters::default_values () )
#include <CGAL/IO/VG.h>
reads the content of the input stream is into points and rout using the VG VertexGroup File Format .
Template Parameters
PointRange CGAL::Point_set_3 or a model of the concept RandomAccessContainer whose value type is the point type.
RegionOutputIterator type of the output iterator who must accept std::pair<Primitive, std::vector<item>> , where item is the key type of Point_map . Primitive needs either to implement operator >> to be read the input stream is or to provide the named parameter constructor described below to be created from std::vector<FT> .
NamedParameters a sequence of Named Parameters
Parameters
is input stream
points point range to which the read points are written
rout output iterator to which the read regions are written
np optional Named Parameters described below
Optional Named Parameters
normal_map
a property map associating normals to the elements inserted into points
Type: a model of WritablePropertyMap whose key type is std::size_t and whose value type is geom_traits::Vector_3
Default: If this parameter is omitted, no normals are read.
color_map
a property map associating colors to the elements inserted into points
Type: a model of WritablePropertyMap whose key type is std::size_t and whose value type is CGAL::Color
Default: If this parameter is omitted, no colors are read.
constructor
a function taking the group type and std::vector<FT> as input to create an instance of Primitive
Type: a function with the signature Primitive (int type , std::vector<FT>&) or Primitive (int type , std::vector<FT>&&)
Default: Not provided, the operator >> of Primitive is used.
labels
a range of labels providing one label for each region.
Type: a reference to a model of the concept RandomAccessContainer whose value type is std::string or const char *
Default: No group labels are read.
Extra: a range can be passed via std::ref to create a reference.
colors
a range of colors providing one color for each region.
Type: a reference to a model of the concept RandomAccessContainer whose value type is CGAL::Color .
Default: No group colors are read.
Extra: a range can be passed via std::ref to create a reference.
geom_traits
Returns true if the writing was successful, false otherwise.
◆ write_VG()
template<typename PointRange, typename RegionRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_VG
(
std::ostream & os ,
const PointRange & points ,
const RegionRange & regions ,
const NamedParameters & np = parameters::default_values () )
#include <CGAL/IO/VG.h>
writes the content of points and regions to the output stream os in the VG VertexGroup File Format .
Attention The format does not support binary streams.
Template Parameters
PointRange CGAL::Point_set_3 or a model of the concept RandomAccessContainer whose value type is the point type.
RegionRange a model of ForwardRange whose value type is std::pair<Primitive, std::vector<item>> , where item is the key type of Point_map . Primitive is the geometric primitive and needs to implement operator << for the output stream os .
NamedParameters a sequence of Named Parameters
Parameters
os the output stream
points point set
regions a range of regions providing their algebraic primitive and elements of the point cloud.
np optional Named Parameters described below
Optional Named Parameters
serializer
serializes Primitive into a string to be written to os and provides the type of the primitive (unsigned int) and the number of written parameters.
Type: a function with the signature const char* (Primitive &p, unsigned int &type , std::size_t& number_of_parameters)
Default: The Primitive is not exported into os . Default handler are provided for geom_traits::Plane_3 and geom_traits::Sphere_3
Extra: The type of primitive is defined as 0: Plane, 1: Cylinder, 2: Sphere, 3: Cone, 4: Torus, 5: General
point_map
a property map associating points to the elements of the point set points
Type: a model of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and whose value type is geom_traits::Point_3
Default: CGAL::Identity_property_map <geom_traits::Point_3>
normal_map
a property map associating normals to the elements of the point range
Type: a model of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and whose value type is geom_traits::Vector_3
Default: If this parameter is omitted, no normals are written to os .
color_map
a property map associating colors to the elements of the point range
Type: a model of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and whose value type is CGAL::Color
Default: If this parameter is omitted, no colors are written to os .
labels
a range of labels providing one label for each region.
Type: a model of the concept RandomAccessContainer whose value type is std::string or const char *
Default: No group labels are written to os .
colors
a range of colors providing one color for each region.
Type: a model of the concept RandomAccessContainer whose value type is CGAL::Color
Default: No group colors are written to os .
geom_traits
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
Returns true if the writing was successful, false otherwise.