CGAL 6.3-dev - IO Streams
Loading...
Searching...
No Matches
MEDIT I/O Functions

I/O Functions for the Medit File Format.

Functions

template<class PointRange, class TetrahedronRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_MEDIT (std::istream &is, PointRange &points, TetrahedronRange &tetrahedra, const NamedParameters &np=parameters::default_values())
 reads the content of is into points and tetrahedra using the Medit File Format
template<class PointRange, class TetrahedronRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_MEDIT (std::ostream &os, const PointRange &points, const TetrahedronRange &tetrahedra, const NamedParameters &np=parameters::default_values())
 writes the points and tetrahedra using the Medit File Format

Function Documentation

◆ read_MEDIT()

template<class PointRange, class TetrahedronRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_MEDIT ( std::istream & is,
PointRange & points,
TetrahedronRange & tetrahedra,
const NamedParameters & np = parameters::default_values() )

#include <CGAL/IO/MEDIT.h>

reads the content of is into points and tetrahedra using the Medit File Format

Attention
The tetrahedron soup is not cleared, and the data from the stream are appended.
Template Parameters
PointRangea model of the concept BackInsertionSequence whose value type is the point type
TetrahedronRangea model of the concept BackInsertionSequence whose value_type is std::array<int,4>
Parameters
isthe input stream
pointspoints of the soup of cells
tetrahedraeach element in it describes a tetrahedron using the indices of the points in points
npoptional Named Parameters described below
Optional Named Parameters
  • a non-const reference wrapper to a container of integers that will be filled by this function. Each element in the container indicates the subdomain index of the corresponding tetrahedron at the same position.
  • Type: a std::reference_wrapper to a model of BackInsertionSequence able to store int.
  • Default: subdomains are ignored
  • a non-const reference wrapper to a container of quadruples of integers that will be filled by this function. Each element represents a facet with vertices corresponding to the three first integers, and the last integer being the surface patch index of the facet.
  • Type: a std::reference_wrapper to a model of BackInsertionSequence with a value type constructible using a braced initializer list of four integers.
  • Default: facets are ignored
  • a non-const reference wrapper to a container of triples of integers that will be filled by this function. Each element represents an edge with vertices corresponding to the two first integers, and the last integer being the curve index of the edge.
  • Type: a std::reference_wrapper to a model of BackInsertionSequence with a value type constructible using a braced initializer list of three integers.
  • Default: edges are ignored
  • a non-const reference wrapper to a container of pair of integers that will be filled by this function. Each element represents a corner at the vertex corresponding to the first integer, and the last integer being the corner index.
  • Type: a std::reference_wrapper to a model of BackInsertionSequence with a value type constructible using a braced initializer list of two integers.
  • Default: corners are ignored
  • if true, prints information about the reading process.
  • Type: Boolean
  • Default: false
Returns
true if the reading was successful, false otherwise.
See also
Medit File Format

◆ write_MEDIT()

template<class PointRange, class TetrahedronRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_MEDIT ( std::ostream & os,
const PointRange & points,
const TetrahedronRange & tetrahedra,
const NamedParameters & np = parameters::default_values() )

#include <CGAL/IO/MEDIT.h>

writes the points and tetrahedra using the Medit File Format

Template Parameters
PointRangea model of the concept ConstRange whose value type is the point type
TetrahedronRangea model of the concept ConstRange whose value_type is a model of the concept RandomAccessContainer whose value_type is std::size_t.
Parameters
osthe output stream
pointspoints of the soup of cells
tetrahedraeach element in it describes a cell using the indices of the points in points
npoptional Named Parameters described below
Optional Named Parameters
  • a reference wrapper to a container of integers of the same size as tetrahedra. Each element in the container indicates the subdomain index of the corresponding tetrahedron at the same position.
  • Type: a std::reference_wrapper to a model of the concept SequenceContainer of integer.
  • Default: all tetrahedra will have the subdomain id 1.
  • a const reference wrapper to a container of quadruples of integers that will be written by this function. Each element corresponds to a facet with vertices corresponding to the three first integers, and the last integer being the surface patch index of the facet.
  • Type: a std::reference_wrapper to a model of SequenceContainer with a value type where the elements of the quadruples can be accessed with std::get<int>()
  • Default: facets are ignored
  • a const reference wrapper to a container of triples of integers that will be written by this function. Each element corresponds to an edge with vertices corresponding to the two first integers, and the last integer being the curve index of the edge.
  • Type: a std::reference_wrapper to a model of SequenceContainer with a value type where the elements of the triples can be accessed with std::get<int>()
  • Default: edges are ignored
  • a const reference wrapper to a container of pair of integers that will be written by this function. Each element corresponds to a corner at the vertex corresponding to the first integer, the second integer being the corner index. As Medit has no notion of corner indices it is not written.
  • Type: a std::reference_wrapper to a model of SequenceContainer with a value type where the elements of the pairs can be accessed with std::get<int>()
  • Default: corners are ignored
Returns
true if the writing was successful, false otherwise.
See also
Medit File Format