CGAL 6.3-dev - IO Streams
Loading...
Searching...
No Matches

I/O Functions for the VG VertexGroup File Format.

Functions

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 &regions, const NamedParameters &np=parameters::default_values())
 writes the content of points and regions to the output stream os in the VG VertexGroup File Format.

Function Documentation

◆ 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
PointRangeCGAL::Point_set_3 or a model of the concept RandomAccessContainer whose value type is the point type.
RegionOutputIteratortype 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>.
NamedParametersa sequence of Named Parameters
Parameters
isinput stream
pointspoint range to which the read points are written
routoutput iterator to which the read regions are written
npoptional Named Parameters described below
Optional Named Parameters
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
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
PointRangeCGAL::Point_set_3 or a model of the concept RandomAccessContainer whose value type is the point type.
RegionRangea 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.
NamedParametersa sequence of Named Parameters
Parameters
osthe output stream
pointspoint set
regionsa range of regions providing their algebraic primitive and elements of the point cloud.
npoptional Named Parameters described below
Optional Named Parameters
  • 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
  • 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>
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.