CGAL 5.4.1 - Point Set Processing

Modules

 I/O Functions (Deprecated)
 

Functions

template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters >
bool CGAL::IO::read_points (const std::string &fname, PointOutputIterator output, const NamedParameters &np)
 reads the point set from an input file. More...
 
template<typename PointRange , typename NamedParameters >
bool CGAL::IO::write_points (const std::string &fname, const PointRange &points, const NamedParameters &np,)
 writes the range of points with properties to a file. More...
 

Function Documentation

◆ read_points()

template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters >
bool CGAL::IO::read_points ( const std::string &  fname,
PointOutputIterator  output,
const NamedParameters &  np 
)

#include <CGAL/IO/read_points.h>

reads the point set from an input file.

Supported file formats are the following:

The format is detected from the filename extension (letter case is not important).

Template Parameters
OutputIteratorValueTypetype 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.
PointOutputIteratoriterator over output points.
NamedParametersa sequence of Named Parameters
Parameters
fnamethe name of the input file.
outputoutput iterator over points.
npoptional sequence of Named Parameters among the ones listed below.
Optional Named Parameters

  • a property map associating normals to the elements of the point range
  • Type: a model of WritablePropertyMap with value type geom_traits::Vector_3
  • Default: If this parameter is omitted, normals in the input stream are ignored.

  • indicates whether data should be read in binary (true) or in ASCII (false)
  • Type: Boolean
  • Default: true
  • Extra: This parameter is only relevant for PLY reading: the OFF and XYZ formats are always ASCII, and the LAS format is always binary.
Returns
true if reading was successful, false otherwise.
Examples:
Point_set_processing_3/average_spacing_example.cpp, Point_set_processing_3/bilateral_smooth_point_set_example.cpp, Point_set_processing_3/edge_aware_upsample_point_set_example.cpp, Point_set_processing_3/edges_example.cpp, Point_set_processing_3/grid_simplification_example.cpp, Point_set_processing_3/hierarchy_simplification_example.cpp, Point_set_processing_3/normals_example.cpp, Point_set_processing_3/registration_with_OpenGR.cpp, Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp, Point_set_processing_3/registration_with_pointmatcher.cpp, Point_set_processing_3/remove_outliers_example.cpp, Point_set_processing_3/scale_estimation_example.cpp, Point_set_processing_3/structuring_example.cpp, and Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp.

◆ write_points()

template<typename PointRange , typename NamedParameters >
bool CGAL::IO::write_points ( const std::string &  fname,
const PointRange &  points,
const NamedParameters &  np 
)

#include <CGAL/IO/write_points.h>

writes the range of points with properties to a file.

Supported file formats are the following:

The format is detected from the filename extension (letter case is not important).

Template Parameters
PointRangeis a model of ConstRange. The value type of its iterator is the key type of the named parameter point_map.
NamedParametersa sequence of Named Parameters
Parameters
fnamethe name of the output file.
pointsthe range of points that will be written.
npoptional sequence of Named Parameters among the ones listed below.
Optional Named Parameters

  • a property map associating normals to the elements of the point range
  • Type: a model of ReadablePropertyMap with value type geom_traits::Vector_3
  • Default: If this parameter is omitted, normals are not written in the output file.

  • indicates whether data should be written in binary (true) or in ASCII (false)
  • Type: Boolean
  • Default: true
  • Extra: This parameter is only relevant for PLY writing: the OFF and XYZ formats are always ASCII, and the LAS format is always binary.

  • 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 writing was successful, false otherwise.
Examples:
Point_set_processing_3/edge_aware_upsample_point_set_example.cpp, Point_set_processing_3/hierarchy_simplification_example.cpp, Point_set_processing_3/registration_with_OpenGR.cpp, Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp, Point_set_processing_3/registration_with_pointmatcher.cpp, Point_set_processing_3/structuring_example.cpp, and Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp.