CGAL 6.3-dev - Homological Discrete Vector Fields
Loading...
Searching...
No Matches

Definition

The concept GeometricChainComplex refines the concept AbstractChainComplex and describes the requirements for (topological) chain complexes associated to geometric complexes used in the concept HDVF. It adds to AbstractChainComplex methods to get vertex coordinates.

Refines
AbstractChainComplex
Has models
CGAL::Homological_discrete_vector_field::Simplicial_chain_complex<CoefficientRing,Traits>
CGAL::Homological_discrete_vector_field::Cubical_chain_complex<CoefficientRing,Traits>

Types

typedef unspecified_type Point
 Type of points.

Access functions

const std::vector< Point > & points () const
 Returns the vector of vertex coordinates.
Point point (size_t i) const
 Returns the coordinates of the cell of index i and dimension 0.

VTK export

template<typename LabelType = int>
void write_VTK (const GeometricChainComplex &K, const std::string &filename, const std::vector< std::vector< LabelType > > *labels=NULL, std::string label_type_name="int")
 Exports a GeometricChainComplex (plus, optionally, labels) to a VTK file.
void write_VTK (const GeometricChainComplex &K, const std::string &filename, const Column_chain &chain, int q, size_t cellId)
 Exports a column chain chain over a GeometricChainComplex to a VTK file.

Member Function Documentation

◆ write_VTK()

template<typename LabelType = int>
void GeometricChainComplex::write_VTK ( const GeometricChainComplex & K,
const std::string & filename,
const std::vector< std::vector< LabelType > > * labels = NULL,
std::string label_type_name = "int" )

Exports a GeometricChainComplex (plus, optionally, labels) to a VTK file.

The method generates legacy text VTK files. Labels are exported as such in a VTK property, together with CellID property, containing the index of each cell.

Template Parameters
CoefficientRingCoefficient ring of the underlying complex K.
TraitsTraits class of the underlying complex K.
LabelTypeType of labels provided (default: int).
Parameters
KGeometricChainComplex exported.
filenameOutput file root (output filenames will be built from this root).
labelsPointer to a vector of labels in each dimension. labels->at(q) is the set of integer labels of cells of dimension q. If labels is NULL, only CellID property is exported.
label_type_nameTypename used in VTK export (e.g. "int" or "unsigned_long", see VTK manual ).
Exceptions
File_not_foundIf the file `filename` cannot be created and opened, throw a `std::runtime_error` exception.

◆ write_VTK

void write_VTK ( const GeometricChainComplex & K,
const std::string & filename,
const Column_chain & chain,
int q,
size_t cellId )
friend

Exports a column chain chain over a GeometricChainComplex to a VTK file.

Exports cells of chain with a non null coefficient to a VTK file, with a distinguished cell (for instance the underlying critical cell to a generator). Two properties are exported:

  • the Label property (2 for the distinguished cell, 0 for other cells)
  • the CellId property containing the "basis" index of the cell.
Parameters
KUnderlying GeometricChainComplex.
filenameOutput file name.
chainColumn chain exported to VTK.
qDimension of the chain.
cellIdIndex of the distinguished cell.
Exceptions
File_not_foundIf the file `filename` cannot be created and opened, throw a `std::runtime_error` exception.