CGAL 5.6.3 - CGAL and the Boost Graph Library

Loading...
Searching...
No Matches
Functions
VTP I/O Functions
CGAL and the Boost Graph Library Reference » I/O Functions

##

I/O Functions for the VTK (VTU / VTP) File Formats.

## Functions
template<typename Graph , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::read_VTP (const std::string &fname, Graph &g, const NamedParameters &np=parameters::default_values())
| reads a PolyData in the VTK (VTU / VTP) File Formats into a triangulated surface mesh.
template<typename Graph , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::write_VTP (std::ostream &os, const Graph &g, const NamedParameters &np=parameters::default_values())
| writes a triangulated surface mesh in the `PolyData` XML format (VTK (VTU / VTP) File Formats).
template<typename Graph , typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool | CGAL::IO::write_VTP (const std::string &fname, const Graph &g, const NamedParameters &np=parameters::default_values())
| writes a triangulated surface mesh the file `fname`, in the `PolyData` XML format (VTK (VTU / VTP) File Formats).

## Function Documentation

## ◆ read_VTP()

template<typename Graph , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::read_VTP | ( | const std::string & | fname,
|  | Graph & | g,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/boost/graph/IO/VTK.h>`

reads a PolyData in the VTK (VTU / VTP) File Formats into a triangulated surface mesh.

The data is expected to represent a 2-manifold (possibly with borders).

Attention
  The graph `g` is not cleared, and the data from the file are appended.

Template Parameters

  Graph | a model of `MutableFaceGraph`
  NamedParameters | a sequence of Named Parameters

Parameters

  fname | the path to the file that will be read
  g | the output mesh
  np | optional Named Parameters described below

Optional Named Parameters

  a property map associating points to the vertices of `g` Type: a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, g)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `Graph`. |

Returns
  `true` if reading was successful, `false` otherwise.

## ◆ write_VTP() [1/2]

template<typename Graph , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::write_VTP | ( | const std::string & | fname,
|  | const Graph & | g,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/boost/graph/IO/VTK.h>`

writes a triangulated surface mesh the file `fname`, in the `PolyData` XML format (VTK (VTU / VTP) File Formats).

Template Parameters

  Graph | a model of `FaceListGraph`
  NamedParameters | a sequence of Named Parameters

Parameters

  fname | the name of the output file
  g | the triangle mesh to be output
  np | optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  indicates whether data should be written in binary (`true`) or in ASCII (`false`) Type: Boolean Default: `true` |
  a property map associating points to the vertices of `g` Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, g)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `Graph`. |
  a property map associating to each vertex of `graph` a unique index between `0` and `num_vertices(graph) - 1` Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::vertex_descriptor` as key type and `std::size_t` as value type Default: no vertex indices in the output |
  a parameter used to set the precision (i.e. how many digits are generated) of the output stream Type: int Default: `6` |

Precondition
  `g` contains only triangular faces

Returns
  `true` if writing was successful, `false` otherwise.

## ◆ write_VTP() [2/2]

template<typename Graph , typename NamedParameters = CGAL::parameters::Default_named_parameters>

bool CGAL::IO::write_VTP | ( | std::ostream & | os,
|  | const Graph & | g,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/boost/graph/IO/VTK.h>`

writes a triangulated surface mesh in the `PolyData` XML format (VTK (VTU / VTP) File Formats).

Template Parameters

  Graph | a model of `FaceListGraph`
  NamedParameters | a sequence of Named Parameters

Parameters

  os | the output stream
  g | the triangle mesh to be output
  np | optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

  indicates whether data should be written in binary (`true`) or in ASCII (`false`) Type: Boolean Default: `true` |
  a property map associating points to the vertices of `g` Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::vertex_descriptor` as key type and `Point_3` as value type Default: `boost::get(CGAL::vertex_point, g)` Extra: If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `Graph`. |
  a property map associating to each vertex of `graph` a unique index between `0` and `num_vertices(graph) - 1` Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::vertex_descriptor` as key type and `std::size_t` as value type Default: no vertex indices in the output |
  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` |

Precondition
  `g` contains only triangular faces

Returns
  `true` if writing was successful, `false` otherwise.