From: Sébastien Loriot Date: Mon, 22 Jul 2024 09:24:03 +0000 (+0200) Subject: compatibility with CGAL 6.0 X-Git-Tag: v9.6.0-rc1~15^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b71f8a175973aad56957ef2955daa496bc9eb33d;p=dealii.git compatibility with CGAL 6.0 --- 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());