summaryrefslogtreecommitdiff
path: root/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/strategies/agnostic/point_in_box_by_side.hpp')
-rw-r--r--boost/geometry/strategies/agnostic/point_in_box_by_side.hpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp b/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp
index 5ea58736ee..6199634823 100644
--- a/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp
+++ b/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp
@@ -3,6 +3,7 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2018-2020.
// Modifications copyright (c) 2018-2020 Oracle and/or its affiliates.
@@ -18,16 +19,18 @@
#ifndef BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_POINT_IN_BOX_BY_SIDE_HPP
#define BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_POINT_IN_BOX_BY_SIDE_HPP
-#include <boost/array.hpp>
+#include <array>
+
#include <boost/core/ignore_unused.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/strategies/covered_by.hpp>
-#include <boost/geometry/strategies/within.hpp>
-#include <boost/geometry/strategies/cartesian/side_by_triangle.hpp>
#include <boost/geometry/strategies/geographic/side.hpp>
+#include <boost/geometry/strategies/side.hpp>
#include <boost/geometry/strategies/spherical/ssf.hpp>
+#include <boost/geometry/strategies/within.hpp>
namespace boost { namespace geometry { namespace strategy
@@ -82,7 +85,7 @@ inline bool point_in_box_by_side(Point const& point, Box const& box,
// Create (counterclockwise) array of points, the fifth one closes it
// Every point should be on the LEFT side (=1), or ON the border (=0),
// So >= 1 or >= 0
- boost::array<typename point_type<Box>::type, 5> bp;
+ std::array<typename point_type<Box>::type, 5> bp;
geometry::detail::assign_box_corners_oriented<true>(box, bp);
bp[4] = bp[0];
@@ -114,11 +117,14 @@ struct cartesian_point_box_by_side
template <typename Point, typename Box>
static inline bool apply(Point const& point, Box const& box)
{
+ using side_strategy_type
+ = typename strategy::side::services::default_strategy
+ <cartesian_tag, CalculationType>::type;
+
return within::detail::point_in_box_by_side
<
within::detail::decide_within
- >(point, box,
- strategy::side::side_by_triangle<CalculationType>());
+ >(point, box, side_strategy_type());
}
};
@@ -185,11 +191,13 @@ struct cartesian_point_box_by_side
template <typename Point, typename Box>
static bool apply(Point const& point, Box const& box)
{
+ using side_strategy_type
+ = typename strategy::side::services::default_strategy
+ <cartesian_tag, CalculationType>::type;
return within::detail::point_in_box_by_side
<
within::detail::decide_covered_by
- >(point, box,
- strategy::side::side_by_triangle<CalculationType>());
+ >(point, box, side_strategy_type());
}
};