CGAL 6.1.1 - Point Set Processing

Loading...
Searching...
No Matches
Functions
I/O (OFF Formats)
Reference Manual

##

## Functions
template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::read_OFF (std::istream &is, PointOutputIterator output, const NamedParameters &np=parameters::default_values())
| reads points (positions + normals, if available), using the Object File Format (OFF).
template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::read_OFF (const std::string &fname, PointOutputIterator output, const NamedParameters &np=parameters::default_values())
| reads points (positions + normals, if available), using the Object File Format (OFF).
template<typename PointRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::write_OFF (std::ostream &os, const PointRange &points, const NamedParameters &np=parameters::default_values())
| writes the range of `points` (positions + normals, if available), using the Object File Format (OFF).
template<typename PointRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::write_OFF (const std::string &filename, const PointRange &points, const NamedParameters &np=parameters::default_values())
| writes the range of `points` (positions + normals, if available), using the Object File Format (OFF).

## Function Documentation

## ◆ read_OFF() [1/2]

template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::read_OFF | ( | const std::string & | fname,
|  | PointOutputIterator | output,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/IO/read_off_points.h>`

reads points (positions + normals, if available), using the Object File Format (OFF).

Template Parameters

  OutputIteratorValueType | type 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.
  PointOutputIterator | iterator over output points.
  NamedParameters | a sequence of Named Parameters

Parameters

  fname | input file name
  output | output iterator over points
  np | optional sequence of Named Parameters among the ones listed below.

Optional Named Parameters

  a property map associating points to the elements of the point range Type: a model of `WritablePropertyMap` with value type `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 `WritablePropertyMap` with value type `geom_traits::Vector_3` Default: If this parameter is omitted, normals in the input stream are ignored. |
  an instance of a geometric traits class Type: a model of `Kernel` Default: a CGAL Kernel deduced from the point type, using `CGAL::Kernel_traits` |

Returns
  `true` if reading was successful, `false` otherwise.

See also
  Object File Format (OFF)

## ◆ read_OFF() [2/2]

template<typename OutputIteratorValueType , typename PointOutputIterator , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::read_OFF | ( | std::istream & | is,
|  | PointOutputIterator | output,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/IO/read_off_points.h>`

reads points (positions + normals, if available), using the Object File Format (OFF).

Template Parameters

  OutputIteratorValueType | type 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.
  PointOutputIterator | iterator over output points.
  NamedParameters | a sequence of Named Parameters

Parameters

  is | input stream
  output | output iterator over points
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the elements of the point range Type: a model of `WritablePropertyMap` with value type `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 `WritablePropertyMap` with value type `geom_traits::Vector_3` Default: If this parameter is omitted, normals in the input stream are ignored. |
  an instance of a geometric traits class Type: a model of `Kernel` Default: a CGAL Kernel deduced from the point type, using `CGAL::Kernel_traits` |

Returns
  `true` if reading was successful, `false` otherwise.

See also
  Object File Format (OFF)

## ◆ write_OFF() [1/2]

template<typename PointRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::write_OFF | ( | const std::string & | filename,
|  | const PointRange & | points,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/IO/write_off_points.h>`

writes the range of `points` (positions + normals, if available), using the Object File Format (OFF).

Template Parameters

  PointRange | is a model of `ConstRange`. The value type of its iterator is the key type of the named parameter `point_map`.
  NamedParameters | a sequence of Named Parameters

Parameters

  filename | the path to the output file
  points | input point range
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the elements of the point range Type: a model of `ReadablePropertyMap` with value type `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` with value type `geom_traits::Vector_3` Default: If this parameter is omitted, normals are not written in the output file. |
  an instance of a geometric traits class Type: a model of `Kernel` Default: a CGAL Kernel deduced from the point type, using `CGAL::Kernel_traits` |
  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 writing was successful, `false` otherwise.

See also
  Object File Format (OFF)

## ◆ write_OFF() [2/2]

template<typename PointRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::write_OFF | ( | std::ostream & | os,
|  | const PointRange & | points,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/IO/write_off_points.h>`

writes the range of `points` (positions + normals, if available), using the Object File Format (OFF).

Template Parameters

  PointRange | is a model of `ConstRange`. The value type of its iterator is the key type of the named parameter `point_map`.
  NamedParameters | a sequence of Named Parameters

Parameters

  os | output stream
  points | input point range
  np | an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  a property map associating points to the elements of the point range Type: a model of `ReadablePropertyMap` with value type `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` with value type `geom_traits::Vector_3` Default: If this parameter is omitted, normals are not written in the output stream. |
  an instance of a geometric traits class Type: a model of `Kernel` Default: a CGAL Kernel deduced from the point type, using `CGAL::Kernel_traits` |
  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 writing was successful, `false` otherwise.