CGAL 5.6 - IO Streams
GOCAD I/O Functions

I/O Functions for the GOCAD (TS) File Format.

Functions

template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_GOCAD (std::istream &is, PointRange &points, PolygonRange &polygons, const NamedParameters &np=parameters::default_values())
 reads the content of is into points and polygons, using the GOCAD (TS) File Format. More...
 
template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_GOCAD (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 GOCAD (TS) File Format. More...
 
template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_GOCAD (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 GOCAD (TS) File Format. More...
 
template<typename PointRange , typename PolygonRange , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_GOCAD (const std::string &fname, const PointRange &points, const PolygonRange &polygons, const NamedParameters &np=parameters::default_values())
 writes the content of points and polygons in fname, using the GOCAD (TS) File Format. More...
 

Function Documentation

◆ read_GOCAD() [1/2]

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

#include <CGAL/IO/GOCAD.h>

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

Attention
The polygon soup is not cleared, and the data from the stream are appended.
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 concepts RandomAccessContainer 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.

◆ read_GOCAD() [2/2]

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

#include <CGAL/IO/GOCAD.h>

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

Attention
The polygon soup is not cleared, and the data from the file are appended.
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 concepts RandomAccessContainer 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.

◆ write_GOCAD() [1/2]

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

#include <CGAL/IO/GOCAD.h>

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

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

◆ write_GOCAD() [2/2]

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

#include <CGAL/IO/GOCAD.h>

writes the content of points and polygons in fname, using the GOCAD (TS) File Format.

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