mirror of
https://github.com/boostorg/geometry.git
synced 2026-01-29 07:32:17 +00:00
[strategies] Remove strategy getters from legacy strategies.
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017, 2018.
|
||||
// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
#include <boost/geometry/strategies/side.hpp>
|
||||
#include <boost/geometry/views/detail/normalized_view.hpp>
|
||||
|
||||
// TEMP
|
||||
#include <type_traits>
|
||||
#include <boost/geometry/strategies/cartesian/point_in_point.hpp>
|
||||
#include <boost/geometry/strategies/spherical/point_in_point.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@@ -45,8 +50,13 @@ struct ring_is_convex
|
||||
template <typename Ring, typename SideStrategy>
|
||||
static inline bool apply(Ring const& ring, SideStrategy const& strategy)
|
||||
{
|
||||
typename SideStrategy::equals_point_point_strategy_type
|
||||
eq_pp_strategy = strategy.get_equals_point_point_strategy();
|
||||
// TEMP
|
||||
std::conditional_t
|
||||
<
|
||||
std::is_same<typename SideStrategy::cs_tag, cartesian_tag>::value,
|
||||
strategy::within::cartesian_point_point,
|
||||
strategy::within::spherical_point_point
|
||||
> eq_pp_strategy;
|
||||
|
||||
std::size_t n = boost::size(ring);
|
||||
if (boost::size(ring) < core_detail::closure::minimum_ring_size
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
// Copyright (c) 2008-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014-2020.
|
||||
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021, 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
|
||||
|
||||
@@ -75,29 +75,7 @@ template
|
||||
>
|
||||
class projected_point
|
||||
{
|
||||
public :
|
||||
typedef within::cartesian_point_point equals_point_point_strategy_type;
|
||||
|
||||
typedef intersection::cartesian_segments
|
||||
<
|
||||
CalculationType
|
||||
> relate_segment_segment_strategy_type;
|
||||
|
||||
static inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy()
|
||||
{
|
||||
return relate_segment_segment_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::cartesian_winding
|
||||
<
|
||||
void, void, CalculationType
|
||||
> point_in_geometry_strategy_type;
|
||||
|
||||
static inline point_in_geometry_strategy_type get_point_in_geometry_strategy()
|
||||
{
|
||||
return point_in_geometry_strategy_type();
|
||||
}
|
||||
|
||||
public:
|
||||
// The three typedefs below are necessary to calculate distances
|
||||
// from segments defined in integer coordinates.
|
||||
|
||||
|
||||
@@ -48,51 +48,6 @@ struct cartesian_segment_box
|
||||
|
||||
typedef cartesian_tag cs_tag;
|
||||
|
||||
// point-point strategy getters
|
||||
struct distance_pp_strategy
|
||||
{
|
||||
typedef Strategy type;
|
||||
};
|
||||
|
||||
inline typename distance_pp_strategy::type get_distance_pp_strategy() const
|
||||
{
|
||||
return typename distance_pp_strategy::type();
|
||||
}
|
||||
// point-segment strategy getters
|
||||
struct distance_ps_strategy
|
||||
{
|
||||
typedef projected_point<CalculationType, Strategy> type;
|
||||
};
|
||||
|
||||
inline typename distance_ps_strategy::type get_distance_ps_strategy() const
|
||||
{
|
||||
return typename distance_ps_strategy::type();
|
||||
}
|
||||
|
||||
struct distance_pb_strategy
|
||||
{
|
||||
typedef pythagoras_point_box<CalculationType> type;
|
||||
};
|
||||
|
||||
inline typename distance_pb_strategy::type get_distance_pb_strategy() const
|
||||
{
|
||||
return typename distance_pb_strategy::type();
|
||||
}
|
||||
|
||||
typedef side::side_by_triangle<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
{
|
||||
return side_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::cartesian_point_point equals_point_point_strategy_type;
|
||||
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename LessEqual, typename ReturnType,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2020.
|
||||
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021, 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
|
||||
@@ -80,115 +80,6 @@ struct cartesian_segments
|
||||
{
|
||||
typedef cartesian_tag cs_tag;
|
||||
|
||||
typedef side::side_by_triangle<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
{
|
||||
return side_strategy_type();
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
struct point_in_geometry_strategy
|
||||
{
|
||||
typedef strategy::within::cartesian_winding
|
||||
<
|
||||
typename point_type<Geometry1>::type,
|
||||
typename point_type<Geometry2>::type,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
static inline typename point_in_geometry_strategy<Geometry1, Geometry2>::type
|
||||
get_point_in_geometry_strategy()
|
||||
{
|
||||
typedef typename point_in_geometry_strategy
|
||||
<
|
||||
Geometry1, Geometry2
|
||||
>::type strategy_type;
|
||||
return strategy_type();
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
struct area_strategy
|
||||
{
|
||||
typedef area::cartesian
|
||||
<
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
static inline typename area_strategy<Geometry>::type get_area_strategy()
|
||||
{
|
||||
typedef typename area_strategy<Geometry>::type strategy_type;
|
||||
return strategy_type();
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
struct distance_strategy
|
||||
{
|
||||
typedef distance::pythagoras
|
||||
<
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
static inline typename distance_strategy<Geometry>::type get_distance_strategy()
|
||||
{
|
||||
typedef typename distance_strategy<Geometry>::type strategy_type;
|
||||
return strategy_type();
|
||||
}
|
||||
|
||||
typedef envelope::cartesian<CalculationType> envelope_strategy_type;
|
||||
|
||||
static inline envelope_strategy_type get_envelope_strategy()
|
||||
{
|
||||
return envelope_strategy_type();
|
||||
}
|
||||
|
||||
typedef expand::cartesian_segment expand_strategy_type;
|
||||
|
||||
static inline expand_strategy_type get_expand_strategy()
|
||||
{
|
||||
return expand_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::cartesian_point_point point_in_point_strategy_type;
|
||||
|
||||
static inline point_in_point_strategy_type get_point_in_point_strategy()
|
||||
{
|
||||
return point_in_point_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::cartesian_point_point equals_point_point_strategy_type;
|
||||
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
typedef disjoint::cartesian_box_box disjoint_box_box_strategy_type;
|
||||
|
||||
static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy()
|
||||
{
|
||||
return disjoint_box_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef disjoint::segment_box disjoint_segment_box_strategy_type;
|
||||
|
||||
static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy()
|
||||
{
|
||||
return disjoint_segment_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef covered_by::cartesian_point_box disjoint_point_box_strategy_type;
|
||||
typedef covered_by::cartesian_point_box covered_by_point_box_strategy_type;
|
||||
typedef within::cartesian_point_box within_point_box_strategy_type;
|
||||
typedef envelope::cartesian_box envelope_box_strategy_type;
|
||||
typedef expand::cartesian_box expand_box_strategy_type;
|
||||
|
||||
template <typename CoordinateType, typename SegmentRatio>
|
||||
struct segment_intersection_info
|
||||
{
|
||||
@@ -511,6 +402,7 @@ struct cartesian_segments
|
||||
return Policy::disjoint();
|
||||
}
|
||||
|
||||
typedef side::side_by_triangle<CalculationType> side_strategy_type;
|
||||
side_info sides;
|
||||
sides.set<0>(side_strategy_type::apply(q1, q2, p1),
|
||||
side_strategy_type::apply(q1, q2, p2));
|
||||
|
||||
@@ -47,19 +47,6 @@ template
|
||||
class cartesian
|
||||
{
|
||||
public:
|
||||
|
||||
// point-point strategy getters
|
||||
struct distance_pp_strategy
|
||||
{
|
||||
typedef DistanceStrategy type;
|
||||
};
|
||||
|
||||
inline typename distance_pp_strategy::type get_distance_pp_strategy() const
|
||||
{
|
||||
typedef typename distance_pp_strategy::type distance_type;
|
||||
return distance_type();
|
||||
}
|
||||
|
||||
template <typename Point, typename Fraction, typename Distance>
|
||||
inline void apply(Point const& p0,
|
||||
Point const& p1,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013-2021.
|
||||
// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@@ -94,43 +94,6 @@ class cartesian_winding
|
||||
public:
|
||||
typedef cartesian_tag cs_tag;
|
||||
|
||||
typedef side::side_by_triangle<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
{
|
||||
return side_strategy_type();
|
||||
}
|
||||
|
||||
typedef expand::cartesian_point expand_point_strategy_type;
|
||||
|
||||
typedef typename side_strategy_type::envelope_strategy_type envelope_strategy_type;
|
||||
|
||||
static inline envelope_strategy_type get_envelope_strategy()
|
||||
{
|
||||
return side_strategy_type::get_envelope_strategy();
|
||||
}
|
||||
|
||||
typedef typename side_strategy_type::disjoint_strategy_type disjoint_strategy_type;
|
||||
|
||||
static inline disjoint_strategy_type get_disjoint_strategy()
|
||||
{
|
||||
return side_strategy_type::get_disjoint_strategy();
|
||||
}
|
||||
|
||||
typedef typename side_strategy_type::equals_point_point_strategy_type equals_point_point_strategy_type;
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return side_strategy_type::get_equals_point_point_strategy();
|
||||
}
|
||||
|
||||
typedef disjoint::cartesian_box_box disjoint_box_box_strategy_type;
|
||||
static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy()
|
||||
{
|
||||
return disjoint_box_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef covered_by::cartesian_point_box disjoint_point_box_strategy_type;
|
||||
|
||||
// Typedefs and static methods to fulfill the concept
|
||||
typedef counter state_type;
|
||||
|
||||
@@ -153,6 +116,7 @@ public:
|
||||
else // count == 2 || count == -2
|
||||
{
|
||||
// 1 left, -1 right
|
||||
typedef side::side_by_triangle<CalculationType> side_strategy_type;
|
||||
side = side_strategy_type::apply(s1, s2, point);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,26 +73,6 @@ class side_by_triangle
|
||||
public :
|
||||
typedef cartesian_tag cs_tag;
|
||||
|
||||
typedef strategy::envelope::cartesian<CalculationType> envelope_strategy_type;
|
||||
|
||||
static inline envelope_strategy_type get_envelope_strategy()
|
||||
{
|
||||
return envelope_strategy_type();
|
||||
}
|
||||
|
||||
typedef strategy::disjoint::segment_box disjoint_strategy_type;
|
||||
|
||||
static inline disjoint_strategy_type get_disjoint_strategy()
|
||||
{
|
||||
return disjoint_strategy_type();
|
||||
}
|
||||
|
||||
typedef strategy::within::cartesian_point_point equals_point_point_strategy_type;
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
// Template member function, because it is not always trivial
|
||||
// or convenient to explicitly mention the typenames in the
|
||||
// strategy-struct itself.
|
||||
|
||||
@@ -89,32 +89,7 @@ template
|
||||
>
|
||||
class geographic_cross_track
|
||||
{
|
||||
public :
|
||||
typedef within::spherical_point_point equals_point_point_strategy_type;
|
||||
|
||||
typedef intersection::geographic_segments
|
||||
<
|
||||
FormulaPolicy,
|
||||
strategy::default_order<FormulaPolicy>::value,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> relate_segment_segment_strategy_type;
|
||||
|
||||
inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy() const
|
||||
{
|
||||
return relate_segment_segment_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef within::geographic_winding
|
||||
<
|
||||
void, void, FormulaPolicy, Spheroid, CalculationType
|
||||
> point_in_geometry_strategy_type;
|
||||
|
||||
inline point_in_geometry_strategy_type get_point_in_geometry_strategy() const
|
||||
{
|
||||
return point_in_geometry_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename Point, typename PointOfSegment>
|
||||
struct return_type
|
||||
: promote_floating_point
|
||||
@@ -128,7 +103,9 @@ public :
|
||||
>
|
||||
{};
|
||||
|
||||
explicit geographic_cross_track(Spheroid const& spheroid = Spheroid())
|
||||
geographic_cross_track() = default;
|
||||
|
||||
explicit geographic_cross_track(Spheroid const& spheroid)
|
||||
: m_spheroid(spheroid)
|
||||
{}
|
||||
|
||||
|
||||
@@ -59,68 +59,6 @@ struct geographic_segment_box
|
||||
|
||||
typedef geographic_tag cs_tag;
|
||||
|
||||
// point-point strategy getters
|
||||
struct distance_pp_strategy
|
||||
{
|
||||
typedef geographic<FormulaPolicy, Spheroid, CalculationType> type;
|
||||
};
|
||||
|
||||
inline typename distance_pp_strategy::type get_distance_pp_strategy() const
|
||||
{
|
||||
typedef typename distance_pp_strategy::type distance_type;
|
||||
return distance_type(m_spheroid);
|
||||
}
|
||||
// point-segment strategy getters
|
||||
struct distance_ps_strategy
|
||||
{
|
||||
typedef geographic_cross_track
|
||||
<
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
inline typename distance_ps_strategy::type get_distance_ps_strategy() const
|
||||
{
|
||||
typedef typename distance_ps_strategy::type distance_type;
|
||||
return distance_type(m_spheroid);
|
||||
}
|
||||
|
||||
struct distance_pb_strategy
|
||||
{
|
||||
typedef geographic_cross_track_point_box
|
||||
<
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
inline typename distance_pb_strategy::type get_distance_pb_strategy() const
|
||||
{
|
||||
return typename distance_pb_strategy::type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef side::geographic
|
||||
<
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> side_strategy_type;
|
||||
|
||||
inline side_strategy_type get_side_strategy() const
|
||||
{
|
||||
return side_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef within::spherical_point_point equals_point_point_strategy_type;
|
||||
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
//constructor
|
||||
|
||||
explicit geographic_segment_box(Spheroid const& spheroid = Spheroid())
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2016-2020, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-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,
|
||||
@@ -80,130 +80,6 @@ struct geographic_segments
|
||||
{
|
||||
typedef geographic_tag cs_tag;
|
||||
|
||||
typedef side::geographic
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
> side_strategy_type;
|
||||
|
||||
inline side_strategy_type get_side_strategy() const
|
||||
{
|
||||
return side_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
struct point_in_geometry_strategy
|
||||
{
|
||||
typedef strategy::within::geographic_winding
|
||||
<
|
||||
typename point_type<Geometry1>::type,
|
||||
typename point_type<Geometry2>::type,
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
inline typename point_in_geometry_strategy<Geometry1, Geometry2>::type
|
||||
get_point_in_geometry_strategy() const
|
||||
{
|
||||
typedef typename point_in_geometry_strategy
|
||||
<
|
||||
Geometry1, Geometry2
|
||||
>::type strategy_type;
|
||||
return strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
struct area_strategy
|
||||
{
|
||||
typedef area::geographic
|
||||
<
|
||||
FormulaPolicy,
|
||||
Order,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
inline typename area_strategy<Geometry>::type get_area_strategy() const
|
||||
{
|
||||
typedef typename area_strategy<Geometry>::type strategy_type;
|
||||
return strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
struct distance_strategy
|
||||
{
|
||||
typedef distance::geographic
|
||||
<
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
inline typename distance_strategy<Geometry>::type get_distance_strategy() const
|
||||
{
|
||||
typedef typename distance_strategy<Geometry>::type strategy_type;
|
||||
return strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef envelope::geographic<FormulaPolicy, Spheroid, CalculationType>
|
||||
envelope_strategy_type;
|
||||
|
||||
inline envelope_strategy_type get_envelope_strategy() const
|
||||
{
|
||||
return envelope_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef expand::geographic_segment<FormulaPolicy, Spheroid, CalculationType>
|
||||
expand_strategy_type;
|
||||
|
||||
inline expand_strategy_type get_expand_strategy() const
|
||||
{
|
||||
return expand_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef within::spherical_point_point point_in_point_strategy_type;
|
||||
|
||||
static inline point_in_point_strategy_type get_point_in_point_strategy()
|
||||
{
|
||||
return point_in_point_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::spherical_point_point equals_point_point_strategy_type;
|
||||
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
typedef disjoint::spherical_box_box disjoint_box_box_strategy_type;
|
||||
|
||||
static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy()
|
||||
{
|
||||
return disjoint_box_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef disjoint::segment_box_geographic
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
> disjoint_segment_box_strategy_type;
|
||||
|
||||
inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() const
|
||||
{
|
||||
return disjoint_segment_box_strategy_type(m_spheroid);
|
||||
}
|
||||
|
||||
typedef covered_by::spherical_point_box disjoint_point_box_strategy_type;
|
||||
typedef covered_by::spherical_point_box covered_by_point_box_strategy_type;
|
||||
typedef within::spherical_point_box within_point_box_strategy_type;
|
||||
typedef envelope::spherical_box envelope_box_strategy_type;
|
||||
typedef expand::spherical_box expand_box_strategy_type;
|
||||
|
||||
enum intersection_point_flag { ipi_inters = 0, ipi_at_a1, ipi_at_a2, ipi_at_b1, ipi_at_b2 };
|
||||
|
||||
template <typename CoordinateType, typename SegmentRatio>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2018, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2018-2021, 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
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -49,26 +50,12 @@ template
|
||||
class geographic
|
||||
{
|
||||
public:
|
||||
geographic()
|
||||
: m_spheroid()
|
||||
{}
|
||||
geographic() = default;
|
||||
|
||||
explicit geographic(Spheroid const& spheroid)
|
||||
: m_spheroid(spheroid)
|
||||
{}
|
||||
|
||||
// point-point strategy getters
|
||||
struct distance_pp_strategy
|
||||
{
|
||||
typedef distance::geographic<FormulaPolicy, Spheroid, CalculationType> type;
|
||||
};
|
||||
|
||||
inline typename distance_pp_strategy::type get_distance_pp_strategy() const
|
||||
{
|
||||
typedef typename distance_pp_strategy::type distance_type;
|
||||
return distance_type(m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Point, typename Fraction, typename Distance>
|
||||
inline void apply(Point const& p0,
|
||||
Point const& p1,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2017, 2019 Oracle and/or its affiliates.
|
||||
// Copyright (c) 2017-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,
|
||||
|
||||
@@ -67,38 +67,7 @@ class geographic
|
||||
public:
|
||||
typedef geographic_tag cs_tag;
|
||||
|
||||
typedef strategy::envelope::geographic
|
||||
<
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> envelope_strategy_type;
|
||||
|
||||
inline envelope_strategy_type get_envelope_strategy() const
|
||||
{
|
||||
return envelope_strategy_type(m_model);
|
||||
}
|
||||
|
||||
typedef strategy::disjoint::segment_box_geographic
|
||||
<
|
||||
FormulaPolicy,
|
||||
Spheroid,
|
||||
CalculationType
|
||||
> disjoint_strategy_type;
|
||||
|
||||
inline disjoint_strategy_type get_disjoint_strategy() const
|
||||
{
|
||||
return disjoint_strategy_type(m_model);
|
||||
}
|
||||
|
||||
typedef strategy::within::spherical_point_point equals_point_point_strategy_type;
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
geographic()
|
||||
{}
|
||||
geographic() = default;
|
||||
|
||||
explicit geographic(Spheroid const& model)
|
||||
: m_model(model)
|
||||
@@ -107,6 +76,7 @@ public:
|
||||
template <typename P1, typename P2, typename P>
|
||||
inline int apply(P1 const& p1, P2 const& p2, P const& p) const
|
||||
{
|
||||
typedef strategy::within::spherical_point_point equals_point_point_strategy_type;
|
||||
if (equals_point_point_strategy_type::apply(p, p1)
|
||||
|| equals_point_point_strategy_type::apply(p, p2)
|
||||
|| equals_point_point_strategy_type::apply(p1, p2))
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014-2020.
|
||||
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
@@ -329,29 +329,7 @@ template
|
||||
>
|
||||
class cross_track
|
||||
{
|
||||
public :
|
||||
typedef within::spherical_point_point equals_point_point_strategy_type;
|
||||
|
||||
typedef intersection::spherical_segments
|
||||
<
|
||||
CalculationType
|
||||
> relate_segment_segment_strategy_type;
|
||||
|
||||
static inline relate_segment_segment_strategy_type get_relate_segment_segment_strategy()
|
||||
{
|
||||
return relate_segment_segment_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::spherical_winding
|
||||
<
|
||||
void, void, CalculationType
|
||||
> point_in_geometry_strategy_type;
|
||||
|
||||
static inline point_in_geometry_strategy_type get_point_in_geometry_strategy()
|
||||
{
|
||||
return point_in_geometry_strategy_type();
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename Point, typename PointOfSegment>
|
||||
struct return_type
|
||||
: promote_floating_point
|
||||
@@ -367,8 +345,7 @@ public :
|
||||
|
||||
typedef typename Strategy::radius_type radius_type;
|
||||
|
||||
inline cross_track()
|
||||
{}
|
||||
cross_track() = default;
|
||||
|
||||
explicit inline cross_track(typename Strategy::radius_type const& r)
|
||||
: m_strategy(r)
|
||||
|
||||
@@ -214,55 +214,6 @@ struct spherical_segment_box
|
||||
|
||||
typedef spherical_tag cs_tag;
|
||||
|
||||
// strategy getters
|
||||
|
||||
// point-point strategy getters
|
||||
struct distance_pp_strategy
|
||||
{
|
||||
typedef Strategy type;
|
||||
};
|
||||
|
||||
inline Strategy get_distance_pp_strategy() const
|
||||
{
|
||||
return m_strategy;
|
||||
}
|
||||
// point-segment strategy getters
|
||||
struct distance_ps_strategy
|
||||
{
|
||||
typedef cross_track<CalculationType, Strategy> type;
|
||||
};
|
||||
|
||||
inline typename distance_ps_strategy::type get_distance_ps_strategy() const
|
||||
{
|
||||
return typename distance_ps_strategy::type(m_strategy.radius());
|
||||
}
|
||||
|
||||
struct distance_pb_strategy
|
||||
{
|
||||
typedef cross_track_point_box<CalculationType, Strategy> type;
|
||||
};
|
||||
|
||||
inline typename distance_pb_strategy::type get_distance_pb_strategy() const
|
||||
{
|
||||
return typename distance_pb_strategy::type(m_strategy.radius());
|
||||
}
|
||||
|
||||
// TODO: why is the Radius not propagated above?
|
||||
|
||||
typedef side::spherical_side_formula<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
{
|
||||
return side_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::spherical_point_point equals_point_point_strategy_type;
|
||||
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
// constructors
|
||||
|
||||
inline spherical_segment_box()
|
||||
|
||||
@@ -96,119 +96,6 @@ struct ecef_segments
|
||||
{
|
||||
typedef spherical_tag cs_tag;
|
||||
|
||||
typedef side::spherical_side_formula<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
{
|
||||
return side_strategy_type();
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
struct point_in_geometry_strategy
|
||||
{
|
||||
typedef strategy::within::spherical_winding
|
||||
<
|
||||
typename point_type<Geometry1>::type,
|
||||
typename point_type<Geometry2>::type,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
static inline typename point_in_geometry_strategy<Geometry1, Geometry2>::type
|
||||
get_point_in_geometry_strategy()
|
||||
{
|
||||
typedef typename point_in_geometry_strategy
|
||||
<
|
||||
Geometry1, Geometry2
|
||||
>::type strategy_type;
|
||||
return strategy_type();
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
struct area_strategy
|
||||
{
|
||||
typedef area::spherical
|
||||
<
|
||||
typename coordinate_type<Geometry>::type,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
static inline typename area_strategy<Geometry>::type get_area_strategy()
|
||||
{
|
||||
typedef typename area_strategy<Geometry>::type strategy_type;
|
||||
return strategy_type();
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
struct distance_strategy
|
||||
{
|
||||
typedef distance::haversine
|
||||
<
|
||||
typename coordinate_type<Geometry>::type,
|
||||
CalculationType
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
static inline typename distance_strategy<Geometry>::type get_distance_strategy()
|
||||
{
|
||||
typedef typename distance_strategy<Geometry>::type strategy_type;
|
||||
return strategy_type();
|
||||
}
|
||||
|
||||
typedef envelope::spherical<CalculationType>
|
||||
envelope_strategy_type;
|
||||
|
||||
static inline envelope_strategy_type get_envelope_strategy()
|
||||
{
|
||||
return envelope_strategy_type();
|
||||
}
|
||||
|
||||
typedef expand::spherical_segment<CalculationType>
|
||||
expand_strategy_type;
|
||||
|
||||
static inline expand_strategy_type get_expand_strategy()
|
||||
{
|
||||
return expand_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::spherical_point_point point_in_point_strategy_type;
|
||||
|
||||
static inline point_in_point_strategy_type get_point_in_point_strategy()
|
||||
{
|
||||
return point_in_point_strategy_type();
|
||||
}
|
||||
|
||||
typedef within::spherical_point_point equals_point_point_strategy_type;
|
||||
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
typedef disjoint::spherical_box_box disjoint_box_box_strategy_type;
|
||||
|
||||
static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy()
|
||||
{
|
||||
return disjoint_box_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef disjoint::segment_box_spherical disjoint_segment_box_strategy_type;
|
||||
|
||||
static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy()
|
||||
{
|
||||
return disjoint_segment_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef covered_by::spherical_point_box disjoint_point_box_strategy_type;
|
||||
typedef covered_by::spherical_point_box covered_by_point_box_strategy_type;
|
||||
typedef within::spherical_point_box within_point_box_strategy_type;
|
||||
typedef envelope::spherical_box envelope_box_strategy_type;
|
||||
typedef expand::spherical_box expand_box_strategy_type;
|
||||
|
||||
enum intersection_point_flag { ipi_inters = 0, ipi_at_a1, ipi_at_a2, ipi_at_b1, ipi_at_b2 };
|
||||
|
||||
// segment_intersection_info cannot outlive relate_ecef_segments
|
||||
|
||||
@@ -52,8 +52,7 @@ public:
|
||||
|
||||
typedef typename DistanceStrategy::radius_type radius_type;
|
||||
|
||||
inline spherical()
|
||||
{}
|
||||
spherical() = default;
|
||||
|
||||
explicit inline spherical(typename DistanceStrategy::radius_type const& r)
|
||||
: m_strategy(r)
|
||||
@@ -63,17 +62,6 @@ public:
|
||||
: m_strategy(s)
|
||||
{}
|
||||
|
||||
// point-point strategy getters
|
||||
struct distance_pp_strategy
|
||||
{
|
||||
typedef DistanceStrategy type;
|
||||
};
|
||||
|
||||
inline typename distance_pp_strategy::type get_distance_pp_strategy() const
|
||||
{
|
||||
return m_strategy;
|
||||
}
|
||||
|
||||
template <typename Point, typename Fraction, typename Distance>
|
||||
inline void apply(Point const& p0,
|
||||
Point const& p1,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013-2021.
|
||||
// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@@ -123,45 +123,7 @@ class spherical_winding_base
|
||||
public:
|
||||
typedef typename SideStrategy::cs_tag cs_tag;
|
||||
|
||||
typedef SideStrategy side_strategy_type;
|
||||
|
||||
inline side_strategy_type get_side_strategy() const
|
||||
{
|
||||
return m_side_strategy;
|
||||
}
|
||||
|
||||
typedef expand::spherical_point expand_point_strategy_type;
|
||||
|
||||
typedef typename SideStrategy::envelope_strategy_type envelope_strategy_type;
|
||||
|
||||
inline envelope_strategy_type get_envelope_strategy() const
|
||||
{
|
||||
return m_side_strategy.get_envelope_strategy();
|
||||
}
|
||||
|
||||
typedef typename SideStrategy::disjoint_strategy_type disjoint_strategy_type;
|
||||
|
||||
inline disjoint_strategy_type get_disjoint_strategy() const
|
||||
{
|
||||
return m_side_strategy.get_disjoint_strategy();
|
||||
}
|
||||
|
||||
typedef typename SideStrategy::equals_point_point_strategy_type equals_point_point_strategy_type;
|
||||
inline equals_point_point_strategy_type get_equals_point_point_strategy() const
|
||||
{
|
||||
return m_side_strategy.get_equals_point_point_strategy();
|
||||
}
|
||||
|
||||
typedef disjoint::spherical_box_box disjoint_box_box_strategy_type;
|
||||
static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy()
|
||||
{
|
||||
return disjoint_box_box_strategy_type();
|
||||
}
|
||||
|
||||
typedef covered_by::spherical_point_box disjoint_point_box_strategy_type;
|
||||
|
||||
spherical_winding_base()
|
||||
{}
|
||||
spherical_winding_base() = default;
|
||||
|
||||
template <typename Model>
|
||||
explicit spherical_winding_base(Model const& model)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2016-2020.
|
||||
// Modifications copyright (c) 2016-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2016-2021.
|
||||
// Modifications copyright (c) 2016-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,
|
||||
@@ -88,26 +88,6 @@ class spherical_side_formula
|
||||
public :
|
||||
typedef spherical_tag cs_tag;
|
||||
|
||||
typedef strategy::envelope::spherical<CalculationType> envelope_strategy_type;
|
||||
|
||||
static inline envelope_strategy_type get_envelope_strategy()
|
||||
{
|
||||
return envelope_strategy_type();
|
||||
}
|
||||
|
||||
typedef strategy::disjoint::segment_box_spherical disjoint_strategy_type;
|
||||
|
||||
static inline disjoint_strategy_type get_disjoint_strategy()
|
||||
{
|
||||
return disjoint_strategy_type();
|
||||
}
|
||||
|
||||
typedef strategy::within::spherical_point_point equals_point_point_strategy_type;
|
||||
static inline equals_point_point_strategy_type get_equals_point_point_strategy()
|
||||
{
|
||||
return equals_point_point_strategy_type();
|
||||
}
|
||||
|
||||
template <typename P1, typename P2, typename P>
|
||||
static inline int apply(P1 const& p1, P2 const& p2, P const& p)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user