CGAL 5.5.2 - IO Streams

I/O Functions for the Well-Known Text (WKT) File Format.

Functions

template<typename Point >
bool CGAL::IO::read_point_WKT (std::istream &in, Point &point)
 fills a Point from a WKT stream. More...
 
template<typename MultiPoint >
bool CGAL::IO::read_multi_point_WKT (std::istream &in, MultiPoint &mp)
 overwrites the content of a MultiPoint with the first line starting with MULTIPOINT in the stream. More...
 
template<typename LineString >
bool CGAL::IO::read_linestring_WKT (std::istream &in, LineString &polyline)
 fills a Linestring from a WKT stream. More...
 
template<typename MultiLineString >
bool CGAL::IO::read_multi_linestring_WKT (std::istream &in, MultiLineString &mls)
 overwrites the content of a MultiLineString with the first line starting with MULTILINESTRING in the stream. More...
 
template<typename Polygon >
bool CGAL::IO::read_polygon_WKT (std::istream &in, Polygon &polygon)
 fills polygon from a WKT stream. More...
 
template<typename MultiPolygon >
bool CGAL::IO::read_multi_polygon_WKT (std::istream &in, MultiPolygon &polygons)
 overwrites the content of a MultiPolygon with the first line starting with MULTIPOLYGON in the stream. More...
 
template<typename Point >
std::ostream & CGAL::IO::write_point_WKT (std::ostream &out, const Point &point)
 writes point into a WKT stream. More...
 
template<typename Polygon >
std::ostream & CGAL::IO::write_polygon_WKT (std::ostream &out, const Polygon &poly)
 writes poly into a WKT stream. More...
 
template<typename LineString >
std::ostream & CGAL::IO::write_linestring_WKT (std::ostream &out, LineString ls)
 writes the content of ls into a WKT stream. More...
 
template<typename MultiPoint >
std::ostream & CGAL::IO::write_multi_point_WKT (std::ostream &out, MultiPoint &mp)
 writes the content of mp into a WKT stream. More...
 
template<typename MultiPolygon >
std::ostream & CGAL::IO::write_multi_polygon_WKT (std::ostream &out, MultiPolygon &polygons)
 writes the content of polygons into a WKT stream. More...
 
template<typename MultiLineString >
std::ostream & CGAL::IO::write_multi_linestring_WKT (std::ostream &out, MultiLineString &mls)
 writes the content of mls into a WKT stream. More...
 
template<typename MultiPoint , typename MultiLineString , typename MultiPolygon >
bool CGAL::IO::read_WKT (std::istream &is, MultiPoint &points, MultiLineString &polylines, MultiPolygon &polygons)
 reads the content of a WKT stream and fills points, polylines and polygons with all the POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON and MULTIPOLYGON it finds in input. More...
 

Function Documentation

◆ read_linestring_WKT()

template<typename LineString >
bool CGAL::IO::read_linestring_WKT ( std::istream &  in,
LineString &  polyline 
)

#include <CGAL/IO/WKT.h>

fills a Linestring from a WKT stream.

The first line starting with LINESTRING in the stream will be used.

Template Parameters
Linestringmust be a model of RandomAccessRange of CGAL::Point_2, and have:
  • a function push_back() that takes a CGAL::Point_2.
  • a function clear(),
  • a function resize() that takes an size_type
  • an operator[]() that takes a size_type.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2
Examples:
Stream_support/Linestring_WKT.cpp.

◆ read_multi_linestring_WKT()

template<typename MultiLineString >
bool CGAL::IO::read_multi_linestring_WKT ( std::istream &  in,
MultiLineString &  mls 
)

#include <CGAL/IO/WKT.h>

overwrites the content of a MultiLineString with the first line starting with MULTILINESTRING in the stream.

Template Parameters
MultiLineStringmust be a model of RandomAccessRange of Linestring, and have:
  • a function push_back() that takes a Linestring,
  • a function clear(),
  • a function resize() that takes an size_type
  • an operator[]() that takes a size_type.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2
Examples:
Stream_support/Linestring_WKT.cpp.

◆ read_multi_point_WKT()

template<typename MultiPoint >
bool CGAL::IO::read_multi_point_WKT ( std::istream &  in,
MultiPoint &  mp 
)

#include <CGAL/IO/WKT.h>

overwrites the content of a MultiPoint with the first line starting with MULTIPOINT in the stream.

Template Parameters
MultiPointmust be a model of RandomAccessRange of CGAL::Point_2 or CGAL::Point_3, and have:
  • a function push_back() that takes the same point type,
  • a function clear(),
  • a function resize() that takes an size_type
  • an operator[]() that takes a size_type.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2
