From 2cbaaab0cc07057542594bdd31655442acdf2fa6 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 31 Aug 2018 14:53:34 +0000 Subject: Fix weighted periodic compilation issue Test is commented, to be investigated. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_3d_module_vincent@3865 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: e334d3f27e648cfc23f2d46fb2e2199a4b1922ff --- src/Alpha_complex/include/gudhi/Alpha_complex_3d.h | 37 ++++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'src/Alpha_complex/include') diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h index 7e2454e5..bbe13be2 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h @@ -90,9 +90,27 @@ class Alpha_complex_3d { CGAL::Exact_predicates_inexact_constructions_kernel, CGAL::Exact_predicates_exact_constructions_kernel>::type; - using Kernel = typename std::conditional, - Predicates>::type; + // The other way to do a conditional type. Here there are 3 possibilities + template struct Kernel_3 {}; + + template < typename Predicates > + struct Kernel_3 { + using Kernel = Predicates; + }; + template < typename Predicates > + struct Kernel_3 { + using Kernel = Predicates; + }; + template < typename Predicates > + struct Kernel_3 { + using Kernel = CGAL::Periodic_3_Delaunay_triangulation_traits_3; + }; + template < typename Predicates > + struct Kernel_3 { + using Kernel = CGAL::Periodic_3_regular_triangulation_traits_3; + }; + + using Kernel = typename Kernel_3::Kernel; using Exact_tag = typename std::conditional<(Complexity == complexity::fast), CGAL::Tag_false, @@ -348,7 +366,7 @@ public: * std::end return an input iterator on a AlphaComplex3dOptions::Alpha_shape_3::FT. * The type of x_min, y_min, z_min, x_max, y_max and z_max is AlphaComplex3dOptions::Alpha_shape_3::FT. */ - /*template + template Alpha_complex_3d(const InputPointRange& points, WeightRange weights, Alpha_value_type x_min, Alpha_value_type y_min, Alpha_value_type z_min, Alpha_value_type x_max, Alpha_value_type y_max, Alpha_value_type z_max) { @@ -364,7 +382,7 @@ public: (z_max - z_min == y_max - y_min), std::invalid_argument("The size of the cuboid in every directions is not the same.")); - using Weighted_point_3 = typename AlphaComplex3dOptions::Weighted_point_3; + using Weighted_point_3 = typename Triangulation_3::Weighted_point; std::vector weighted_points_3; std::size_t index = 0; @@ -372,7 +390,7 @@ public: #ifdef GUDHI_DEBUG // Defined in GUDHI_DEBUG to avoid unused variable warning for GUDHI_CHECK - double maximal_possible_weight = 0.015625 * (x_max - x_min) * (x_max - x_min); + Alpha_value_type maximal_possible_weight = 0.015625 * (x_max - x_min) * (x_max - x_min); #endif while ((index < weights.size()) && (index < points.size())) { @@ -384,10 +402,8 @@ public: index++; } - using Periodic_delaunay_triangulation_3 = typename AlphaComplex3dOptions::Periodic_delaunay_triangulation_3; - using Iso_cuboid_3 = typename AlphaComplex3dOptions::Iso_cuboid_3; // Define the periodic cube - Periodic_delaunay_triangulation_3 pdt(Iso_cuboid_3(x_min, y_min, z_min, x_max, y_max, z_max)); + Triangulation_3 pdt(typename Kernel::Iso_cuboid_3(x_min, y_min, z_min, x_max, y_max, z_max)); // Heuristic for inserting large point sets (if pts is reasonably large) pdt.insert(std::begin(weighted_points_3), std::end(weighted_points_3), true); // As pdt won't be modified anymore switch to 1-sheeted cover if possible @@ -408,7 +424,8 @@ public: #ifdef DEBUG_TRACES std::cout << "filtration_with_alpha_values returns : " << objects_.size() << " objects" << std::endl; #endif // DEBUG_TRACES - }*/ + } + template typename std::enable_if::value, Filtration_value>::type value_from_iterator(Alpha_value_iterator the_alpha_value_iterator) -- cgit v1.2.3