// Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
-// This file was modified by Oracle on 2016.
-// Modifications copyright (c) 2016 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2016, 2018.
+// Modifications copyright (c) 2016-2018 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
#include <boost/core/ignore_unused.hpp>
+#include <boost/geometry/algorithms/detail/buffer/buffer_policies.hpp>
#include <boost/geometry/algorithms/expand.hpp>
#include <boost/geometry/strategies/agnostic/point_in_poly_winding.hpp>
#include <boost/geometry/strategies/buffer.hpp>
}
};
+template <typename DisjointBoxBoxStrategy>
struct original_ovelaps_box
{
template <typename Box, typename Original>
static inline bool apply(Box const& box, Original const& original)
{
- return ! detail::disjoint::disjoint_box_box(box, original.m_box);
+ return ! detail::disjoint::disjoint_box_box(box, original.m_box,
+ DisjointBoxBoxStrategy());
}
};
}
};
+template <typename DisjointPointBoxStrategy>
struct turn_in_original_ovelaps_box
{
template <typename Box, typename Turn>
}
return ! geometry::detail::disjoint::disjoint_point_box(
- turn.robust_point, box);
+ turn.robust_point, box, DisjointPointBoxStrategy());
}
};
}
-template <typename Point, typename Original>
-inline int point_in_original(Point const& point, Original const& original)
+template <typename Point, typename Original, typename PointInGeometryStrategy>
+inline int point_in_original(Point const& point, Original const& original,
+ PointInGeometryStrategy const& strategy)
{
- // The winding strategy is scanning in x direction
- // therefore it's critical to pass direction calculated
- // for x dimension below.
- typedef strategy::within::winding<Point> strategy_type;
-
- typename strategy_type::state_type state;
- strategy_type strategy;
+ typename PointInGeometryStrategy::state_type state;
if (boost::size(original.m_sections) == 0
|| boost::size(original.m_ring) - boost::size(original.m_sections) < 16)
}
-template <typename Turns>
+template <typename Turns, typename PointInGeometryStrategy>
class turn_in_original_visitor
{
public:
- turn_in_original_visitor(Turns& turns)
+ turn_in_original_visitor(Turns& turns, PointInGeometryStrategy const& strategy)
: m_mutable_turns(turns)
+ , m_point_in_geometry_strategy(strategy)
{}
template <typename Turn, typename Original>
inline bool apply(Turn const& turn, Original const& original, bool first = true)
{
- boost::ignore_unused_variable_warning(first);
+ boost::ignore_unused(first);
if (turn.location != location_ok || turn.within_original)
{
return true;
}
- int const code = point_in_original(turn.robust_point, original);
+ int const code = point_in_original(turn.robust_point, original, m_point_in_geometry_strategy);
if (code == -1)
{
private :
Turns& m_mutable_turns;
+ PointInGeometryStrategy const& m_point_in_geometry_strategy;
};