From fa14310c41827060a3cf1ccd3e14e2d91edbce2c Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 31 Jan 2020 16:00:42 +0100 Subject: [PATCH] Add a test --- Convex_hull_3/include/CGAL/convex_hull_3.h | 8 +++-- .../Convex_hull_3/test_ch_3_ambiguity.cpp | 32 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 22f1222c204..ef4267cf286 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include #include @@ -1038,7 +1040,10 @@ void convex_hull_3(InputIterator first, InputIterator beyond, template void convex_hull_3(InputIterator first, InputIterator beyond, - Polyhedron_3& polyhedron) + Polyhedron_3& polyhedron, + typename std::enable_if< + CGAL::is_iterator::value + >::type* =0) //workaround to avoid ambiguity with next overload. { typedef typename std::iterator_traits::value_type Point_3; typedef typename internal::Convex_hull_3::Default_traits_for_Chull_3::type Traits; @@ -1056,7 +1061,6 @@ void convex_hull_3(const VertexListGraph& g, Vpmap vpm = CGAL::parameters::choose_parameter(CGAL::parameters::get_parameter(np, internal_np::vertex_point), get_const_property_map(boost::vertex_point, g)); - Vpmap_fct v2p(vpm); convex_hull_3( boost::make_transform_iterator(vertices(g).begin(), v2p), diff --git a/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp b/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp new file mode 100644 index 00000000000..4091ec56265 --- /dev/null +++ b/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include +#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Polyhedron_3 Polyhedron_3; +typedef K::Point_3 Point_3; +typedef CGAL::Surface_mesh Surface_mesh; + + +int main(int argc, char* argv[]) +{ + std::ifstream in( (argc>1)? argv[1] : "data/cross.off"); + + Surface_mesh poly; + if(!(in >> poly)) + { + std::cerr<<"Could not find input file."<