CGAL 6.2 - IO Streams
Loading...
Searching...
No Matches
OFF I/O Functions

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

Functions

template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_OFF (std::istream &is, PointRange &points, PolygonRange &polygons, const NamedParameters &np=parameters::default_values())
 reads the content of is into points and polygons, using the Object File Format (OFF).
 
template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_OFF (const std::string &fname, PointRange &points, PolygonRange &polygons, const NamedParameters &np=parameters::default_values())
 reads the content of the file fname into points and polygons, using the Object File Format (OFF).
 
template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_OFF (std::ostream &os, const PointRange &points, const PolygonRange &polygons, const NamedParameters &np=parameters::default_values())
 writes the content of points and polygons in os, using the Object File Format (OFF).
 
template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_OFF (const std::string &fname, const PointRange &points, const PolygonRange &polygons, const NamedParameters &np=parameters::default_values())
 writes the content of points and polygons in the file fname, using the Object File Format (OFF).
 
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/4]

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/OFF.h>

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

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
fnameinput file name
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.

Returns
true if reading was successful, false otherwise.
See also
Object File Format (OFF)

◆ read_OFF() [2/4]

template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_OFF ( const std::string &  fname,
PointRange &  points,
PolygonRange &  polygons,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/IO/OFF.h>

reads the content of the file fname into points and polygons, using the Object File Format (OFF).

Template Parameters
PointRangea model of the concept RandomAccessContainer whose value type is the point type
PolygonRangea model of the concepts SequenceContainer and BackInsertionSequence whose value_type is itself a model of the concept SequenceContainer and BackInsertionSequence whose value_type is an unsigned integer type convertible to std::size_t
NamedParametersa sequence of Named Parameters
Parameters
fnamethe path to the input file
pointspoints of the soup of polygons
polygonsa range of polygons. Each element in it describes a polygon using the indices of the points in points.
npoptional Named Parameters described below
Optional Named Parameters
  • indicates whether output warnings and error messages should be printed or not.
  • Type: Boolean
  • Default: false
Returns
true if the reading was successful, false otherwise.

◆ read_OFF() [3/4]

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/OFF.h>

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

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
isinput stream
outputoutput iterator over points
npan optional 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.

Returns
true if reading was successful, false otherwise.
See also
Object File Format (OFF)

◆ read_OFF() [4/4]

template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_OFF ( std::istream &  is,
PointRange &  points,
PolygonRange &  polygons,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/IO/OFF.h>

reads the content of is into points and polygons, using the Object File Format (OFF).

Template Parameters
PointRangea model of the concepts RandomAccessContainer and BackInsertionSequence whose value type is the point type
PolygonRangea model of the concepts SequenceContainer and BackInsertionSequence whose value_type is itself a model of the concept SequenceContainer and BackInsertionSequence whose value_type is an unsigned integer type convertible to std::size_t
NamedParametersa sequence of Named Parameters
Parameters
isthe input stream
pointspoints of the soup of polygons
polygonsa range of polygons. Each element in it describes a polygon using the indices of the points in points.
npoptional Named Parameters described below
Optional Named Parameters
  • indicates whether output warnings and error messages should be printed or not.
  • Type: Boolean
  • Default: false
Returns
true if the reading was successful, false otherwise.

◆ write_OFF() [1/4]

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/OFF.h>

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

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
filenamethe path to the output file
pointsinput point range
npan optional 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.

  • 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/4]

template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_OFF ( const std::string &  fname,
const PointRange &  points,
const PolygonRange &  polygons,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/IO/OFF.h>

writes the content of points and polygons in the file fname, using the Object File Format (OFF).

Template Parameters
PointRangea model of the concept RandomAccessContainer whose value type is the point type
PolygonRangea model of the concept SequenceContainer whose value_type is itself a model of the concept SequenceContainer whose value_type is an unsigned integer type convertible to std::size_t
NamedParametersa sequence of Named Parameters
Parameters
fnamethe path to the output file
pointspoints of the soup of polygons
polygonsa range of polygons. Each element in it describes a polygon using the indices of the points in points.
npoptional sequence of Named Parameters among the ones listed below
Optional Named Parameters
  • a property map associating points to the elements of the range points
  • Type: a model of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and value type is a model of the concept Kernel::Point_3
  • Default: CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>
  • 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.

◆ write_OFF() [3/4]

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/OFF.h>

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

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
osoutput stream
pointsinput point range
npan optional 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 stream.

  • 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.

◆ write_OFF() [4/4]

template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_OFF ( std::ostream &  os,
const PointRange &  points,
const PolygonRange &  polygons,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/IO/OFF.h>

writes the content of points and polygons in os, using the Object File Format (OFF).

Template Parameters
PointRangea model of the concept RandomAccessContainer whose value type is the point type
PolygonRangea model of the concept SequenceContainer whose value_type is itself a model of the concept SequenceContainer whose value_type is an unsigned integer type convertible to std::size_t
NamedParametersa sequence of Named Parameters
Parameters
osthe output stream
pointspoints of the soup of polygons
polygonsa range of polygons. Each element in it describes a polygon using the indices of the points in points.
npoptional sequence of Named Parameters among the ones listed below
Optional Named Parameters
  • a property map associating points to the elements of the rangepoints
  • Type: a model of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and value type is a model of the concept Point_3
  • Default: CGAL::Identity_property_map<std::iterator_traits<PointRange::iterator>::value_type>
  • 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.