# CGAL setup
option(USE_SYSTEM_CGAL "Do not build CGAL, but use an existing build instead." OFF)
if (USE_SYSTEM_CGAL)
- find_package(CGAL 5 CONFIG REQUIRED)
+ find_package(CGAL 6 CONFIG REQUIRED)
endif()
# Borrow some cmake modules from cgal
ENDFOREACH (value2)
ENDMACRO(LIST_CONTAINS)
-# Use C++14 to support std:enable_if used by CGAL 5
-set(CMAKE_CXX_STANDARD 14)
+# Use C++17 as required by CGAL 6
+set(CMAKE_CXX_STANDARD 17)
# Boost
# This is workaround to avoid that find_package(Boost)
)
# CMAKE_CXX_STANDARD is ignored ;( Need to set standard manually here.
-set_property(TARGET mshr PROPERTY CXX_STANDARD 14)
+set_property(TARGET mshr PROPERTY CXX_STANDARD 17)
# install library
install(TARGETS mshr
)
# CMAKE_CXX_STANDARD is ignored ;( Need to set standard manually here.
-set_property(TARGET mshrable PROPERTY CXX_STANDARD 14)
+set_property(TARGET mshrable PROPERTY CXX_STANDARD 17)
# install app
install(TARGETS mshrable
auto ii = CGAL::intersection(r, *eit);
if (ii)
{
- if (const Point_2* pt = boost::get<Point_2>(&*ii))
+ Point_2 pt;
+ Segment_2 s;
+ if (CGAL::assign(pt, ii))
{
- const FT squared_distance = CGAL::squared_distance(source, *pt);
+ const FT squared_distance = CGAL::squared_distance(source, pt);
if (squared_distance < min_squared_distance)
{
- closest = *pt;
+ closest = pt;
min_squared_distance = squared_distance;
}
}
- else if (const Segment_2* s = boost::get<Segment_2>(&*ii))
+ else if (CGAL::assign(s, ii))
{
// If the intersection is a segment, an edge in the polygon is paralell
// to the ray. Simply check both the source and the target point of the
// segment.
{
- const FT squared_distance = CGAL::squared_distance(source, s->source());
+ const FT squared_distance = CGAL::squared_distance(source, s.source());
if (squared_distance < min_squared_distance)
{
- closest = s->source();
+ closest = s.source();
min_squared_distance = squared_distance;
}
}
{
- const FT squared_distance = CGAL::squared_distance(source, s->target());
+ const FT squared_distance = CGAL::squared_distance(source, s.target());
if (squared_distance < min_squared_distance)
{
- closest = s->target();
+ closest = s.target();
min_squared_distance = squared_distance;
}
}
if (intersection)
{
- if (boost::get<InexactPoint_2>(&*intersection))
+ InexactPoint_2 pt;
+ InexactSegment_2 s;
+ if (CGAL::assign(pt, intersection))
{
if (j != i+1 && i != (j+1)%vertices.size())
{
return false;
}
}
- else if (boost::get<InexactSegment_2>(&*intersection))
+ else if (CGAL::assign(s, intersection))
{
std::cout << "Intersects in segment" << std::endl;
return false;
if (!result)
return false;
- if (const Point_3* p = boost::get<Point_3>(&*result))
+ Point_3 p;
+ Segment_3 s_;
+ if (CGAL::assign(p, result))
{
- if (*p == t[0] || *p == t[1] || *p == t[2])
+ if (p == t[0] || p == t[1] || p == t[2])
return false;
else
return true;
}
- else if (const Segment_3* s_ = boost::get<Segment_3>(&*result))
+ else if (CGAL::assign(s_, result))
{
if ( (s.source() == t[0] || s.source() == t[1] || s.source() == t[2]) &&
(s.target() == t[0] || s.target() == t[1] || s.target() == t[2]) )
if (!result)
return false;
- if (const Point_3* p = boost::get<Point_3>(&*result))
+ Point_3 p;
+ Segment_3 s;
+ Triangle_3 t;
+ std::vector<Point_3> v;
+ if (CGAL::assign(p, result))
{
if (t1[0] == t2[0] || t1[0] == t2[1] || t1[0] == t2[2] ||
t1[1] == t2[0] || t1[1] == t2[1] || t1[1] == t2[2] ||
else
return true;
}
- else if (const Segment_3* s = boost::get<Segment_3>(&*result))
+ else if (CGAL::assign(s, result))
{
std::size_t common_vertices = 0;
if (t1[0] == t2[0] || t1[0] == t2[1] || t1[0] == t2[2])
else
return true;
}
- else if (const Triangle_3* t = boost::get<Triangle_3>(&*result))
+ else if (CGAL::assign(t, result))
return true;
- else if (const std::vector<Point_3>* v = boost::get<std::vector<Point_3> >(&*result))
+ else if (CGAL::assign(v, result))
return true;
dolfin_assert(false);
auto result = CGAL::intersection(t, s);
dolfin_assert(result);
- if (const Point_3* p = boost::get<Point_3>(&*result))
+ Point_3 p;
+ Segment_3 s;
+ if (CGAL::assign(p, result))
{
- dolfin_assert(*p == s.source() || *p == s.target());
+ dolfin_assert(p == s.source() || p == s.target());
}
- else if (const Segment_3* s = boost::get<Segment_3>(&*result))
+ else if (CGAL::assign(s, result))
{
return true;
}
const auto result = CGAL::intersection(t1, t2);
dolfin_assert(result);
- if (const Segment_3* s = boost::get<Segment_3>(&*result))
+ Segment_3 s;
+ Point_3 p;
+ Triangle_3 t;
+ if (CGAL::assign(s, result))
{
- ss << "Segment: " << *s << std::endl;
+ ss << "Segment: " << s << std::endl;
}
- else if (const Point_3* p = boost::get<Point_3>(&*result))
+ else if (CGAL::assign(p, result))
{
- ss << "Point: " << *p << std::endl;
+ ss << "Point: " << p << std::endl;
}
- else if (const Triangle_3* t = boost::get<Triangle_3>(&*result))
+ else if (CGAL::assign(t, result))
{
- ss << "Triangle: " << *t << std::endl;
+ ss << "Triangle: " << t << std::endl;
}
else
{