Commit cb7fd612 authored by Jordan Musser's avatar Jordan Musser
Browse files

Add support for CGAL versions >= v6

parent fc00c787
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
#include "csg_exception.hpp"

#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
#include <CGAL/Polyhedron_incremental_builder_3.h>
@@ -11,6 +10,12 @@
#include <CGAL/convex_hull_3.h>
#include <CGAL/point_generators_3.h>

#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0)
#include <CGAL/AABB_traits_3.h>
#else
#include <CGAL/AABB_traits.h>
#endif

namespace {

typedef cgal_helper::Polyhedron::HalfedgeDS HalfedgeDS;
+9 −1
Original line number Diff line number Diff line
#ifndef CGAL_HELPER_H_
#define CGAL_HELPER_H_

#include <CGAL/version.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polyhedron_3.h>
@@ -15,9 +16,16 @@ typedef CGAL::Polyhedron_3<CK> Polyhedron;
typedef CGAL::Polygon_2<CK> Polygon;
typedef CGAL::AABB_face_graph_triangle_primitive<cgal_helper::Polyhedron>
    Primitive;

#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0)
  typedef CGAL::AABB_traits_3<cgal_helper::CK, Primitive> Traits;
#else
  typedef CGAL::AABB_traits<cgal_helper::CK, Primitive> Traits;
#endif

typedef CGAL::AABB_tree<Traits> AABBTree;


std::shared_ptr<Polyhedron>
create_polyhedron(const std::vector<std::tuple<double, double, double>> &points,
                  const std::vector<std::vector<unsigned int>> &faces);