#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_mesh_processing/corefinement.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <fstream>
#include <iostream>
int main(int argc, char* argv[])
{
const char* filename1 = (argc > 1) ? argv[1] : "data/blobby.off";
const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off";
Mesh mesh1, mesh2;
{
std::cerr << "Invalid input." << std::endl;
return 1;
}
Mesh out_union, out_intersection;
std::array<boost::optional<Mesh*>, 4> output;
output[PMP::Corefinement::UNION] = &out_union;
output[PMP::Corefinement::INTERSECTION] = &out_intersection;
std::array<bool, 4> res =
mesh1, mesh2,
output,
params::all_default(),
std::make_tuple(
params::vertex_point_map(get(boost::vertex_point, out_union)),
params::vertex_point_map(get(boost::vertex_point, out_intersection)),
params::all_default(),
params::all_default() )
);
if (res[PMP::Corefinement::UNION])
{
std::cout << "Union was successfully computed\n";
}
else
std::cout << "Union could not be computed\n";
if (res[PMP::Corefinement::INTERSECTION])
{
std::cout << "Intersection was successfully computed\n";
}
else
std::cout << "Intersection could not be computed\n";
return 0;
}