CGAL 5.0.2 - IO Streams
|
All classes in the CGAL kernel provide input and output operators for IO streams. CGAL provides three different printing mode, defined in the enum IO::Mode
, as well as different functions to set and get the printing mode.
CGAL::IO::Mode
CGAL::get_mode()
CGAL::is_ascii()
CGAL::is_binary()
CGAL::is_pretty()
CGAL::set_mode()
CGAL::set_ascii_mode()
CGAL::set_binary_mode()
CGAL::set_pretty_mode()
CGAL::operator>>()
CGAL::operator<<()
CGAL::iformat()
CGAL::oformat()
CGAL::read_point_WKT()
GCAL::read_multi_point_WKT()
GCAL::read_linestring_WKT()
GCAL::read_multi_linestring_WKT()
GCAL::read_polygon_WKT()
GCAL::read_multi_polygon_WKT()
GCAL::read_WKT()
CGAL::write_point_WKT()
CGAL::write_polygon_WKT()
CGAL::write_linestring_WKT()
CGAL::write_multi_point_WKT()
CGAL::write_multi_polygon_WKT()
CGAL::write_multi_linestring_WKT()
CGAL::Color
CGAL::Istream_iterator<T,Stream>
CGAL::Ostream_iterator<T,Stream>
CGAL::Verbose_ostream
CGAL::Input_rep<T,F>
CGAL::Output_rep<T,F>
Modules | |
Stream Operators | |
Classes | |
class | CGAL::Input_rep< T, F > |
The definition of Input_rep is completely symmetric to Output_rep . More... | |
class | CGAL::Output_rep< T, F > |
The purpose of Output_rep is to provide a way to control output formatting that works independently of the object's stream output operator. More... | |
class | CGAL::Istream_iterator< T, Stream > |
The class Istream_iterator is an input iterator adaptor for the input stream class Stream and value type T . More... | |
class | CGAL::Ostream_iterator< T, Stream > |
The class Ostream_iterator is an output iterator adaptor for the output stream class Stream and value type T . More... | |
class | CGAL::Verbose_ostream |
The class Verbose_ostream can be used as an output stream. More... | |
class | CGAL::Color |
An object of the class Color is a color available for drawing operations in many CGAL output streams. More... | |
Enumerations | |
enum | CGAL::IO::Mode |
All classes in the CGAL Kernel provide input and output operators for IOStreams. More... | |
Functions | |
IO::Mode | CGAL::get_mode (std::ios &s) |
returns the printing mode of the IO stream s . More... | |
IO::Mode | CGAL::set_ascii_mode (std::ios &s) |
sets the mode of the IO stream s to be the IO::ASCII mode. More... | |
IO::Mode | CGAL::set_binary_mode (std::ios &s) |
IO::Mode | CGAL::set_mode (std::ios &s, IO::Mode m) |
sets the printing mode of the IO stream s . More... | |
IO::Mode | CGAL::set_pretty_mode (std::ios &s) |
sets the mode of the IO stream s to be the IO::PRETTY mode. More... | |
bool | CGAL::is_ascii (std::ios &s) |
checks if the IO stream s is in IO::ASCII mode. More... | |
bool | CGAL::is_binary (std::ios &s) |
checks if the IO stream s is in IO::BINARY mode. More... | |
bool | CGAL::is_pretty (std::ios &s) |
checks if the IO stream s is in IO::PRETTY mode. More... | |
template<class T > | |
Output_rep< T > | CGAL::oformat (const T &t) |
Convenience function to construct an output representation (Output_rep ) for type T . More... | |
template<class T > | |
Input_rep< T > | CGAL::iformat (const T &t) |
The definition of this function is completely symmetric to oformat() . | |
template<class T , typename F > | |
Output_rep< T, F > | CGAL::oformat (const T &t, F) |
Convenience function to construct an output representation (Output_rep ) for type T . More... | |
template<typename Point > | |
std::istream & | CGAL::read_point_WKT (std::istream &in, Point &point) |
read_point_WKT() fills a Point from a WKT stream. More... | |
template<typename MultiPoint > | |
std::istream & | CGAL::read_multi_point_WKT (std::istream &in, MultiPoint &mp) |
read_multi_point_WKT() overwrites the content of a MultiPoint with the first line starting with MULTIPOINT in the stream. More... | |
template<typename LineString > | |
std::istream & | CGAL::read_linestring_WKT (std::istream &in, LineString &polyline) |
read_linestring_WKT() fills a Linestring from a WKT stream. More... | |
template<typename MultiLineString > | |
std::istream & | CGAL::read_multi_linestring_WKT (std::istream &in, MultiLineString &mls) |
read_multi_linestring_WKT() overwrites the content of a MultiLineString with the first line starting with MULTILINESTRING in the stream. More... | |
template<typename Polygon > | |
std::istream & | CGAL::read_polygon_WKT (std::istream &in, Polygon &polygon) |
read_polygon_WKT() fills polygon from a WKT stream. More... | |
template<typename MultiPolygon > | |
std::istream & | CGAL::read_multi_polygon_WKT (std::istream &in, MultiPolygon &polygons) |
read_multi_polygon_WKT() overwrites the content of a MultiPolygon with the first line starting with MULTIPOLYGON in the stream. More... | |
template<typename Point > | |
std::ostream & | CGAL::write_point_WKT (std::ostream &out, const Point &point) |
write_point_WKT() writes point into a WKT stream. More... | |
template<typename Polygon > | |
std::ostream & | CGAL::write_polygon_WKT (std::ostream &out, const Polygon &poly) |
write_polygon_WKT() writes poly into a WKT stream. More... | |
template<typename LineString > | |
std::ostream & | CGAL::write_linestring_WKT (std::ostream &out, LineString ls) |
write_linestring_WKT() writes the content of ls into a WKT stream. More... | |
template<typename MultiPoint > | |
std::ostream & | CGAL::write_multi_point_WKT (std::ostream &out, MultiPoint &mp) |
write_multi_point_WKT() writes the content of mp into a WKT stream. More... | |
template<typename MultiPolygon > | |
std::ostream & | CGAL::write_multi_polygon_WKT (std::ostream &out, MultiPolygon &polygons) |
write_multi_polygon_WKT() writes the content of polygons into a WKT stream. More... | |
template<typename MultiLineString > | |
std::ostream & | CGAL::write_multi_linestring_WKT (std::ostream &out, MultiLineString &mls) |
write_multi_linestring_WKT() writes the content of mls into a WKT stream. More... | |
template<typename MultiPoint , typename MultiLineString , typename MultiPolygon > | |
std::istream & | CGAL::read_WKT (std::istream &input, 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... | |
enum CGAL::IO::Mode |
#include <CGAL/IO/io.h>
All classes in the CGAL Kernel
provide input and output operators for IOStreams.
The basic task of such an operator is to produce a representation of an object that can be written as a sequence of characters on devices as a console, a file, or a pipe. The enum Mode
distinguish between three different printing formats.
In ASCII
mode, numbers e.g. the coordinates of a point or the coefficients of a line, are written in a machine independent format. In BINARY mode, data are written in a binary format, e.g. a double is represented as a sequence of four byte. The format depends on the machine. The mode PRETTY serves mainly for debugging as the type of the geometric object is written, as well as the data defining the object. For example for a point at the origin with Cartesian double coordinates, the output would be PointC2(0.0, 0.0)
. At the moment CGAL does not provide input operations for pretty printed data. By default a stream is in Ascii mode.
IO::Mode CGAL::get_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
returns the printing mode of the IO stream s
.
bool CGAL::is_ascii | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
checks if the IO stream s
is in IO::ASCII
mode.
bool CGAL::is_binary | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
checks if the IO stream s
is in IO::BINARY
mode.
bool CGAL::is_pretty | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
checks if the IO stream s
is in IO::PRETTY
mode.
Output_rep<T> CGAL::oformat | ( | const T & | t | ) |
#include <CGAL/IO/io.h>
Convenience function to construct an output representation (Output_rep
) for type T
.
Generic IO for type T
.
Output_rep<T,F> CGAL::oformat | ( | const T & | t, |
F | |||
) |
#include <CGAL/IO/io.h>
Convenience function to construct an output representation (Output_rep
) for type T
.
Generic IO for type T
with formatting tag.
std::istream& CGAL::read_linestring_WKT | ( | std::istream & | in, |
LineString & | polyline | ||
) |
#include <CGAL/IO/WKT.h>
read_linestring_WKT()
fills a Linestring
from a WKT stream.
The first line starting with LINESTRING in the stream will be used.
Linestring | must be a model of RandomAccessRange of CGAL::Point_2 , and have:
|
FT
are supported. CGAL::Point_2
std::istream& CGAL::read_multi_linestring_WKT | ( | std::istream & | in, |
MultiLineString & | mls | ||
) |
#include <CGAL/IO/WKT.h>
read_multi_linestring_WKT()
overwrites the content of a MultiLineString
with the first line starting with MULTILINESTRING in the stream.
MultiLineString | must be a model of RandomAccessRange of Linestring , and have:
|
FT
are supported. CGAL::Point_2
std::istream& CGAL::read_multi_point_WKT | ( | std::istream & | in, |
MultiPoint & | mp | ||
) |
#include <CGAL/IO/WKT.h>
read_multi_point_WKT()
overwrites the content of a MultiPoint
with the first line starting with MULTIPOINT in the stream.
MultiPoint | must be a model of RandomAccessRange of CGAL::Point_2 or CGAL::Point_3 , and have:
|
FT
are supported. CGAL::Point_2
CGAL::Point_3
std::istream& CGAL::read_multi_polygon_WKT | ( | std::istream & | in, |
MultiPolygon & | polygons | ||
) |
#include <CGAL/IO/WKT.h>
read_multi_polygon_WKT()
overwrites the content of a MultiPolygon
with the first line starting with MULTIPOLYGON in the stream.
MultiPolygon | must be a model of RandomAccessRange of CGAL::General_polygon_with_holes_2 , and have:
|
FT
are supported. std::istream& CGAL::read_point_WKT | ( | std::istream & | in, |
Point & | point | ||
) |
#include <CGAL/IO/WKT.h>
read_point_WKT()
fills a Point
from a WKT stream.
The first line starting with POINT in the stream will be used.
Point | can be a CGAL::Point_2 or CGAL::Point_3 . |
FT
are supported. CGAL::Point_2
CGAL::Point_3
std::istream& CGAL::read_polygon_WKT | ( | std::istream & | in, |
Polygon & | polygon | ||
) |
#include <CGAL/IO/WKT.h>
read_polygon_WKT()
fills polygon
from a WKT stream.
The first line starting with POLYGON in the stream will be used.
Polygon | is a CGAL::General_polygon_with_holes_2 . |
FT
are supported. std::istream& CGAL::read_WKT | ( | std::istream & | input, |
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
.
MultiPoint | must be a model of RandomAccessRange of CGAL::Point_2 or CGAL::Point_3 . |
MultiLineString | must be a RandomAccessRange of Linestring . |
MultiPolygon | must be a model of RandomAccessRange of CGAL::General_polygon_with_holes_2 . |
FT
are supported. CGAL::read_linestring_WKT()
IO::Mode CGAL::set_ascii_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
sets the mode of the IO stream s
to be the IO::ASCII
mode.
Returns the previous mode of s
.
IO::Mode CGAL::set_binary_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
CGAL::IO::Mode
CGAL::set_mode()
CGAL::set_ascii_mode()
CGAL::set_pretty_mode()
CGAL::get_mode()
CGAL::is_ascii()
CGAL::is_binary()
CGAL::is_pretty()
sets the mode of the IO stream s
to be the IO::BINARY
mode. Returns the previous mode of s
.
#include <CGAL/IO/io.h>
sets the printing mode of the IO stream s
.
IO::Mode CGAL::set_pretty_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
sets the mode of the IO stream s
to be the IO::PRETTY
mode.
Returns the previous mode of s
.
std::ostream& CGAL::write_linestring_WKT | ( | std::ostream & | out, |
LineString | ls | ||
) |
#include <CGAL/IO/WKT.h>
write_linestring_WKT()
writes the content of ls
into a WKT stream.
LineString | must be a RandomAccessRange of CGAL::Point_2 . |
FT
are supported. CGAL::Point_2
std::ostream& CGAL::write_multi_linestring_WKT | ( | std::ostream & | out, |
MultiLineString & | mls | ||
) |
#include <CGAL/IO/WKT.h>
write_multi_linestring_WKT()
writes the content of mls
into a WKT stream.
MultiLineString | must be a RandomAccessRange of LineString . |
FT
are supported. CGAL::write_linestring_WKT()
std::ostream& CGAL::write_multi_point_WKT | ( | std::ostream & | out, |
MultiPoint & | mp | ||
) |
#include <CGAL/IO/WKT.h>
write_multi_point_WKT()
writes the content of mp
into a WKT stream.
MultiPoint | must be a RandomAccessRange of CGAL::Point_2 . |
FT
are supported. CGAL::Point_2
std::ostream& CGAL::write_multi_polygon_WKT | ( | std::ostream & | out, |
MultiPolygon & | polygons | ||
) |
#include <CGAL/IO/WKT.h>
write_multi_polygon_WKT()
writes the content of polygons
into a WKT stream.
MultiPolygon | must be a RandomAccessRange of CGAL::General_polygon_with_holes_2 . |
FT
are supported. std::ostream& CGAL::write_point_WKT | ( | std::ostream & | out, |
const Point & | point | ||
) |
#include <CGAL/IO/WKT.h>
write_point_WKT()
writes point
into a WKT stream.
Point | is a CGAL::Point_2 |
FT
are supported. CGAL::Point_2
std::ostream& CGAL::write_polygon_WKT | ( | std::ostream & | out, |
const Polygon & | poly | ||
) |
#include <CGAL/IO/WKT.h>
write_polygon_WKT()
writes poly
into a WKT stream.
Polygon | must be a CGAL::General_polygon_with_holes_2 |
FT
are supported.