diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/has_self_intersections.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/has_self_intersections.hpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/boost/geometry/algorithms/detail/has_self_intersections.hpp b/boost/geometry/algorithms/detail/has_self_intersections.hpp index 24746ac627..9a388a4d80 100644 --- a/boost/geometry/algorithms/detail/has_self_intersections.hpp +++ b/boost/geometry/algorithms/detail/has_self_intersections.hpp @@ -1,6 +1,11 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2017. +// Modifications copyright (c) 2017 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, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -12,6 +17,8 @@ #include <deque> #include <boost/range.hpp> +#include <boost/throw_exception.hpp> + #include <boost/geometry/core/point_type.hpp> #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp> #include <boost/geometry/algorithms/detail/overlay/get_turns.hpp> @@ -59,8 +66,9 @@ namespace detail { namespace overlay { -template <typename Geometry, typename RobustPolicy> +template <typename Geometry, typename Strategy, typename RobustPolicy> inline bool has_self_intersections(Geometry const& geometry, + Strategy const& strategy, RobustPolicy const& robust_policy, bool throw_on_self_intersection = true) { @@ -73,7 +81,7 @@ inline bool has_self_intersections(Geometry const& geometry, std::deque<turn_info> turns; detail::disjoint::disjoint_interrupt_policy policy; - geometry::self_turns<detail::overlay::assign_null_policy>(geometry, robust_policy, turns, policy); + geometry::self_turns<detail::overlay::assign_null_policy>(geometry, strategy, robust_policy, turns, policy); #ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS bool first = true; @@ -113,7 +121,7 @@ inline bool has_self_intersections(Geometry const& geometry, #if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) if (throw_on_self_intersection) { - throw overlay_invalid_input_exception(); + BOOST_THROW_EXCEPTION(overlay_invalid_input_exception()); } #endif return true; @@ -132,11 +140,16 @@ inline bool has_self_intersections(Geometry const& geometry, typedef typename geometry::rescale_policy_type<point_type>::type rescale_policy_type; + typename strategy::intersection::services::default_strategy + < + typename cs_tag<Geometry>::type + >::type strategy; + rescale_policy_type robust_policy = geometry::get_rescale_policy<rescale_policy_type>(geometry); - return has_self_intersections(geometry, robust_policy, - throw_on_self_intersection); + return has_self_intersections(geometry, strategy, robust_policy, + throw_on_self_intersection); } |