Also test EPEC in the testsuite

This commit is contained in:
Andreas Fabri
2016-06-14 14:17:26 +02:00
committed by Jane Tournois
parent 73fb767025
commit 702149cd93
18 changed files with 322 additions and 156 deletions
@@ -1,4 +1,5 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
@@ -20,18 +21,18 @@
#include <boost/foreach.hpp>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point;
typedef K::FT FT;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::Surface_mesh<Point> Surface_mesh;
namespace PMP = CGAL::Polygon_mesh_processing;
template<typename Mesh>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
typedef CGAL::Exact_predicates_exact_constructions_kernel Epec;
template<typename Mesh, typename K>
void test(const Mesh& pmesh)
{
typedef K::Point_3 Point;
typedef K::FT FT;
typedef typename boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<Mesh>::face_descriptor face_descriptor;
@@ -100,6 +101,7 @@ void test(const Mesh& pmesh)
}
template <typename Polyhedron, typename K>
void test_polyhedron(const char* filename)
{
//run test for a Polyhedron
@@ -114,9 +116,10 @@ void test_polyhedron(const char* filename)
return;
}
test(poly);
test<Polyhedron,K>(poly);
}
template <typename Surface_mesh, typename K>
void test_closed_surface_mesh(const char* filename)
{
Surface_mesh sm;
@@ -130,9 +133,9 @@ void test_closed_surface_mesh(const char* filename)
return;
}
test(sm);
test<Surface_mesh,K>(sm);
FT vol = PMP::volume(sm);
typename K::FT vol = PMP::volume(sm);
std::cout << "volume = " << vol << std::endl;
}
@@ -140,11 +143,13 @@ int main(int argc, char* argv[])
{
const char* filename_polyhedron =
(argc > 1) ? argv[1] : "data/mech-holes-shark.off";
test_polyhedron(filename_polyhedron);
test_polyhedron<CGAL::Polyhedron_3<Epic>,Epic>(filename_polyhedron);
test_polyhedron<CGAL::Polyhedron_3<Epec>,Epec>(filename_polyhedron);
const char* filename_surface_mesh =
(argc > 1) ? argv[1] : "data/elephant.off";
test_closed_surface_mesh(filename_surface_mesh);
test_closed_surface_mesh<CGAL::Surface_mesh<Epic::Point_3>,Epic>(filename_surface_mesh);
test_closed_surface_mesh<CGAL::Surface_mesh<Epec::Point_3>,Epec>(filename_surface_mesh);
std::cerr << "All done." << std::endl;
return 0;