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 CellRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::read_MEDIT (std::istream &is, PointRange &points, CellRange &cells, const NamedParameters &np=parameters::default_values())
 reads the content of is into points and cells using the Medit File Format.
template<class PointRange, class CellRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_MEDIT (std::ostream &os, const PointRange &points, const CellRange &cells, const NamedParameters &np=parameters::default_values())
 writes a soup of indexed cells using the Medit File Format.

Function Documentation

◆ read_MEDIT()

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

#include <CGAL/IO/MEDIT.h>

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

The subdomain index corresponds to what MEDIT calls cell reference, facet patch index corresponds to triangle reference, edge curve index to edge reference, and vertex corner index to vertex reference.

Note
Currently only tetrahedral meshes are supported.
The cell 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
CellRangea model of the concept BackInsertionSequence whose value_type is std::array<int,4>
Parameters
isthe input stream
pointspoints of the soup of cells
cellsa range where each element is a cell described by indices into points
npoptional Named Parameters described below
Optional Named Parameters
  • a non-const reference wrapper of a container of integers that will be filled by this function. Each element in the container indicates the subdomain index of the corresponding cell at the same position.
  • Type: a std::reference_wrapper to a model of BackInsertionSequence able to store int.
  • Default: subdomain_indices are ignored
  • a non-const reference wrapper of a container of quadruples of integers that will be filled by this function. Each element represents a facet with vertices corresponding to the first three 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 of a container of triples of integers that will be filled by this function. Each element represents an edge with vertices corresponding to the first two 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 of 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: vertices 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 CellRange, typename NamedParameters = CGAL::parameters::Default_named_parameters>
bool CGAL::IO::write_MEDIT ( std::ostream & os,
const PointRange & points,
const CellRange & cells,
const NamedParameters & np = parameters::default_values() )

#include <CGAL/IO/MEDIT.h>

writes a soup of indexed cells using the Medit File Format.

The subdomain index corresponds to what MEDIT calls cell reference, facet patch index corresponds to triangle reference, edge curve index to edge reference, and vertex corner index to vertex reference.

Note
Currently only tetrahedral meshes are supported.
Template Parameters
PointRangea model of the concept ConstRange whose value type is the point type
CellRangea 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
cellsa range where each element is a cell described by indices into points
npoptional Named Parameters described below
Optional Named Parameters
  • a const reference wrapper of a container of integers of the same size as cells. Each element in the container indicates the subdomain index of the corresponding cell at the same position.
  • Type: a std::reference_wrapper to a model of the concept SequenceContainer of integer.
  • Default: all cells will be given the subdomain index 1.
  • a const reference wrapper of 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 not written
  • a const reference wrapper of 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 not written
  • a const reference wrapper of 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.
  • 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: vertices are not written
Returns
true if the writing was successful, false otherwise.
See also
Medit File Format