Skip to content

Commit c45c3b7

Browse files
committed
chore: fix warnings
1 parent 790580f commit c45c3b7

File tree

5 files changed

+205
-5
lines changed

5 files changed

+205
-5
lines changed

include/boost/geometry/algorithms/detail/overlay/graph/assign_counts.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,22 @@ void assign_counts(Turn& turn)
8080
}
8181
};
8282

83-
auto assign_left_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
83+
auto assign_left_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
8484
{
8585
assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_left = count; });
8686
};
8787

88-
auto assign_right_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
88+
auto assign_right_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
8989
{
9090
assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_right = count; });
9191
};
9292

93-
auto assign_left_incoming_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
93+
auto assign_left_incoming_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
9494
{
9595
assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_left_incoming = count; });
9696
};
9797

98-
auto assign_right_incoming_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
98+
auto assign_right_incoming_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2)
9999
{
100100
assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_right_incoming = count; });
101101
};

include/boost/geometry/algorithms/detail/overlay/graph/detect_biconnected_components.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ template <typename Turns, typename Clusters, typename Graph, typename Components
162162
void assign_biconnected_component_ids(Turns& turns, Clusters const& clusters, bool allow_closed,
163163
Graph const& graph, Components const& component, state_type const& state)
164164
{
165-
auto node_id_from_it = [&state](auto const& it)
165+
auto node_id_from_it = [](auto const& it)
166166
{
167167
return it->second.is_extra
168168
? it->second.original_node_id
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Boost.Geometry (aka GGL, Generic Geometry Library)
2+
3+
// Copyright (c) 2025 Tinko Bartels, Berlin, Germany.
4+
// Copyright (c) 2025 Oracle and/or its affiliates.
5+
// Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle
6+
7+
// This file was modified by Oracle on 2023.
8+
// Modifications copyright (c) 2023 Oracle and/or its affiliates.
9+
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
10+
11+
// Use, modification and distribution is subject to the Boost Software License,
12+
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13+
// http://www.boost.org/LICENSE_1_0.txt)
14+
15+
#ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_SIDE_3D_ROUNDED_INPUT_HPP
16+
#define BOOST_GEOMETRY_STRATEGY_CARTESIAN_SIDE_3D_ROUNDED_INPUT_HPP
17+
18+
#include <limits>
19+
20+
#include <boost/geometry/core/access.hpp>
21+
#include <boost/geometry/core/config.hpp>
22+
23+
#include <boost/geometry/util/math.hpp>
24+
25+
#include <boost/geometry/strategies/side.hpp>
26+
27+
#include <boost/geometry/util/select_calculation_type.hpp>
28+
29+
namespace boost { namespace geometry
30+
{
31+
32+
namespace strategy { namespace side
33+
{
34+
35+
template <typename CalculationType = void, int Coeff1 = 12>
36+
struct side_3d_rounded_input
37+
{
38+
using cs_tag = cartesian_tag;
39+
40+
template <typename P1, typename P2, typename P3, typename P>
41+
static inline int apply(P1 const& p1, P2 const& p2, P3 const& p3, P const& p)
42+
{
43+
using coor_t = typename select_calculation_type_alt<CalculationType, P1, P2, P3, P>::type;
44+
45+
coor_t const p1_x = geometry::get<0>(p1);
46+
coor_t const p1_y = geometry::get<1>(p1);
47+
coor_t const p1_z = geometry::get<2>(p1);
48+
coor_t const p2_x = geometry::get<0>(p2);
49+
coor_t const p2_y = geometry::get<1>(p2);
50+
coor_t const p2_z = geometry::get<2>(p2);
51+
coor_t const p3_x = geometry::get<0>(p3);
52+
coor_t const p3_y = geometry::get<1>(p3);
53+
coor_t const p3_z = geometry::get<2>(p3);
54+
coor_t const p_x = geometry::get<0>(p);
55+
coor_t const p_y = geometry::get<1>(p);
56+
coor_t const p_z = geometry::get<2>(p);
57+
58+
static coor_t const eps = std::numeric_limits<coor_t>::epsilon() / 2;
59+
coor_t const det = (p_x - p1_x) * ((p2_y - p1_y) * (p3_z - p1_z) - (p3_y - p1_y) * (p2_z - p1_z))
60+
- (p_y - p1_y) * ((p2_x - p1_x) * (p3_z - p1_z) - (p3_x - p1_x) * (p2_z - p1_z))
61+
+ (p_z - p1_z) * ((p2_x - p1_x) * (p3_y - p1_y) - (p3_x - p1_x) * (p2_y - p1_y));
62+
coor_t const err_bound = (Coeff1 * eps) *
63+
( (geometry::math::abs(p_x) + geometry::math::abs(p1_x))
64+
* ((geometry::math::abs(p2_y) + geometry::math::abs(p1_y))
65+
* (geometry::math::abs(p3_z) + geometry::math::abs(p1_z))
66+
+ (geometry::math::abs(p3_y) + geometry::math::abs(p1_y))
67+
* (geometry::math::abs(p2_z) + geometry::math::abs(p1_z)))
68+
+ (geometry::math::abs(p_y) + geometry::math::abs(p1_y))
69+
* ((geometry::math::abs(p2_x) + geometry::math::abs(p1_x))
70+
* (geometry::math::abs(p3_z) + geometry::math::abs(p1_z))
71+
+ (geometry::math::abs(p3_x) + geometry::math::abs(p1_x))
72+
* (geometry::math::abs(p2_z) + geometry::math::abs(p1_z)))
73+
+ (geometry::math::abs(p_z) + geometry::math::abs(p1_z))
74+
* ((geometry::math::abs(p2_x) + geometry::math::abs(p1_x))
75+
* (geometry::math::abs(p3_y) + geometry::math::abs(p1_y))
76+
+ (geometry::math::abs(p3_x) + geometry::math::abs(p1_x))
77+
* (geometry::math::abs(p2_y) + geometry::math::abs(p1_y))));
78+
return (det > err_bound) - (det < -err_bound);
79+
}
80+
};
81+
82+
}} // namespace strategy::side
83+
84+
}} // namespace boost::geometry
85+
86+
#endif // BOOST_GEOMETRY_STRATEGY_CARTESIAN_SIDE_3D_ROUNDED_INPUT_HPP
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Boost.Geometry
2+
3+
// Copyright (c) 2025, Oracle and/or its affiliates.
4+
5+
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
6+
7+
// Licensed under the Boost Software License version 1.0.
8+
// http://www.boost.org/users/license.html
9+
10+
#ifndef BOOST_GEOMETRY_STRATEGIES_RELATE3_CARTESIAN_HPP
11+
#define BOOST_GEOMETRY_STRATEGIES_RELATE3_CARTESIAN_HPP
12+
13+
#include <boost/geometry/strategies/relate/cartesian.hpp>
14+
#include <boost/geometry/strategies/cartesian/side_rounded_input.hpp>
15+
#include <boost/geometry/strategies/cartesian/side_3d_rounded_input.hpp>
16+
17+
namespace boost { namespace geometry
18+
{
19+
20+
namespace strategies { namespace relate3
21+
{
22+
23+
template <typename CalculationType = void>
24+
class cartesian
25+
: public strategies::relate::cartesian<CalculationType>
26+
{
27+
public:
28+
29+
// side
30+
31+
static auto side3()
32+
{
33+
return strategy::side::side_3d_rounded_input<>();
34+
}
35+
36+
static auto side()
37+
{
38+
return strategy::side::side_rounded_input<>();
39+
}
40+
};
41+
42+
namespace services
43+
{
44+
45+
template <typename Geometry1, typename Geometry2>
46+
struct default_strategy<Geometry1, Geometry2, cartesian_tag, cartesian_tag>
47+
{
48+
using type = strategies::relate3::cartesian<>;
49+
};
50+
51+
} // namespace services
52+
53+
}} // namespace strategies::relate3
54+
55+
}} // namespace boost::geometry
56+
57+
#endif // BOOST_GEOMETRY_STRATEGIES_RELATE_CARTESIAN_HPP
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Boost.Geometry
2+
3+
// Copyright (c) 2025, Oracle and/or its affiliates.
4+
5+
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
6+
7+
// Licensed under the Boost Software License version 1.0.
8+
// http://www.boost.org/users/license.html
9+
10+
#ifndef BOOST_GEOMETRY_STRATEGIES_RELATE3_SERVICES_HPP
11+
#define BOOST_GEOMETRY_STRATEGIES_RELATE3_SERVICES_HPP
12+
13+
14+
#include <boost/geometry/core/cs.hpp>
15+
#include <boost/geometry/core/static_assert.hpp>
16+
17+
18+
namespace boost { namespace geometry
19+
{
20+
21+
22+
namespace strategies { namespace relate3 {
23+
24+
namespace services
25+
{
26+
27+
template
28+
<
29+
typename Geometry1,
30+
typename Geometry2,
31+
typename CSTag1 = geometry::cs_tag_t<Geometry1>,
32+
typename CSTag2 = geometry::cs_tag_t<Geometry2>
33+
>
34+
struct default_strategy
35+
{
36+
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
37+
"Not implemented for this Geometry's coordinate system.",
38+
Geometry1, Geometry2, CSTag1, CSTag2);
39+
};
40+
41+
template <typename Strategy>
42+
struct strategy_converter
43+
{
44+
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
45+
"Not implemented for this Strategy.",
46+
Strategy);
47+
};
48+
49+
50+
} // namespace services
51+
52+
}} // namespace strategies::relate3
53+
54+
55+
}} // namespace boost::geometry
56+
57+
#endif // BOOST_GEOMETRY_STRATEGIES_RELATE3_SERVICES_HPP

0 commit comments

Comments
 (0)