summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/overlay/get_relative_order.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:24:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:25:39 +0900
commit4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch)
treefd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/geometry/algorithms/detail/overlay/get_relative_order.hpp
parentb5c87084afaef42b2d058f68091be31988a6a874 (diff)
downloadboost-upstream/1.65.0.tar.gz
boost-upstream/1.65.0.tar.bz2
boost-upstream/1.65.0.zip
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/get_relative_order.hpp')
-rw-r--r--boost/geometry/algorithms/detail/overlay/get_relative_order.hpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/get_relative_order.hpp b/boost/geometry/algorithms/detail/overlay/get_relative_order.hpp
index ea9aa29f19..2eec6af665 100644
--- a/boost/geometry/algorithms/detail/overlay/get_relative_order.hpp
+++ b/boost/geometry/algorithms/detail/overlay/get_relative_order.hpp
@@ -2,6 +2,11 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+// 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
// http://www.boost.org/LICENSE_1_0.txt)
@@ -31,20 +36,15 @@ namespace detail { namespace overlay
but we still need to know which comes first.
Therefore, it is useful that using sides we are able to discover this.
*/
-template <typename Point1>
struct get_relative_order
{
- typedef typename strategy::side::services::default_strategy
- <
- typename cs_tag<Point1>::type
- >::type strategy;
-
- template <typename Point>
+ template <typename Point, typename SideStrategy>
static inline int value_via_product(Point const& ti, Point const& tj,
- Point const& ui, Point const& uj, int factor)
+ Point const& ui, Point const& uj, int factor,
+ SideStrategy const& strategy)
{
- int const side_ti_u = strategy::apply(ti, tj, ui);
- int const side_tj_u = strategy::apply(ti, tj, uj);
+ int const side_ti_u = strategy.apply(ti, tj, ui);
+ int const side_tj_u = strategy.apply(ti, tj, uj);
#ifdef BOOST_GEOMETRY_DEBUG_RELATIVE_ORDER
std::cout << (factor == 1 ? " r//s " : " s//r ")
@@ -57,13 +57,15 @@ struct get_relative_order
}
+ template <typename Point1, typename SideStrategy>
static inline int apply(
Point1 const& pi, Point1 const& pj,
Point1 const& ri, Point1 const& rj,
- Point1 const& si, Point1 const& sj)
+ Point1 const& si, Point1 const& sj,
+ SideStrategy const& strategy)
{
- int const side_ri_p = strategy::apply(pi, pj, ri);
- int const side_si_p = strategy::apply(pi, pj, si);
+ int const side_ri_p = strategy.apply(pi, pj, ri);
+ int const side_si_p = strategy.apply(pi, pj, si);
#ifdef BOOST_GEOMETRY_DEBUG_RELATIVE_ORDER
int const side_rj_p = strategy::apply(pi, pj, rj);
@@ -72,10 +74,10 @@ struct get_relative_order
std::cout << " s//p: " << side_si_p << " / " << side_sj_p;
#endif
- int value = value_via_product(si, sj, ri, rj, 1);
+ int value = value_via_product(si, sj, ri, rj, 1, strategy);
if (value == 0)
{
- value = value_via_product(ri, rj, si, sj, -1);
+ value = value_via_product(ri, rj, si, sj, -1, strategy);
}
int const order = side_ri_p * side_ri_p * side_si_p * value;