CGAL::Point_3
Examples:
Stream_support/Point_WKT.cpp.

◆ read_multi_polygon_WKT()

template<typename MultiPolygon >
bool CGAL::IO::read_multi_polygon_WKT ( std::istream &  in,
MultiPolygon &  polygons 
)

#include <CGAL/IO/WKT.h>

overwrites the content of a MultiPolygon with the first line starting with MULTIPOLYGON in the stream.

Template Parameters
MultiPolygonmust be a model of RandomAccessRange of CGAL::General_polygon_with_holes_2, and have:
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::General_polygon_with_holes_2
Examples:
Stream_support/Polygon_WKT.cpp.

◆ read_point_WKT()

template<typename Point >
bool CGAL::IO::read_point_WKT ( std::istream &  in,
Point &  point 
)

#include <CGAL/IO/WKT.h>

fills a Point from a WKT stream.

The first line starting with POINT in the stream will be used.

Template Parameters
Pointcan be a CGAL::Point_2 or CGAL::Point_3.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2
CGAL::Point_3

◆ read_polygon_WKT()

template<typename Polygon >
bool CGAL::IO::read_polygon_WKT ( std::istream &  in,
Polygon &  polygon 
)

#include <CGAL/IO/WKT.h>

fills polygon from a WKT stream.

The first line starting with POLYGON in the stream will be used.

Template Parameters
Polygonis a CGAL::General_polygon_with_holes_2.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::General_polygon_with_holes_2
Examples:
Stream_support/Polygon_WKT.cpp.

◆ read_WKT()

template<typename MultiPoint , typename MultiLineString , typename MultiPolygon >
bool CGAL::IO::read_WKT ( std::istream &  is,
MultiPoint &  points,
MultiLineString &  polylines,
MultiPolygon &  polygons 
)

#include <CGAL/IO/WKT.h>

reads the content of a WKT stream and fills points, polylines and polygons with all the POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON and MULTIPOLYGON it finds in input.

Template Parameters
MultiPointmust be a model of RandomAccessRange of CGAL::Point_2 or CGAL::Point_3.
MultiLineStringmust be a RandomAccessRange of Linestring.
MultiPolygonmust be a model of RandomAccessRange of CGAL::General_polygon_with_holes_2.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::IO::read_linestring_WKT()

◆ write_linestring_WKT()

template<typename LineString >
std::ostream& CGAL::IO::write_linestring_WKT ( std::ostream &  out,
LineString  ls 
)

#include <CGAL/IO/WKT.h>

writes the content of ls into a WKT stream.

Template Parameters
LineStringmust be a RandomAccessRange of CGAL::Point_2.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2

◆ write_multi_linestring_WKT()

template<typename MultiLineString >
std::ostream& CGAL::IO::write_multi_linestring_WKT ( std::ostream &  out,
MultiLineString &  mls 
)

#include <CGAL/IO/WKT.h>

writes the content of mls into a WKT stream.

Template Parameters
MultiLineStringmust be a RandomAccessRange of LineString.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::IO::write_linestring_WKT()

◆ write_multi_point_WKT()

template<typename MultiPoint >
std::ostream& CGAL::IO::write_multi_point_WKT ( std::ostream &  out,
MultiPoint &  mp 
)

#include <CGAL/IO/WKT.h>

writes the content of mp into a WKT stream.

Template Parameters
MultiPointmust be a RandomAccessRange of CGAL::Point_2.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2

◆ write_multi_polygon_WKT()

template<typename MultiPolygon >
std::ostream& CGAL::IO::write_multi_polygon_WKT ( std::ostream &  out,
MultiPolygon &  polygons 
)

#include <CGAL/IO/WKT.h>

writes the content of polygons into a WKT stream.

Template Parameters
MultiPolygonmust be a RandomAccessRange of CGAL::General_polygon_with_holes_2.
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::General_polygon_with_holes_2

◆ write_point_WKT()

template<typename Point >
std::ostream& CGAL::IO::write_point_WKT ( std::ostream &  out,
const Point &  point 
)

#include <CGAL/IO/WKT.h>

writes point into a WKT stream.

Template Parameters
Pointis a CGAL::Point_2
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::Point_2

◆ write_polygon_WKT()

template<typename Polygon >
std::ostream& CGAL::IO::write_polygon_WKT ( std::ostream &  out,
const Polygon &  poly 
)

#include <CGAL/IO/WKT.h>

writes poly into a WKT stream.

Template Parameters
Polygonmust be a CGAL::General_polygon_with_holes_2
Attention
Only Cartesian Kernels with double or float as FT are supported.
See also
CGAL::General_polygon_with_holes_2