CGAL 5.3 - 3D Point Set

This module offers convenience overloads of input/ouput functions available in the Point Set Processing package.

These overloads, available after including CGAL/Point_set_3/IO.h, allow the user to call point set processing algorithms without having to handle manually property maps and iterators.

Input functions instanciate all the necessary property maps:

• if found in the input, normal vectors are stored in the usual CGAL::Point_set_3 property normal with template type Vector
• for PLY and LAS input, other properties are stored as properties in the CGAL::Point_set_3 class with the name and type given by the PLY header or by the LAS standard.

For a complete documentation of these functions, please refer to the Point Set Processing Reference manual.

## Modules

Input/Output (LAS)
I/O Functions for the LAS (Lidar) File Format.

Input/Output (OFF)
I/O Functions for the Object File Format (OFF).

Input/Output (PLY)
I/O Functions for the Polygon File Format (PLY).

Input/Output (XYZ)
I/O Functions for the XYZ File Format.

Input/Output (Deprecated)
These I/O functions are deprecated and newer versions should be used.

## Functions

template<typename Point , typename Vector , typename NamedParameters >
bool CGAL::IO::read_point_set (const std::string &fname, CGAL::Point_set_3< Point, Vector > &ps, const NamedParameters &np)
reads the point set from an input file. More...

template<typename Point , typename Vector >
std::ostream & CGAL::operator<< (std::ostream &os, const CGAL::Point_set_3< Point, Vector > &ps)
writes the point set in an output stream in the Polygon File Format (PLY). More...

template<typename Point , typename Vector , typename NamedParameters >
bool CGAL::IO::write_point_set (const std::string &fname, CGAL::Point_set_3< Point, Vector > &ps, const NamedParameters &np)
writes the point set in an output file. More...

template<typename Point , typename Vector >
std::istream & operator>> (std::istream &is, CGAL::Point_set_3< Point, Vector > &ps)
reads the point set from an input stream. More...

## ◆ operator>>()

template<typename Point , typename Vector >
 std::istream & operator>> ( std::istream & is, CGAL::Point_set_3< Point, Vector > & ps )
related

reads the point set from an input stream.

Supported file formats are the following:

The format is detected from the stream. If the stream contains normal vectors, the normal map is added to the point set. For PLY input, all point properties found in the header are added.

Attention
When reading a binary file, the flag std::ios::binary flag must be set during the creation of the ifstream.
Parameters
 is input stream ps point set
Returns
is

## ◆ read_point_set()

template<typename Point , typename Vector , typename NamedParameters >
 bool CGAL::IO::read_point_set ( const std::string & fname, CGAL::Point_set_3< Point, Vector > & ps, const NamedParameters & np )

#include <CGAL/Point_set_3/IO.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). If the file contains normal vectors, the normal map is added to the point set. For PLY input, all point properties found in the header are added.

Template Parameters
 Point the point type of the Point_set_3 Vector the vector type of the Point_set_3 NamedParameters a sequence of Named Parameters
Parameters
 fname name of the input file ps the point set np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
 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 writing: the OFF and XYZ formats are always ASCII, and the LAS format is always binary.
Returns
true if the reading was successful, false otherwise.
Examples:
Point_set_3/draw_point_set_3.cpp.

## ◆ write_point_set()

template<typename Point , typename Vector , typename NamedParameters >
 bool CGAL::IO::write_point_set ( const std::string & fname, CGAL::Point_set_3< Point, Vector > & ps, const NamedParameters & np )

#include <CGAL/Point_set_3/IO.h>

writes the point set in an output file.

Supported file formats are the following:

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

Template Parameters
 Point the point type of the Point_set_3 Vector the vector type of the Point_set_3 NamedParameters a sequence of Named Parameters
Parameters
 fname name of the output file ps the point set np an optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
 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
Returns
true if the writing was successful, false otherwise.