Skip to content

Commit

Permalink
Remove segment_ratio with policy
Browse files Browse the repository at this point in the history
  • Loading branch information
vissarion committed May 27, 2024
1 parent f367f82 commit 5511f9e
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 80 deletions.
2 changes: 1 addition & 1 deletion example/05_b_overlay_linestring_polygon_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main(void)
#endif

// Calculate intersection points (turn points)
using segment_ratio = bg::detail::segment_ratio_type<point_2d, bg::detail::no_rescale_policy>::type;
using segment_ratio = bg::detail::segment_ratio_type<point_2d>::type;
using turn_info = bg::detail::overlay::turn_info<point_2d, segment_ratio>;
std::vector<turn_info> turns;
bg::detail::get_turns::no_interrupt_policy policy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ struct buffered_piece_collection
typedef buffer_turn_info
<
point_type,
typename segment_ratio_type<point_type, no_rescale_policy>::type
typename segment_ratio_type<point_type>::type
> buffer_turn_info_type;

typedef buffer_turn_operation
<
point_type,
typename segment_ratio_type<point_type, no_rescale_policy>::type
typename segment_ratio_type<point_type>::type
> buffer_turn_operation_type;

typedef std::vector<buffer_turn_info_type> turn_vector_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>

#include <boost/geometry/policies/disjoint_interrupt_policy.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>

#ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS
# include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
Expand Down Expand Up @@ -74,7 +73,7 @@ inline bool has_self_intersections(Geometry const& geometry,
typedef turn_info
<
point_type,
typename segment_ratio_type<point_type, no_rescale_policy>::type
typename segment_ratio_type<point_type>::type
> turn_info;
std::deque<turn_info> turns;
detail::disjoint::disjoint_interrupt_policy policy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <boost/geometry/core/point_type.hpp>

#include <boost/geometry/policies/predicate_based_interrupt_policy.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>

namespace boost { namespace geometry
{
Expand All @@ -51,11 +50,7 @@ class has_valid_self_turns
typedef detail::overlay::turn_info
<
point_type,
typename segment_ratio_type
<
point_type,
no_rescale_policy
>::type
typename segment_ratio_type<point_type>::type
> turn_type;

// returns true if all turns are valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <boost/geometry/geometries/concepts/check.hpp>

#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>

#include <boost/geometry/strategies/default_strategy.hpp>
#include <boost/geometry/strategies/detail.hpp>
Expand Down Expand Up @@ -397,7 +396,7 @@ struct intersection_areal_areal_point
typedef detail::overlay::turn_info
<
PointOut,
typename segment_ratio_type<PointOut, no_rescale_policy>::type
typename segment_ratio_type<PointOut>::type
> turn_info;
std::vector<turn_info> turns;

Expand Down
4 changes: 1 addition & 3 deletions include/boost/geometry/algorithms/detail/overlay/overlay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
#include <boost/geometry/algorithms/detail/overlay/select_rings.hpp>
#include <boost/geometry/algorithms/detail/overlay/do_reverse.hpp>

#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>

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

#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
Expand Down Expand Up @@ -257,7 +255,7 @@ struct overlay
typedef detail::overlay::traversal_turn_info
<
point_type,
typename segment_ratio_type<point_type, no_rescale_policy>::type
typename segment_ratio_type<point_type>::type
> turn_info;
typedef std::deque<turn_info> turn_container_type;

Expand Down
4 changes: 1 addition & 3 deletions include/boost/geometry/algorithms/detail/relate/turns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

#include <boost/geometry/geometries/helper_geometry.hpp>

#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>

#include <boost/geometry/strategies/cartesian/point_in_point.hpp>
#include <boost/geometry/strategies/spherical/point_in_point.hpp>
#include <boost/geometry/strategies/distance.hpp>
Expand Down Expand Up @@ -65,7 +63,7 @@ struct get_turns
>
struct turn_info_type
{
using ratio_type = typename segment_ratio_type<turn_point_type, no_rescale_policy>::type;
using ratio_type = typename segment_ratio_type<turn_point_type>::type;
using type = overlay::turn_info
<
turn_point_type,
Expand Down
5 changes: 5 additions & 0 deletions include/boost/geometry/policies/robustness/segment_ratio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ private :
}
};

template <typename Point>
struct segment_ratio_type
{
using type = segment_ratio<typename geometry::coordinate_type<Point>::type>;
};

}} // namespace boost::geometry

Expand Down
54 changes: 0 additions & 54 deletions include/boost/geometry/policies/robustness/segment_ratio_type.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//#include <type_traits>

#include <boost/geometry/policies/relate/intersection_policy.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>

#include <boost/geometry/strategies/intersection.hpp>
#include <boost/geometry/strategies/intersection_result.hpp>
Expand Down Expand Up @@ -47,15 +46,10 @@ template
struct intersection_strategies
{
private :
// for development BOOST_STATIC_ASSERT((! std::is_same<RobustPolicy, void>::type::value));

typedef segment_intersection_points
<
IntersectionPoint,
typename detail::segment_ratio_type
<
IntersectionPoint, RobustPolicy
>::type
typename segment_ratio_type<IntersectionPoint>::type
> ip_type;

public:
Expand Down

0 comments on commit 5511f9e

Please sign in to comment.