diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:08:07 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:09:00 +0900 |
commit | b5c87084afaef42b2d058f68091be31988a6a874 (patch) | |
tree | adef9a65870a41181687e11d57fdf98e7629de3c /boost/geometry/algorithms/detail/is_valid/ring.hpp | |
parent | 34bd32e225e2a8a94104489b31c42e5801cc1f4a (diff) | |
download | boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.gz boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.bz2 boost-b5c87084afaef42b2d058f68091be31988a6a874.zip |
Imported Upstream version 1.64.0upstream/1.64.0
Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/algorithms/detail/is_valid/ring.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/is_valid/ring.hpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/boost/geometry/algorithms/detail/is_valid/ring.hpp b/boost/geometry/algorithms/detail/is_valid/ring.hpp index 925c03a472..9ab68fdc48 100644 --- a/boost/geometry/algorithms/detail/is_valid/ring.hpp +++ b/boost/geometry/algorithms/detail/is_valid/ring.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2015, Oracle and/or its affiliates. +// Copyright (c) 2014-2017, 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 @@ -101,26 +101,21 @@ struct ring_area_predicate<ResultType, true> template <typename Ring, bool IsInteriorRing> struct is_properly_oriented { - typedef typename point_type<Ring>::type point_type; - - typedef typename strategy::area::services::default_strategy - < - typename cs_tag<point_type>::type, - point_type - >::type strategy_type; + template <typename VisitPolicy, typename Strategy> + static inline bool apply(Ring const& ring, VisitPolicy& visitor, + Strategy const& strategy) + { + boost::ignore_unused(visitor); - typedef detail::area::ring_area - < - order_as_direction<geometry::point_order<Ring>::value>::value, - geometry::closure<Ring>::value - > ring_area_type; + typedef typename point_type<Ring>::type point_type; - typedef typename default_area_result<Ring>::type area_result_type; + typedef detail::area::ring_area + < + order_as_direction<geometry::point_order<Ring>::value>::value, + geometry::closure<Ring>::value + > ring_area_type; - template <typename VisitPolicy> - static inline bool apply(Ring const& ring, VisitPolicy& visitor) - { - boost::ignore_unused(visitor); + typedef typename default_area_result<Ring>::type area_result_type; typename ring_area_predicate < @@ -128,8 +123,11 @@ struct is_properly_oriented >::type predicate; // Check area - area_result_type const zero = area_result_type(); - if (predicate(ring_area_type::apply(ring, strategy_type()), zero)) + area_result_type const zero = 0; + area_result_type const area + = ring_area_type::apply(ring, + strategy.template get_area_strategy<point_type>()); + if (predicate(area, zero)) { return visitor.template apply<no_failure>(); } @@ -150,8 +148,9 @@ template > struct is_valid_ring { - template <typename VisitPolicy> - static inline bool apply(Ring const& ring, VisitPolicy& visitor) + template <typename VisitPolicy, typename Strategy> + static inline bool apply(Ring const& ring, VisitPolicy& visitor, + Strategy const& strategy) { // return invalid if any of the following condition holds: // (a) the ring's point coordinates are not invalid (e.g., NaN) @@ -198,8 +197,8 @@ struct is_valid_ring && ! has_duplicates<Ring, closure>::apply(ring, visitor) && ! has_spikes<Ring, closure>::apply(ring, visitor) && (! CheckSelfIntersections - || has_valid_self_turns<Ring>::apply(ring, visitor)) - && is_properly_oriented<Ring, IsInteriorRing>::apply(ring, visitor); + || has_valid_self_turns<Ring>::apply(ring, visitor, strategy)) + && is_properly_oriented<Ring, IsInteriorRing>::apply(ring, visitor, strategy); } }; |