update boost
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2019-2021.
|
||||
// Modifications copyright (c) 2019-2021 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,11 +15,18 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_BOUNDS_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_BOUNDS_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/convert.hpp>
|
||||
#include <boost/geometry/algorithms/detail/covered_by/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/envelope/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/expand/interface.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/bounded_view.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
namespace boost { namespace geometry { namespace index { namespace detail
|
||||
{
|
||||
|
||||
namespace dispatch {
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template <typename Geometry,
|
||||
typename Bounds,
|
||||
@@ -23,7 +34,8 @@ template <typename Geometry,
|
||||
typename TagBounds = typename geometry::tag<Bounds>::type>
|
||||
struct bounds
|
||||
{
|
||||
static inline void apply(Geometry const& g, Bounds & b)
|
||||
template <typename Strategy>
|
||||
static inline void apply(Geometry const& g, Bounds & b, Strategy const& )
|
||||
{
|
||||
geometry::convert(g, b);
|
||||
}
|
||||
@@ -32,59 +44,184 @@ struct bounds
|
||||
template <typename Geometry, typename Bounds>
|
||||
struct bounds<Geometry, Bounds, segment_tag, box_tag>
|
||||
{
|
||||
static inline void apply(Geometry const& g, Bounds & b)
|
||||
template <typename Strategy>
|
||||
static inline void apply(Geometry const& g, Bounds & b, Strategy const& s)
|
||||
{
|
||||
index::detail::bounded_view<Geometry, Bounds> v(g);
|
||||
index::detail::bounded_view<Geometry, Bounds, Strategy> v(g, s);
|
||||
geometry::convert(v, b);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
|
||||
template <typename Geometry, typename Bounds>
|
||||
inline void bounds(Geometry const& g, Bounds & b)
|
||||
|
||||
template <typename Geometry, typename Bounds, typename Strategy>
|
||||
inline void bounds(Geometry const& g, Bounds & b, Strategy const& s)
|
||||
{
|
||||
concepts::check_concepts_and_equal_dimensions<Geometry const, Bounds>();
|
||||
dispatch::bounds<Geometry, Bounds>::apply(g, b);
|
||||
dispatch::bounds<Geometry, Bounds>::apply(g, b, s);
|
||||
}
|
||||
|
||||
namespace dispatch {
|
||||
|
||||
template <typename Geometry,
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template <typename Bounds,
|
||||
typename Geometry,
|
||||
typename TagBounds = typename geometry::tag<Bounds>::type,
|
||||
typename TagGeometry = typename geometry::tag<Geometry>::type>
|
||||
struct return_ref_or_bounds
|
||||
struct expand
|
||||
{
|
||||
typedef Geometry const& result_type;
|
||||
// STATIC ASSERT
|
||||
};
|
||||
|
||||
static inline result_type apply(Geometry const& g)
|
||||
template <typename Bounds, typename Geometry>
|
||||
struct expand<Bounds, Geometry, box_tag, point_tag>
|
||||
{
|
||||
static inline void apply(Bounds & b, Geometry const& g)
|
||||
{
|
||||
return g;
|
||||
geometry::expand(b, g);
|
||||
}
|
||||
|
||||
template <typename Strategy>
|
||||
static inline void apply(Bounds & b, Geometry const& g, Strategy const& s)
|
||||
{
|
||||
geometry::expand(b, g, s);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct return_ref_or_bounds<Geometry, segment_tag>
|
||||
template <typename Bounds, typename Geometry>
|
||||
struct expand<Bounds, Geometry, box_tag, box_tag>
|
||||
{
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef geometry::model::box<point_type> bounds_type;
|
||||
typedef index::detail::bounded_view<Geometry, bounds_type> result_type;
|
||||
|
||||
static inline result_type apply(Geometry const& g)
|
||||
static inline void apply(Bounds & b, Geometry const& g)
|
||||
{
|
||||
return result_type(g);
|
||||
geometry::expand(b, g);
|
||||
}
|
||||
|
||||
template <typename Strategy>
|
||||
static inline void apply(Bounds & b, Geometry const& g, Strategy const& s)
|
||||
{
|
||||
geometry::expand(b, g, s);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Bounds, typename Geometry>
|
||||
struct expand<Bounds, Geometry, box_tag, segment_tag>
|
||||
{
|
||||
static inline void apply(Bounds & b, Geometry const& g)
|
||||
{
|
||||
geometry::expand(b, g);
|
||||
}
|
||||
|
||||
template <typename Strategy>
|
||||
static inline void apply(Bounds & b, Geometry const& g, Strategy const& s)
|
||||
{
|
||||
geometry::expand(b, geometry::return_envelope<Bounds>(g, s), s);
|
||||
// requires additional strategy
|
||||
//geometry::expand(b, g, s);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
|
||||
template <typename Geometry>
|
||||
inline
|
||||
typename dispatch::return_ref_or_bounds<Geometry>::result_type
|
||||
return_ref_or_bounds(Geometry const& g)
|
||||
|
||||
template <typename Bounds, typename Geometry, typename Strategy>
|
||||
inline void expand(Bounds & b, Geometry const& g, Strategy const& s)
|
||||
{
|
||||
return dispatch::return_ref_or_bounds<Geometry>::apply(g);
|
||||
dispatch::expand<Bounds, Geometry>::apply(b, g, s);
|
||||
}
|
||||
|
||||
template <typename Bounds, typename Geometry>
|
||||
inline void expand(Bounds & b, Geometry const& g, default_strategy const& )
|
||||
{
|
||||
dispatch::expand<Bounds, Geometry>::apply(b, g);
|
||||
}
|
||||
|
||||
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
|
||||
template <typename Geometry,
|
||||
typename Bounds,
|
||||
typename TagGeometry = typename geometry::tag<Geometry>::type,
|
||||
typename TagBounds = typename geometry::tag<Bounds>::type>
|
||||
struct covered_by_bounds
|
||||
{};
|
||||
|
||||
template <typename Geometry, typename Bounds>
|
||||
struct covered_by_bounds<Geometry, Bounds, point_tag, box_tag>
|
||||
{
|
||||
static inline bool apply(Geometry const& g, Bounds & b)
|
||||
{
|
||||
return geometry::covered_by(g, b);
|
||||
}
|
||||
|
||||
template <typename Strategy>
|
||||
static inline bool apply(Geometry const& g, Bounds & b, Strategy const& s)
|
||||
{
|
||||
return geometry::covered_by(g, b, s);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Geometry, typename Bounds>
|
||||
struct covered_by_bounds<Geometry, Bounds, box_tag, box_tag>
|
||||
{
|
||||
static inline bool apply(Geometry const& g, Bounds & b)
|
||||
{
|
||||
return geometry::covered_by(g, b);
|
||||
}
|
||||
|
||||
template <typename Strategy>
|
||||
static inline bool apply(Geometry const& g, Bounds & b, Strategy const& s)
|
||||
{
|
||||
return geometry::covered_by(g, b, s);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Geometry, typename Bounds>
|
||||
struct covered_by_bounds<Geometry, Bounds, segment_tag, box_tag>
|
||||
{
|
||||
static inline bool apply(Geometry const& g, Bounds & b)
|
||||
{
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef geometry::model::box<point_type> bounds_type;
|
||||
typedef index::detail::bounded_view<Geometry, bounds_type, default_strategy> view_type;
|
||||
|
||||
return geometry::covered_by(view_type(g, default_strategy()), b);
|
||||
}
|
||||
|
||||
template <typename Strategy>
|
||||
static inline bool apply(Geometry const& g, Bounds & b, Strategy const& strategy)
|
||||
{
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef geometry::model::box<point_type> bounds_type;
|
||||
typedef index::detail::bounded_view<Geometry, bounds_type, Strategy> view_type;
|
||||
|
||||
return geometry::covered_by(view_type(g, strategy), b, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
|
||||
|
||||
template <typename Geometry, typename Bounds, typename Strategy>
|
||||
inline bool covered_by_bounds(Geometry const& g, Bounds & b, Strategy const& s)
|
||||
{
|
||||
return dispatch::covered_by_bounds<Geometry, Bounds>::apply(g, b, s);
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Bounds>
|
||||
inline bool covered_by_bounds(Geometry const& g, Bounds & b, default_strategy const& )
|
||||
{
|
||||
return dispatch::covered_by_bounds<Geometry, Bounds>::apply(g, b);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespace boost::geometry::index::detail
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_BOUNDS_HPP
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +15,9 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_COMPARABLE_DISTANCE_CENTROID_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_COMPARABLE_DISTANCE_CENTROID_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/detail/comparable_distance/interface.hpp>
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/sum_for_indexable.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/diff_abs.hpp>
|
||||
|
||||
@@ -48,7 +55,7 @@ struct sum_for_indexable_dimension<Point, BoxIndexable, box_tag, comparable_dist
|
||||
point_coord_t pt_c = geometry::get<DimensionIndex>(pt);
|
||||
indexable_coord_t ind_c_min = geometry::get<geometry::min_corner, DimensionIndex>(i);
|
||||
indexable_coord_t ind_c_max = geometry::get<geometry::max_corner, DimensionIndex>(i);
|
||||
|
||||
|
||||
indexable_coord_t ind_c_avg = ind_c_min + (ind_c_max - ind_c_min) / 2;
|
||||
// TODO: awulkiew - is (ind_c_min + ind_c_max) / 2 safe?
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +15,9 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_COMPARABLE_DISTANCE_FAR_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_COMPARABLE_DISTANCE_FAR_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/detail/comparable_distance/interface.hpp>
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/diff_abs.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/sum_for_indexable.hpp>
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +15,9 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_COMPARABLE_DISTANCE_NEAR_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_COMPARABLE_DISTANCE_NEAR_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/detail/comparable_distance/interface.hpp>
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/sum_for_indexable.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020-2023.
|
||||
// Modifications copyright (c) 2020-2023 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
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,15 +16,24 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/util/select_most_precise.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
template <typename Indexable>
|
||||
struct default_content_result
|
||||
{
|
||||
typedef typename select_most_precise<
|
||||
typename coordinate_type<Indexable>::type,
|
||||
long double
|
||||
>::type type;
|
||||
using type = typename select_most_precise
|
||||
<
|
||||
typename coordinate_type<Indexable>::type,
|
||||
double
|
||||
>::type;
|
||||
};
|
||||
|
||||
namespace dispatch {
|
||||
@@ -49,7 +63,9 @@ struct content_box<Box, 1>
|
||||
template <typename Indexable, typename Tag>
|
||||
struct content
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(false, NOT_IMPLEMENTED_FOR_THIS_INDEXABLE_AND_TAG, (Indexable, Tag));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Indexable and Tag.",
|
||||
Indexable, Tag);
|
||||
};
|
||||
|
||||
template <typename Indexable>
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
//
|
||||
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020-2023.
|
||||
// Modifications copyright (c) 2020-2023, 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
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,27 +16,30 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_DIFF_ABS_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_DIFF_ABS_HPP
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
|
||||
template <typename T>
|
||||
inline T diff_abs_dispatch(T const& v1, T const& v2, boost::mpl::bool_<true> const& /*is_integral*/)
|
||||
namespace boost { namespace geometry { namespace index { namespace detail
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename T,
|
||||
std::enable_if_t<std::is_integral<T>::value, int> = 0
|
||||
>
|
||||
inline T diff_abs(T const& v1, T const& v2)
|
||||
{
|
||||
return v1 < v2 ? v2 - v1 : v1 - v2;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T diff_abs_dispatch(T const& v1, T const& v2, boost::mpl::bool_<false> const& /*is_integral*/)
|
||||
{
|
||||
return ::fabs(v1 - v2);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template
|
||||
<
|
||||
typename T,
|
||||
std::enable_if_t<! std::is_integral<T>::value, int> = 0
|
||||
>
|
||||
inline T diff_abs(T const& v1, T const& v2)
|
||||
{
|
||||
typedef boost::mpl::bool_<
|
||||
boost::is_integral<T>::value
|
||||
> is_integral;
|
||||
return diff_abs_dispatch(v1, v2, is_integral());
|
||||
return ::fabs(v1 - v2);
|
||||
}
|
||||
|
||||
}}}} // namespace boost::geometry::index::detail
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2019-2021.
|
||||
// Modifications copyright (c) 2019-2021 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -16,20 +20,36 @@
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/content.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/disjoint.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
/**
|
||||
* \brief Compute the area of the intersection of b1 and b2
|
||||
*/
|
||||
template <typename Box>
|
||||
inline typename default_content_result<Box>::type intersection_content(Box const& box1, Box const& box2)
|
||||
// Util to distinguish between default and non-default index strategy
|
||||
template <typename Box, typename Strategy>
|
||||
inline bool disjoint_box_box(Box const& box1, Box const& box2, Strategy const& s)
|
||||
{
|
||||
typedef typename strategy::disjoint::services::default_strategy
|
||||
<
|
||||
Box, Box
|
||||
>::type strategy_type;
|
||||
return geometry::detail::disjoint::disjoint_box_box(box1, box2, s);
|
||||
}
|
||||
|
||||
bool const intersects = ! geometry::detail::disjoint::disjoint_box_box(box1, box2, strategy_type());
|
||||
template <typename Box>
|
||||
inline bool disjoint_box_box(Box const& box1, Box const& box2, default_strategy const& )
|
||||
{
|
||||
typedef typename strategy::disjoint::services::default_strategy<Box, Box>::type strategy_type;
|
||||
return geometry::detail::disjoint::disjoint_box_box(box1, box2, strategy_type());
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Compute the area, volume, ... of the intersection of b1 and b2
|
||||
*/
|
||||
template <typename Box, typename Strategy>
|
||||
inline typename default_content_result<Box>::type intersection_content(Box const& box1, Box const& box2, Strategy const& strategy)
|
||||
{
|
||||
bool const intersects = ! index::detail::disjoint_box_box(box1, box2, strategy);
|
||||
|
||||
// NOTE: the code below may be inconsistent with the disjoint_box_box()
|
||||
// however intersection_box_box checks if the boxes intersect on the fly so it should be ok
|
||||
// but this also means that disjoint_box_box() is probably not needed
|
||||
|
||||
if ( intersects )
|
||||
{
|
||||
@@ -46,6 +66,12 @@ inline typename default_content_result<Box>::type intersection_content(Box const
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename Box>
|
||||
inline typename default_content_result<Box>::type intersection_content(Box const& box1, Box const& box2)
|
||||
{
|
||||
return intersection_content(box1, box2, default_strategy());
|
||||
}
|
||||
|
||||
}}}} // namespace boost::geometry::index::detail
|
||||
|
||||
#endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -12,7 +16,10 @@
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_IS_VALID_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
@@ -42,10 +49,9 @@ template <typename Indexable,
|
||||
typename Tag = typename geometry::tag<Indexable>::type>
|
||||
struct is_valid
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(false),
|
||||
NOT_IMPLEMENTED_FOR_THIS_INDEXABLE,
|
||||
(is_valid));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Indexable type.",
|
||||
Indexable, Tag);
|
||||
};
|
||||
|
||||
template <typename Indexable>
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020-2023.
|
||||
// Modifications copyright (c) 2020-2023, 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
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +16,14 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_MARGIN_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_MARGIN_HPP
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/util/select_most_precise.hpp>
|
||||
|
||||
// WARNING! comparable_margin() will work only if the same Geometries are compared
|
||||
// so it shouldn't be used in the case of Variants!
|
||||
|
||||
@@ -19,10 +32,11 @@ namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
template <typename Box>
|
||||
struct default_margin_result
|
||||
{
|
||||
typedef typename select_most_precise<
|
||||
typename coordinate_type<Box>::type,
|
||||
long double
|
||||
>::type type;
|
||||
using type = typename select_most_precise
|
||||
<
|
||||
typename coordinate_type<Box>::type,
|
||||
double
|
||||
>::type;
|
||||
};
|
||||
|
||||
//template <typename Box,
|
||||
@@ -124,7 +138,9 @@ namespace dispatch {
|
||||
template <typename Geometry, typename Tag>
|
||||
struct comparable_margin
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY, (Geometry, Tag));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Geometry type.",
|
||||
Geometry, Tag);
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -14,6 +18,8 @@
|
||||
#include <boost/geometry/algorithms/distance.hpp>
|
||||
#include <boost/geometry/algorithms/comparable_distance.hpp>
|
||||
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/diff_abs.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/sum_for_indexable.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/smallest_for_indexable.hpp>
|
||||
@@ -50,7 +56,7 @@ struct smallest_for_indexable_dimension<Point, BoxIndexable, box_tag, minmaxdist
|
||||
closer_comp = detail::diff_abs(pt_c, ind_c_min); // unsigned values protection
|
||||
else
|
||||
closer_comp = ind_c_max - pt_c;
|
||||
|
||||
|
||||
result_type further_comp = 0;
|
||||
if ( ind_c_avg <= pt_c )
|
||||
further_comp = pt_c - ind_c_min;
|
||||
@@ -64,10 +70,9 @@ struct smallest_for_indexable_dimension<Point, BoxIndexable, box_tag, minmaxdist
|
||||
template <typename Point, typename Indexable, typename IndexableTag>
|
||||
struct minmaxdist_impl
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(false),
|
||||
NOT_IMPLEMENTED_FOR_THIS_INDEXABLE_TAG_TYPE,
|
||||
(minmaxdist_impl));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Indexable type.",
|
||||
Point, Indexable, IndexableTag);
|
||||
};
|
||||
|
||||
template <typename Point, typename Indexable>
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
//
|
||||
// Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020-2023.
|
||||
// Modifications copyright (c) 2020-2023, 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
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -12,8 +17,14 @@
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_PATH_INTERSECTION_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/distance/interface.hpp>
|
||||
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/segment_intersection.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/default_distance_result.hpp>
|
||||
#include <boost/geometry/strategies/default_length_result.hpp>
|
||||
|
||||
|
||||
@@ -24,7 +35,9 @@ namespace dispatch {
|
||||
template <typename Indexable, typename Geometry, typename IndexableTag, typename GeometryTag>
|
||||
struct path_intersection
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG((false), NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_OR_INDEXABLE, (path_intersection));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Geometry or Indexable.",
|
||||
Indexable, Geometry, IndexableTag, GeometryTag);
|
||||
};
|
||||
|
||||
// TODO: FP type must be used as a relative distance type!
|
||||
@@ -55,9 +68,9 @@ struct path_intersection<Indexable, Linestring, box_tag, linestring_tag>
|
||||
static inline bool apply(Indexable const& b, Linestring const& path, comparable_distance_type & comparable_distance)
|
||||
{
|
||||
typedef typename ::boost::range_value<Linestring>::type point_type;
|
||||
typedef typename ::boost::range_const_iterator<Linestring>::type const_iterator;
|
||||
typedef typename ::boost::range_const_iterator<Linestring>::type const_iterator;
|
||||
typedef typename ::boost::range_size<Linestring>::type size_type;
|
||||
|
||||
|
||||
const size_type count = ::boost::size(path);
|
||||
|
||||
if ( count == 2 )
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021, 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +15,15 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SEGMENT_INTERSECTION_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SEGMENT_INTERSECTION_HPP
|
||||
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
//template <typename Indexable, typename Point>
|
||||
@@ -25,8 +38,8 @@ namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
// >::type type;
|
||||
//
|
||||
//
|
||||
// BOOST_MPL_ASSERT_MSG((!::boost::is_unsigned<type>::value),
|
||||
// THIS_TYPE_SHOULDNT_BE_UNSIGNED, (type));
|
||||
// BOOST_GEOMETRY_STATIC_ASSERT((!std::is_unsigned<type>::value),
|
||||
// "Distance type can not be unsigned.", type);
|
||||
//};
|
||||
|
||||
namespace dispatch {
|
||||
@@ -93,13 +106,17 @@ struct box_segment_intersection<Box, Point, 1>
|
||||
template <typename Indexable, typename Point, typename Tag>
|
||||
struct segment_intersection
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG((false), NOT_IMPLEMENTED_FOR_THIS_GEOMETRY, (segment_intersection));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Indexable type.",
|
||||
Indexable, Point, Tag);
|
||||
};
|
||||
|
||||
template <typename Indexable, typename Point>
|
||||
struct segment_intersection<Indexable, Point, point_tag>
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG((false), SEGMENT_POINT_INTERSECTION_UNAVAILABLE, (segment_intersection));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Segment-Point intersection unavailable.",
|
||||
Indexable, Point);
|
||||
};
|
||||
|
||||
template <typename Indexable, typename Point>
|
||||
@@ -113,8 +130,10 @@ struct segment_intersection<Indexable, Point, box_tag>
|
||||
|
||||
// TODO: this ASSERT CHECK is wrong for user-defined CoordinateTypes!
|
||||
|
||||
static const bool check = !::boost::is_integral<RelativeDistance>::value;
|
||||
BOOST_MPL_ASSERT_MSG(check, RELATIVE_DISTANCE_MUST_BE_FLOATING_POINT_TYPE, (RelativeDistance));
|
||||
static const bool check = !std::is_integral<RelativeDistance>::value;
|
||||
BOOST_GEOMETRY_STATIC_ASSERT(check,
|
||||
"RelativeDistance must be a floating point type.",
|
||||
RelativeDistance);
|
||||
|
||||
RelativeDistance t_near = -(::std::numeric_limits<RelativeDistance>::max)();
|
||||
RelativeDistance t_far = (::std::numeric_limits<RelativeDistance>::max)();
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +15,8 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SMALLEST_FOR_INDEXABLE_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SMALLEST_FOR_INDEXABLE_HPP
|
||||
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
template <
|
||||
@@ -21,10 +27,9 @@ template <
|
||||
size_t DimensionIndex>
|
||||
struct smallest_for_indexable_dimension
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(false),
|
||||
NOT_IMPLEMENTED_FOR_THIS_INDEXABLE_TAG_TYPE,
|
||||
(smallest_for_indexable_dimension));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Indexable type.",
|
||||
Geometry, Indexable, IndexableTag, AlgoTag);
|
||||
};
|
||||
|
||||
template <
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
//
|
||||
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -11,6 +15,8 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP
|
||||
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
template <
|
||||
@@ -21,10 +27,9 @@ template <
|
||||
size_t DimensionIndex>
|
||||
struct sum_for_indexable_dimension
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(false),
|
||||
NOT_IMPLEMENTED_FOR_THIS_INDEXABLE_TAG_TYPE,
|
||||
(sum_for_indexable_dimension));
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Indexable type.",
|
||||
Geometry, Indexable, IndexableTag, AlgoTag);
|
||||
};
|
||||
|
||||
template <
|
||||
|
||||
Reference in New Issue
Block a user