#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>
namespace HDVF = CGAL::Homological_discrete_vector_field;
typedef HDVF::Hdvf_traits_3<Kernel> Traits;
int main(int argc, char **argv)
{
using Complex = HDVF::Cubical_chain_complex<Coefficient_ring, Traits, CGAL::OSM::Sparse_matrix_structure<CGAL::OSM::Sparse_chain> > ;
using HDVF_type = HDVF::Hdvf<Complex> ;
std::string filename ;
if (argc > 2) std::cout << "usage: hdvf_cubical pgm_file" << std::endl;
else if (argc == 1) filename = "data/data_cubical/Eight_3D.pgm";
else filename = argv[1];
std::cout << "Loading file: " << filename << std::endl;
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();
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:47
const Chain_complex & complex() const
Gets a constant reference over the underlying chain complex.
Complex::Coefficient_ring Coefficient_ring
Type of coefficients used to compute homology (a model of IntegralDomainWithoutDivision).
Definition HDVF.h:83
unspecified_type Complex
Type of underlying chain complex (a model of AbstractChainComplex).
Definition HDVF.h:80
const int OPT_FULL
HDVF computation option: compute the full reduction.
Definition HDVF.h:59