#include <iostream>
#include <fstream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/HDVF/Hdvf_traits_3.h>
#include <CGAL/HDVF/Hdvf_traits_2.h>
#include <CGAL/HDVF/Cub_object_io.h>
#include <CGAL/HDVF/Cubical_chain_complex.h>
#include <CGAL/HDVF/Geometric_chain_complex_tools.h>
#include <CGAL/HDVF/Hdvf.h>
#include <CGAL/OSM/OSM.h>
typedef HDVF::Hdvf_traits_2<Kernel> Traits;
int main(int argc, char **argv)
{
using Complex = HDVF::Cubical_chain_complex<Coefficient_ring, Traits> ;
using HDVF_type = HDVF::Hdvf<Complex> ;
std::string filename ;
if (argc > 2) std::cout << "usage: example_hdvf_cubical pgm_file" << std::endl;
else if (argc == 1) filename = "data/cub_data/Eight_3D.pgm";
else filename = argv[1];
const Complex::Cubical_complex_primal_dual primal_dual = Complex::PRIMAL;
const bool khalimsky_coords = (primal_dual == Complex::PRIMAL) ? true : false ;
HDVF::Cub_object_io<Traits> mesh ;
mesh.read_pgm(filename, khalimsky_coords);
mesh.print_infos();
Complex complex(mesh, primal_dual);
std::cout << complex;
HDVF_type hdvf(complex, HDVF::OPT_FULL) ;
hdvf.compute_perfect_hdvf();
hdvf.write_matrices();
hdvf.write_reduction();
CGAL::IO::write_VTK(hdvf, complex, "tmp/res", true) ;
return 0;
}
The concept HDVF describes the requirements for Homological Discrete Vector Fields (HDVF for short) ,...
Definition: HDVF.h:128
Complex::Coefficient_ring Coefficient_ring
Type of coefficients used to compute homology.
Definition: HDVF.h:139
unspecified_type Complex
Type of underlying chain complex (a model of AbstractChainComplex).
Definition: HDVF.h:136
Definition: Abstract_simplicial_chain_complex.h:25