From b71f8a175973aad56957ef2955daa496bc9eb33d Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jul 2024 11:24:03 +0200 Subject: [PATCH] compatibility with CGAL 6.0 --- source/cgal/intersections.cc | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/source/cgal/intersections.cc b/source/cgal/intersections.cc index a71b5a305d..3bdf3bf481 100644 --- a/source/cgal/intersections.cc +++ b/source/cgal/intersections.cc @@ -100,6 +100,20 @@ namespace CGALWrappers using Vertex_handle = CDT::Vertex_handle; using Face_handle = CDT::Face_handle; + template + const T * + get_if_(const std::variant *v) + { + return std::get_if(v); + } + + template + const T * + get_if_(const boost::variant *v) + { + return boost::get(v); + } + namespace internal { namespace @@ -146,6 +160,13 @@ namespace CGALWrappers return {}; } } + + template + const std::optional> & + convert_boost_to_std(const std::optional> &opt) + { + return opt; + } } // namespace @@ -489,8 +510,7 @@ namespace CGALWrappers { const auto intersection = CGAL::intersection(segm, cdt.triangle(f)); - if (const CGALSegment2 *s = - boost::get(&*intersection)) + if (const CGALSegment2 *s = get_if_(&*intersection)) { vertices.push_back( {{CGALWrappers::cgal_point_to_dealii_point<2>((*s)[0]), @@ -538,7 +558,7 @@ namespace CGALWrappers const auto intersection = CGAL::intersection(cgal_segment, cgal_tetrahedron); if (const CGALSegment3_exact *s = - boost::get(&*intersection)) + get_if_(&*intersection)) { if (s->squared_length() > tol * tol) { @@ -610,7 +630,7 @@ namespace CGALWrappers CGAL::intersection(triangulation_quad.triangle(f), tet); if (const CGALTriangle3_exact *t = - boost::get(&*intersection)) + get_if_(&*intersection)) { if (CGAL::to_double(t->squared_area()) > tol * tol) { @@ -622,8 +642,7 @@ namespace CGALWrappers } if (const std::vector *vps = - boost::get>( - &*intersection)) + get_if_>(&*intersection)) { Triangulation3_exact tria_inter; tria_inter.insert(vps->begin(), vps->end()); -- 2.39.5