Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private :
TiRStrategy const& strategy,
geometry::strategy::buffer::place_on_ring_type place_on_ring, State& state) const
{
return strategy.apply(point, p1, p2, place_on_ring, m_is_convex, state, get_full_ring());
return strategy.apply(point, p1, p2, place_on_ring, m_is_convex, state);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this was probably a left over, only used for debugging.
Deletion looks good to me, thanks.

}

template <typename It, typename Box, typename Strategy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2014-2021.
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.
Expand Down Expand Up @@ -224,7 +225,7 @@ struct convex_hull<Box, box_tag>
template <typename OutputGeometry, typename Strategy>
static inline void apply(Box const& box,
OutputGeometry& out,
Strategy const& strategy)
Strategy const& )
{
static bool const Close
= geometry::closure<OutputGeometry>::value == closed;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2019-2022.
// Modifications copyright (c) 2019-2022 Oracle and/or its affiliates.
Expand Down Expand Up @@ -165,8 +165,8 @@ private :
if (! cinfo.turn_indices.empty()
&& is_self_cluster(cluster_id, turns, clusters))
{
signed_size_type const index = *cinfo.turn_indices.begin();
if (! check_within<OverlayType>::apply(turns[index],
signed_size_type const first_index = *cinfo.turn_indices.begin();
if (! check_within<OverlayType>::apply(turns[first_index],
geometry0, geometry1,
strategy))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2014-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

Expand Down Expand Up @@ -33,6 +34,8 @@

#include <boost/geometry/policies/compare.hpp>

#include <boost/geometry/util/condition.hpp>


namespace boost { namespace geometry
{
Expand Down Expand Up @@ -256,8 +259,8 @@ struct multipoint_multipoint_point
{
typedef geometry::less<void, -1, typename Strategy::cs_tag> less_type;

if ( OverlayType != overlay_difference
&& boost::size(multipoint1) > boost::size(multipoint2) )
if (BOOST_GEOMETRY_CONDITION(OverlayType != overlay_difference)
&& boost::size(multipoint1) > boost::size(multipoint2))
{
return multipoint_multipoint_point
<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Boost.Geometry

// Copyright (c) 2022 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2022-2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2022 Oracle and/or its affiliates.

// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
Expand All @@ -25,6 +24,7 @@
#include <boost/geometry/geometries/multi_point.hpp>
#include <boost/geometry/geometries/multi_polygon.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/views/detail/geometry_collection_view.hpp>


Expand All @@ -49,18 +49,17 @@ struct aa_handler_wrapper

explicit aa_handler_wrapper(Handler& handler)
: m_handler(handler)
{
m_overwrite_ii = ! handler.template may_update<interior, interior, '2'>();
m_overwrite_ie = ! handler.template may_update<interior, exterior, '2'>();
m_overwrite_ei = ! handler.template may_update<exterior, interior, '2'>();
}
, m_overwrite_ii(! handler.template may_update<interior, interior, '2'>())
, m_overwrite_ie(! handler.template may_update<interior, exterior, '2'>())
, m_overwrite_ei(! handler.template may_update<exterior, interior, '2'>())
{}

template <field F1, field F2, char D>
inline bool may_update() const
{
if ((F1 == interior && F2 == interior && m_overwrite_ii)
|| (F1 == interior && F2 == exterior && m_overwrite_ie)
|| (F1 == exterior && F2 == interior && m_overwrite_ei))
if ((BOOST_GEOMETRY_CONDITION(F1 == interior && F2 == interior) && m_overwrite_ii)
|| (BOOST_GEOMETRY_CONDITION(F1 == interior && F2 == exterior) && m_overwrite_ie)
|| (BOOST_GEOMETRY_CONDITION(F1 == exterior && F2 == interior) && m_overwrite_ei))
{
char const c = m_handler.template get<F1, F2>();
return D > c || c > '9';
Expand All @@ -74,9 +73,9 @@ struct aa_handler_wrapper
template <field F1, field F2, char V>
inline void update()
{
if ((F1 == interior && F2 == interior && m_overwrite_ii)
|| (F1 == interior && F2 == exterior && m_overwrite_ie)
|| (F1 == exterior && F2 == interior && m_overwrite_ei))
if ((BOOST_GEOMETRY_CONDITION(F1 == interior && F2 == interior) && m_overwrite_ii)
|| (BOOST_GEOMETRY_CONDITION(F1 == interior && F2 == exterior) && m_overwrite_ie)
|| (BOOST_GEOMETRY_CONDITION(F1 == exterior && F2 == interior) && m_overwrite_ei))
{
// NOTE: Other handlers first check for potential interruption
// and only after that checks update condition.
Expand All @@ -97,9 +96,9 @@ struct aa_handler_wrapper

private:
Handler & m_handler;
bool m_overwrite_ii = false;
bool m_overwrite_ie = false;
bool m_overwrite_ei = false;
bool const m_overwrite_ii;
bool const m_overwrite_ie;
bool const m_overwrite_ei;
};


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2013-2022.
// Modifications copyright (c) 2013-2022 Oracle and/or its affiliates.

// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
Expand Down Expand Up @@ -234,7 +234,7 @@ template
typename Strategy
>
inline bool calculate_from_inside_sides(Pi const& pi, Pj const& pj, Pk const& pk,
Qi const& qi, Qj const& qj, Qk const& qk,
Qi const& , Qj const& qj, Qk const& qk,
Strategy const& strategy)
{
auto const side_strategy = strategy.side();
Expand Down
7 changes: 5 additions & 2 deletions include/boost/geometry/algorithms/detail/sweep.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2015, Oracle and/or its affiliates.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2015, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle

// Licensed under the Boost Software License version 1.0.
Expand All @@ -10,6 +11,8 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SWEEP_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SWEEP_HPP

#include <boost/geometry/util/condition.hpp>

#include <boost/core/ignore_unused.hpp>


Expand Down Expand Up @@ -56,7 +59,7 @@ inline void sweep(Range const& range, PriorityQueue& queue,
event_type event = queue.top();
queue.pop();
event_visitor.apply(event, queue);
if (interrupt_policy.enabled && interrupt_policy.apply(event))
if (BOOST_GEOMETRY_CONDITION(interrupt_policy.enabled) && interrupt_policy.apply(event))
{
break;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Boost.Geometry

// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2017-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

Expand Down Expand Up @@ -38,6 +40,7 @@
#include <boost/geometry/strategies/covered_by.hpp>
#include <boost/geometry/strategies/disjoint.hpp>

#include <boost/geometry/util/condition.hpp>
#include <boost/geometry/util/type_traits.hpp>


Expand Down Expand Up @@ -234,7 +237,7 @@ struct multi_point_multi_geometry

if (boundaries > 0)
{
if (is_linear && boundaries % 2 == 0)
if (BOOST_GEOMETRY_CONDITION(is_linear) && boundaries % 2 == 0)
{
found_interior = true;
}
Expand Down
5 changes: 3 additions & 2 deletions include/boost/geometry/algorithms/simplify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2018-2022.
// Modifications copyright (c) 2018-2022 Oracle and/or its affiliates.
Expand Down Expand Up @@ -482,7 +483,7 @@ public :
// Do not duplicate the closing point
auto rot_end = boost::end(ring);
std::size_t rot_index = index;
if (is_closed_in && size > 1)
if (BOOST_GEOMETRY_CONDITION(is_closed_in) && size > 1)
{
--rot_end;
if (rot_index == size - 1) { rot_index = 0; }
Expand All @@ -497,7 +498,7 @@ public :
simplify_range<0>::apply(rotated, out, max_distance, impl, strategies);

// Open output if needed
if (! is_closed_out && boost::size(out) > 1)
if (BOOST_GEOMETRY_CONDITION(! is_closed_out) && boost::size(out) > 1)
{
range::pop_back(out);
}
Expand Down
5 changes: 3 additions & 2 deletions include/boost/geometry/formulas/area_formulas.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Boost.Geometry

// Copyright (c) 2015-2022 Oracle and/or its affiliates.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2015-2022 Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

Expand Down Expand Up @@ -380,7 +381,7 @@ class area_formulas
return pi;
}

if (LongSegment && lat1r != lat2r) // not for segments parallel to equator
if (BOOST_GEOMETRY_CONDITION(LongSegment) && lat1r != lat2r) // not for segments parallel to equator
{
CT const cbet1 = cos(lat1r);
CT const sbet1 = sin(lat1r);
Expand Down
15 changes: 8 additions & 7 deletions include/boost/geometry/formulas/differential_quantities.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Boost.Geometry

// Copyright (c) 2016-2019 Oracle and/or its affiliates.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2016-2019 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
Expand Down Expand Up @@ -162,7 +163,7 @@ class differential_quantities
CT const& sin_sig2, CT const& cos_sig2,
CT const& cos_alp0_sqr, CT const& f)
{
if (Order == 0)
if (BOOST_GEOMETRY_CONDITION(Order == 0))
{
return 0;
}
Expand All @@ -176,7 +177,7 @@ class differential_quantities
CT const sin_2sig_12 = sin_2sig2 - sin_2sig1;
CT const L1 = sig_12 - sin_2sig_12 / c2;

if (Order == 1)
if (BOOST_GEOMETRY_CONDITION(Order == 1))
{
return cos_alp0_sqr * f * L1;
}
Expand All @@ -195,7 +196,7 @@ class differential_quantities
+ (c12 * cos_alp0_sqr - c24) * sig_12)
/ c16;

if (Order == 2)
if (BOOST_GEOMETRY_CONDITION(Order == 2))
{
return cos_alp0_sqr * f * (L1 + f * L2);
}
Expand Down Expand Up @@ -241,7 +242,7 @@ class differential_quantities
CT const& sin_sig2, CT const& cos_sig2,
CT const& cos_alp0_sqr, CT const& ep_sqr)
{
if (Order == 0)
if (BOOST_GEOMETRY_CONDITION(Order == 0))
{
return 0;
}
Expand All @@ -259,7 +260,7 @@ class differential_quantities

CT const L1 = (c2 * sig_12 - sin_2sig_12) / c4;

if (Order == 1)
if (BOOST_GEOMETRY_CONDITION(Order == 1))
{
return c2a0ep2 * L1;
}
Expand All @@ -273,7 +274,7 @@ class differential_quantities

CT const L2 = (sin_4sig_12 - c8 * sin_2sig_12 + 12 * sig_12) / c64;

if (Order == 2)
if (BOOST_GEOMETRY_CONDITION(Order == 2))
{
return c2a0ep2 * (L1 + c2a0ep2 * L2);
}
Expand Down
5 changes: 3 additions & 2 deletions include/boost/geometry/formulas/gnomonic_intersection.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Boost.Geometry

// Copyright (c) 2016 Oracle and/or its affiliates.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2016 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
Expand Down Expand Up @@ -80,7 +81,7 @@ class gnomonic_intersection
CT xa1, ya1, xa2, ya2;
CT xb1, yb1, xb2, yb2;
CT x, y;
double lat1, lon1;
CT lon1, lat1;

bool ok = gnom_t::forward(lon, lat, lona1, lata1, xa1, ya1, spheroid)
&& gnom_t::forward(lon, lat, lona2, lata2, xa2, ya2, spheroid)
Expand Down
7 changes: 4 additions & 3 deletions include/boost/geometry/formulas/karney_inverse.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry

// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program.

Expand Down Expand Up @@ -267,8 +268,8 @@ class karney_inverse
CT sin_sigma2 = sin_beta2;
CT cos_sigma2 = cos_alpha2 * cos_beta2;

CT sigma12 = std::atan2((std::max)(c0, cos_sigma1 * sin_sigma2 - sin_sigma1 * cos_sigma2),
cos_sigma1 * cos_sigma2 + sin_sigma1 * sin_sigma2);
sigma12 = std::atan2((std::max)(c0, cos_sigma1 * sin_sigma2 - sin_sigma1 * cos_sigma2),
cos_sigma1 * cos_sigma2 + sin_sigma1 * sin_sigma2);

CT dummy;
meridian_length(n, ep2, sigma12, sin_sigma1, cos_sigma1, dn1,
Expand All @@ -281,7 +282,7 @@ class karney_inverse
{
if (sigma12 < c3 * tiny)
{
sigma12 = m12x = s12x = c0;
sigma12 = m12x = s12x = c0;
}

m12x *= b;
Expand Down
Loading