Fixed compilation issues and warnings.

This commit is contained in:
Vojtech Bubnik 2023-01-03 12:57:58 +01:00
parent fbed29e209
commit 62771bf9c1
3 changed files with 19 additions and 10 deletions

View File

@ -1793,7 +1793,7 @@ public:
enum_values.reserve(il.size()); enum_values.reserve(il.size());
enum_labels.clear(); enum_labels.clear();
enum_labels.reserve(il.size()); enum_labels.reserve(il.size());
for (const std::pair<std::string_view, std::string_view> p : il) { for (const std::pair<std::string_view, std::string_view> &p : il) {
enum_values.emplace_back(p.first); enum_values.emplace_back(p.first);
enum_labels.emplace_back(p.second); enum_labels.emplace_back(p.second);
} }

View File

@ -94,6 +94,19 @@ BoundingBox get_extents(const Points &pts)
template BoundingBox get_extents<false>(const Points &pts); template BoundingBox get_extents<false>(const Points &pts);
template BoundingBox get_extents<true>(const Points &pts); template BoundingBox get_extents<true>(const Points &pts);
// if IncludeBoundary, then a bounding box is defined even for a single point.
// otherwise a bounding box is only defined if it has a positive area.
template<bool IncludeBoundary>
BoundingBox get_extents(const std::vector<Points> &pts)
{
BoundingBox bbox;
for (const Points &p : pts)
bbox.merge(get_extents<IncludeBoundary>(p));
return bbox;
}
template BoundingBox get_extents<false>(const std::vector<Points> &pts);
template BoundingBox get_extents<true>(const std::vector<Points> &pts);
BoundingBoxf get_extents(const std::vector<Vec2d> &pts) BoundingBoxf get_extents(const std::vector<Vec2d> &pts)
{ {
BoundingBoxf bbox; BoundingBoxf bbox;

View File

@ -233,19 +233,15 @@ inline Point lerp(const Point &a, const Point &b, double t)
// otherwise a bounding box is only defined if it has a positive area. // otherwise a bounding box is only defined if it has a positive area.
template<bool IncludeBoundary = false> template<bool IncludeBoundary = false>
BoundingBox get_extents(const Points &pts); BoundingBox get_extents(const Points &pts);
extern template BoundingBox get_extents<false>(const Points& pts); extern template BoundingBox get_extents<false>(const Points &pts);
extern template BoundingBox get_extents<true>(const Points& pts); extern template BoundingBox get_extents<true>(const Points &pts);
// if IncludeBoundary, then a bounding box is defined even for a single point. // if IncludeBoundary, then a bounding box is defined even for a single point.
// otherwise a bounding box is only defined if it has a positive area. // otherwise a bounding box is only defined if it has a positive area.
template<bool IncludeBoundary = false> template<bool IncludeBoundary = false>
BoundingBox get_extents(const std::vector<Points> &pts) BoundingBox get_extents(const std::vector<Points> &pts);
{ extern template BoundingBox get_extents<false>(const std::vector<Points> &pts);
BoundingBox bbox; extern template BoundingBox get_extents<true>(const std::vector<Points> &pts);
for (const Points &p : pts)
bbox.merge(get_extents<IncludeBoundary>(p));
return bbox;
}
BoundingBoxf get_extents(const std::vector<Vec2d> &pts); BoundingBoxf get_extents(const std::vector<Vec2d> &pts);