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. In CGAL we distinguish between a raw ASCII, a raw binary and a pretty printing format.
|
The first one just writes number, e.g. the coordinates of a point or the coefficients of a line in a machine independent format. The second one writes the data in a binary format, e.g. a double is represented as a sequence of four byte. The format depends on the machine. The last one 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.
CGAL provides the following functions to modify the mode of an IO stream.
|
| |
|
| |
|
| |
|
|
The following functions allow to test whether a stream is in a certain mode.
|
| |
|
| |
|
| |
|
|