Add test for LCC

This commit is contained in:
Guillaume Damiand 2016-03-25 18:39:12 +01:00
parent ebd54153ea
commit 8ece528538
2 changed files with 31 additions and 0 deletions

View File

@ -381,6 +381,7 @@ int main()
{
test_Euler_operations<Polyhedron>();
test_Euler_operations<SM>();
test_Euler_operations<LCC>();
#ifdef CGAL_USE_OPENMESH
test_Euler_operations<OMesh>();

View File

@ -15,6 +15,11 @@
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/boost/graph/properties_Linear_cell_complex.h>
#ifdef CGAL_USE_SURFACE_MESH
#include <CGAL/Surface_mesh.h>
#include <CGAL/Surface_mesh/IO.h>
@ -33,6 +38,23 @@ typedef Kernel::Vector_3 Vector_3;
typedef Kernel::Triangle_3 Triangle_3;
typedef Kernel::Iso_cuboid_3 Iso_cuboid_3;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Dart<2, Refs > Dart;
typedef CGAL::Cell_attribute_with_point< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex<2, 3, MyTraits, Myitem> LCC;
#ifdef CGAL_USE_SURFACE_MESH
typedef CGAL::Surface_mesh<Point_3> SM;
#endif
@ -119,6 +141,14 @@ bool read_a_mesh(Polyhedron& p, const std::string& str) {
return success;
}
bool read_a_mesh(LCC& lcc, const std::string& str) {
std::ifstream in(str.c_str());
bool success = in.good();
if(success)
CGAL::load_off(lcc, in);
return success;
}
template <typename T>
std::vector<T> t_data()
{