summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/is_valid/polygon.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/is_valid/polygon.hpp')
-rw-r--r--boost/geometry/algorithms/detail/is_valid/polygon.hpp35
1 files changed, 11 insertions, 24 deletions
diff --git a/boost/geometry/algorithms/detail/is_valid/polygon.hpp b/boost/geometry/algorithms/detail/is_valid/polygon.hpp
index 5c6229b793..834ce5af2c 100644
--- a/boost/geometry/algorithms/detail/is_valid/polygon.hpp
+++ b/boost/geometry/algorithms/detail/is_valid/polygon.hpp
@@ -2,7 +2,7 @@
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
-// Copyright (c) 2014-2017, Oracle and/or its affiliates.
+// Copyright (c) 2014-2018, 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
@@ -217,26 +217,19 @@ protected:
, m_strategy(strategy)
{}
- template <typename Item>
- inline bool is_within(Item const& first, Item const& second)
- {
- typename point_type<Polygon>::type point;
- typedef detail::point_on_border::point_on_range<true> pob;
-
- // TODO: this should check for a point on the interior, instead
- // of on border. Or it should check using the overlap function.
-
- return pob::apply(point, points_begin(first), points_end(first))
- && geometry::within(point, second, m_strategy);
- }
-
template <typename Iterator, typename Box>
inline bool apply(partition_item<Iterator, Box> const& item1,
partition_item<Iterator, Box> const& item2)
{
- if (! items_overlap
- && (is_within(*item1.get(), *item2.get())
- || is_within(*item2.get(), *item1.get())))
+ typedef boost::mpl::vector
+ <
+ geometry::de9im::static_mask<'T'>,
+ geometry::de9im::static_mask<'*', 'T'>,
+ geometry::de9im::static_mask<'*', '*', '*', 'T'>
+ > relate_mask_t;
+
+ if ( ! items_overlap
+ && geometry::relate(*item1.get(), *item2.get(), relate_mask_t(), m_strategy) )
{
items_overlap = true;
return false; // interrupt
@@ -326,19 +319,13 @@ protected:
}
// prepare strategies
- typedef typename Strategy::template point_in_geometry_strategy
- <
- inter_ring_type, inter_ring_type
- >::type in_interior_strategy_type;
- in_interior_strategy_type const in_interior_strategy
- = strategy.template get_point_in_geometry_strategy<inter_ring_type, inter_ring_type>();
typedef typename Strategy::envelope_strategy_type envelope_strategy_type;
envelope_strategy_type const envelope_strategy
= strategy.get_envelope_strategy();
// call partition to check if interior rings are disjoint from
// each other
- item_visitor_type<in_interior_strategy_type> item_visitor(in_interior_strategy);
+ item_visitor_type<Strategy> item_visitor(strategy);
geometry::partition
<