// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2018-2019 Oracle and/or its affiliates.
+// Copyright (c) 2018-2021 Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
#include <boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp>
#include <boost/geometry/strategies/cartesian/point_in_point.hpp>
-#include <boost/geometry/strategies/cartesian/side_by_triangle.hpp>
namespace boost { namespace geometry
{
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,
- typename SegmentPoint, typename BoxPoint>
+ template
+ <
+ typename LessEqual, typename ReturnType,
+ typename SegmentPoint, typename BoxPoint,
+ typename Strategies
+ >
inline ReturnType segment_below_of_box(SegmentPoint const& p0,
- SegmentPoint const& p1,
- BoxPoint const&,
- BoxPoint const&,
- BoxPoint const&,
- BoxPoint const& bottom_right) const
+ SegmentPoint const& p1,
+ BoxPoint const&,
+ BoxPoint const&,
+ BoxPoint const&,
+ BoxPoint const& bottom_right,
+ Strategies const& strategies) const
{
-
-
+ // TODO: The strategy should not call the algorithm like that
return geometry::detail::distance::segment_to_box_2D
<
ReturnType,
SegmentPoint,
BoxPoint,
- cartesian_segment_box<CalculationType, Strategy>
+ Strategies
>::template call_above_of_box
<
typename LessEqual::other
- >(p1, p0, bottom_right, *this);
+ >(p1, p0, bottom_right, strategies);
}
template <typename SPoint, typename BPoint>