summaryrefslogtreecommitdiff
path: root/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp')
-rw-r--r--src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
index 92fed4c1..85b0ab34 100644
--- a/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
+++ b/src/Persistent_cohomology/example/weighted_alpha_complex_3d_persistence.cpp
@@ -26,11 +26,17 @@
#include <gudhi/Persistent_cohomology.h>
#include <gudhi/Points_3D_off_io.h>
+#include <CGAL/config.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/iterator.h>
+// For CGAL < 4.11
+#if CGAL_VERSION_NR < 1041100000
+#include <CGAL/Regular_triangulation_euclidean_traits_3.h>
+#endif // CGAL_VERSION_NR < 1041100000
+
#include <fstream>
#include <cmath>
#include <string>
@@ -44,17 +50,34 @@
#include "alpha_complex_3d_helper.h"
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
+
+// For CGAL < 4.11
+#if CGAL_VERSION_NR < 1041100000
+using Gt = CGAL::Regular_triangulation_euclidean_traits_3<Kernel>;
+using Vb = CGAL::Alpha_shape_vertex_base_3<Gt>;
+using Fb = CGAL::Alpha_shape_cell_base_3<Gt>;
+using Tds = CGAL::Triangulation_data_structure_3<Vb, Fb>;
+using Triangulation_3 = CGAL::Regular_triangulation_3<Gt, Tds>;
+
+// From file type definition
+using Point_3 = Gt::Bare_point;
+using Weighted_point_3 = Gt::Weighted_point;
+
+// For CGAL >= 4.11
+#else // CGAL_VERSION_NR < 1041100000
using Rvb = CGAL::Regular_triangulation_vertex_base_3<Kernel>;
using Vb = CGAL::Alpha_shape_vertex_base_3<Kernel,Rvb>;
using Rcb = CGAL::Regular_triangulation_cell_base_3<Kernel>;
using Cb = CGAL::Alpha_shape_cell_base_3<Kernel,Rcb>;
using Tds = CGAL::Triangulation_data_structure_3<Vb,Cb>;
using Triangulation_3 = CGAL::Regular_triangulation_3<Kernel,Tds>;
-using Alpha_shape_3 = CGAL::Alpha_shape_3<Triangulation_3>;
// From file type definition
using Point_3 = Triangulation_3::Bare_point;
using Weighted_point_3 = Triangulation_3::Weighted_point;
+#endif // CGAL_VERSION_NR < 1041100000
+
+using Alpha_shape_3 = CGAL::Alpha_shape_3<Triangulation_3>;
// filtration with alpha values needed type definition
using Alpha_value_type = Alpha_shape_3::FT;