From fe2bdfd169f0f8adec044c684e2367cd097e814a Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 7 Feb 2017 20:11:45 +0100 Subject: [PATCH] [disjoint] Rename PiGStrategy to Strategy. --- .../detail/disjoint/areal_areal.hpp | 39 +++++++++------ .../detail/disjoint/linear_areal.hpp | 49 +++++++++---------- .../detail/disjoint/linear_segment_or_box.hpp | 8 +-- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp b/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp index 860d61fb4..664c99538 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp @@ -42,8 +42,11 @@ namespace detail { namespace disjoint template ::type> struct check_each_ring_for_within_call_covered_by { - template - static inline bool apply(Point const& p, Geometry const& g, PiGStrategy const& strategy) + /*! + \tparam Strategy point_in_geometry strategy + */ + template + static inline bool apply(Point const& p, Geometry const& g, Strategy const& strategy) { return geometry::covered_by(p, g, strategy); } @@ -52,26 +55,29 @@ struct check_each_ring_for_within_call_covered_by template struct check_each_ring_for_within_call_covered_by { - template - static inline bool apply(Point const& p, Geometry const& g, PiGStrategy const& ) + template + static inline bool apply(Point const& p, Geometry const& g, Strategy const& ) { return geometry::covered_by(p, g); } }; -template +/*! +\tparam Strategy point_in_geometry strategy +*/ +template struct check_each_ring_for_within { bool not_disjoint; Geometry const& m_geometry; - PiGStrategy const& m_pig_strategy; + Strategy const& m_strategy; inline check_each_ring_for_within(Geometry const& g, - PiGStrategy const& pig_strategy) + Strategy const& strategy) : not_disjoint(false) , m_geometry(g) - , m_pig_strategy(pig_strategy) + , m_strategy(strategy) {} template @@ -83,21 +89,23 @@ struct check_each_ring_for_within && check_each_ring_for_within_call_covered_by < Geometry - >::apply(pt, m_geometry, m_pig_strategy) ); + >::apply(pt, m_geometry, m_strategy) ); } }; - -template +/*! +\tparam Strategy point_in_geometry strategy +*/ +template inline bool rings_containing(FirstGeometry const& geometry1, SecondGeometry const& geometry2, - PiGStrategy const& pig_strategy) + Strategy const& strategy) { check_each_ring_for_within < - FirstGeometry, PiGStrategy - > checker(geometry1, pig_strategy); + FirstGeometry, Strategy + > checker(geometry1, strategy); geometry::detail::for_each_range(geometry2, checker); return checker.not_disjoint; } @@ -107,6 +115,9 @@ inline bool rings_containing(FirstGeometry const& geometry1, template struct general_areal { + /*! + \tparam Strategy relate (segments intersection) strategy + */ template static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp index d1101f165..e6077d3e7 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp @@ -61,22 +61,28 @@ template ::type> struct disjoint_no_intersections_policy { - template - static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, PiGStrategy const& pig_strategy) + /*! + \tparam Strategy point_in_geometry strategy + */ + template + static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy) { typedef typename point_type::type point1_type; point1_type p; geometry::point_on_border(p, g1); - return !geometry::covered_by(p, g2, pig_strategy); + return !geometry::covered_by(p, g2, strategy); } }; template struct disjoint_no_intersections_policy { - template - static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, PiGStrategy const& pig_strategy) + /*! + \tparam Strategy point_in_geometry strategy + */ + template + static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy) { // TODO: use partition or rtree on g2 typedef typename boost::range_iterator::type iterator; @@ -84,7 +90,7 @@ struct disjoint_no_intersections_policy { typedef typename boost::range_value::type value_type; if ( ! disjoint_no_intersections_policy - ::apply(*it, g2, pig_strategy) ) + ::apply(*it, g2, strategy) ) { return false; } @@ -99,6 +105,9 @@ template > struct disjoint_linear_areal { + /*! + \tparam Strategy relate (segments intersection) strategy + */ template static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy) { @@ -108,13 +117,9 @@ struct disjoint_linear_areal return false; } - typename Strategy::template point_in_geometry_strategy - < - Geometry1, Geometry2 - >::type - pig_strategy = strategy.template get_point_in_geometry_strategy(); - - return NoIntersectionsPolicy::apply(g1, g2, pig_strategy); + return NoIntersectionsPolicy + ::apply(g1, g2, + strategy.template get_point_in_geometry_strategy()); } }; @@ -184,16 +189,11 @@ public: return false; } - typename IntersectionStrategy::template point_in_geometry_strategy - < - Segment, Polygon - >::type - pig_strategy = strategy.template get_point_in_geometry_strategy(); - typename point_type::type p; detail::assign_point_from_index<0>(segment, p); - return !geometry::covered_by(p, polygon, pig_strategy); + return !geometry::covered_by(p, polygon, + strategy.template get_point_in_geometry_strategy()); } }; @@ -229,16 +229,11 @@ struct disjoint_segment_areal return false; } - typename IntersectionStrategy::template point_in_geometry_strategy - < - Segment, Ring - >::type - pig_strategy = strategy.template get_point_in_geometry_strategy(); - typename point_type::type p; detail::assign_point_from_index<0>(segment, p); - return !geometry::covered_by(p, ring, pig_strategy); + return !geometry::covered_by(p, ring, + strategy.template get_point_in_geometry_strategy()); } }; diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp index 1f6c92542..b4c71c8f3 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp @@ -83,18 +83,12 @@ struct disjoint_range_segment_or_box } else if ( count == 1 ) { - typename Strategy::template point_in_geometry_strategy - < - Range, SegmentOrBox - >::type - pig_strategy = strategy.template get_point_in_geometry_strategy(); - return dispatch::disjoint < point_type, SegmentOrBox >::apply(geometry::range::front(view), segment_or_box, - pig_strategy); + strategy.template get_point_in_geometry_strategy()); } else {