mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 09:32:46 +00:00
svgfill: use std::optional instead of transitive boost::optional
Graph2D::query and arrange_polygons relied on boost::optional reaching them transitively through CGAL/boost headers. That transitive include no longer happens on newer toolchains (GCC 14 / newer libstdc++), so the build breaks with "boost::optional does not name a template type". The rest of the svgfill module already uses std::optional; migrate these two holdouts to match and include <optional> explicitly rather than freeload on a fragile transitive include. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
#include "graph_2d.h"
|
#include "graph_2d.h"
|
||||||
|
|
||||||
@@ -2313,8 +2314,8 @@ extend_end_vertices_based_on_input_simple(
|
|||||||
CGAL::Ray_2<K> ray(incoming, M - incoming);
|
CGAL::Ray_2<K> ray(incoming, M - incoming);
|
||||||
|
|
||||||
// intersect ray with boundary
|
// intersect ray with boundary
|
||||||
boost::optional<CGAL::Segment_2<K>> closest_segment;
|
std::optional<CGAL::Segment_2<K>> closest_segment;
|
||||||
boost::optional<CGAL::Point_2<K>> closest_intersection_point;
|
std::optional<CGAL::Point_2<K>> closest_intersection_point;
|
||||||
K::FT sq_distance_along_ray = std::numeric_limits<double>::infinity();
|
K::FT sq_distance_along_ray = std::numeric_limits<double>::infinity();
|
||||||
for (auto jt = bnd.edges_begin(); jt != bnd.edges_end(); ++jt) {
|
for (auto jt = bnd.edges_begin(); jt != bnd.edges_end(); ++jt) {
|
||||||
const auto& seg = *jt;
|
const auto& seg = *jt;
|
||||||
@@ -2345,7 +2346,7 @@ extend_end_vertices_based_on_input_simple(
|
|||||||
|
|
||||||
// Loop over boundary segments, and project point onto it, take the closest
|
// Loop over boundary segments, and project point onto it, take the closest
|
||||||
K::FT closest_distance = std::numeric_limits<double>::infinity();
|
K::FT closest_distance = std::numeric_limits<double>::infinity();
|
||||||
boost::optional<CGAL::Point_2<K>> closest_point;
|
std::optional<CGAL::Point_2<K>> closest_point;
|
||||||
for (auto& poly : outer_perimiter) {
|
for (auto& poly : outer_perimiter) {
|
||||||
for (auto jt = poly.edges_begin(); jt != poly.edges_end(); ++jt) {
|
for (auto jt = poly.edges_begin(); jt != poly.edges_end(); ++jt) {
|
||||||
auto seg = *jt;
|
auto seg = *jt;
|
||||||
@@ -2395,7 +2396,7 @@ extend_end_vertices_based_on_input_simple(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (bnd.has_on_boundary(M)) {
|
} else if (bnd.has_on_boundary(M)) {
|
||||||
return boost::optional<Point_2>{M};
|
return std::optional<Point_2>{M};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (within_any_perimeter) {
|
if (within_any_perimeter) {
|
||||||
@@ -2403,7 +2404,7 @@ extend_end_vertices_based_on_input_simple(
|
|||||||
} else {
|
} else {
|
||||||
logger.message(::logger::LOG_WARNING, "ARR", 3, "Point is outside all boundaries");
|
logger.message(::logger::LOG_WARNING, "ARR", 3, "Point is outside all boundaries");
|
||||||
}
|
}
|
||||||
return boost::optional<Point_2>{};
|
return std::optional<Point_2>{};
|
||||||
};
|
};
|
||||||
|
|
||||||
using solution_length_point_incoming = std::tuple<K::FT, Point_2, Point_2>;
|
using solution_length_point_incoming = std::tuple<K::FT, Point_2, Point_2>;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
template <typename Kernel>
|
template <typename Kernel>
|
||||||
class Graph2D {
|
class Graph2D {
|
||||||
public:
|
public:
|
||||||
@@ -56,8 +58,8 @@ public:
|
|||||||
return adjacency_list.find(p);
|
return adjacency_list.find(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional< CGAL::Segment_2<Kernel> > query(const Point_2& p, typename Kernel::FT eps) {
|
std::optional< CGAL::Segment_2<Kernel> > query(const Point_2& p, typename Kernel::FT eps) {
|
||||||
boost::optional< CGAL::Segment_2<Kernel> > closest_segment;
|
std::optional< CGAL::Segment_2<Kernel> > closest_segment;
|
||||||
typename Kernel::FT closest_distance = std::numeric_limits<double>::infinity();
|
typename Kernel::FT closest_distance = std::numeric_limits<double>::infinity();
|
||||||
for (auto& p1 : adjacency_list) {
|
for (auto& p1 : adjacency_list) {
|
||||||
for (auto& p2 : p1.second) {
|
for (auto& p2 : p1.second) {
|
||||||
|
|||||||
Reference in New Issue
Block a user