CGAL 6.2 - 3D Triangulation Data Structure

Loading...
Searching...
No Matches
I/O for a Triangulation_data_structure_3
Reference Manual

##

## I/O
istream & | TriangulationDataStructure_3::operator>> (istream &is, TriangulationDataStructure_3 &tds)
| Reads a combinatorial triangulation from `is` and assigns it to `tds`
ostream & | TriangulationDataStructure_3::operator<< (ostream &os, const TriangulationDataStructure_3 &tds)
| Writes `tds` into the stream `os`
template<typename TDS_src , typename ConvertVertex , typename ConvertCell >
std::istream & | TriangulationDataStructure_3::file_input (std::istream &is, ConvertVertex convert_vertex, ConvertCell convert_cell)
| The triangulation data structure streamed in `is`, of original type `TDS_src`, is written into the triangulation data structure.

## Function Documentation

## ◆ file_input()

template<typename TDS_src , typename ConvertVertex , typename ConvertCell >

std::istream & TriangulationDataStructure_3::file_input | ( | std::istream & | is,
|  | ConvertVertex | convert_vertex,
|  | ConvertCell | convert_cell
| ) |  |

`#include <Concepts/TriangulationDataStructure_3.h>`

The triangulation data structure streamed in `is`, of original type `TDS_src`, is written into the triangulation data structure.

As the vertex and cell types might be different and incompatible, the creation of new cells and vertices is made thanks to the functors `convert_vertex` and `convert_cell`, that convert vertex and cell types. For each vertex `v_src` in `is`, the corresponding vertex `v_tgt` in the triangulation data structure is a copy of the vertex returned by `convert_vertex(v_src)`. The same operations are done for cells with the functor convert_cell, except cells in the triangulation data structure are created using the default constructor, and then filled with the data contained in the stream.

- A model of `ConvertVertex` must provide two `operator()`s that are responsible for converting the source vertex `v_src` into the target vertex:
  - `Vertex operator()(const TDS_src::Vertex& v_src) const;` This operator is used to create the vertex from `v_src`.
  - `void operator()(const TDS_src::Vertex& v_src, Vertex& v_tgt) const;` This operator is meant to be used in case heavy data should be transferred to `v_tgt`.
- A model of ConvertCell must provide an operator() that is responsible for converting the source cell `c_src` into the target cell:
  - `void operator()(const TDS_src::Cell& c_src, Cell& c_tgt) const;` This operator is meant to be used in case heavy data should be transferred to `c_tgt`.

Note
  The triangulation data structure contained in `is` can be obtained with the `operator>>` of a `TriangulationDataStructure_3`.