From 7c0449711eef814ee1d0bbd4e5b7a4fbc67def67 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 26 Mar 2019 17:41:10 +0100 Subject: [PATCH] [strategy] Add disjoint Seg/Box strategy getter to intersection strategies. --- .../geometry/strategies/cartesian/intersection.hpp | 12 ++++++++++-- .../geometry/strategies/geographic/intersection.hpp | 11 +++++++++++ .../geometry/strategies/spherical/intersection.hpp | 10 +++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/strategies/cartesian/intersection.hpp b/include/boost/geometry/strategies/cartesian/intersection.hpp index fea98af1b..01d1c9433 100644 --- a/include/boost/geometry/strategies/cartesian/intersection.hpp +++ b/include/boost/geometry/strategies/cartesian/intersection.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014, 2016, 2017, 2018. -// Modifications copyright (c) 2014-2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2016, 2017, 2018, 2019. +// Modifications copyright (c) 2014-2019, 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 @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -171,6 +172,13 @@ struct cartesian_segments return disjoint_box_box_strategy_type(); } + typedef disjoint::segment_box disjoint_segment_box_strategy_type; + + static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() + { + return disjoint_segment_box_strategy_type(); + } + typedef covered_by::cartesian_point_box disjoint_point_box_strategy_type; typedef expand::cartesian_box expand_box_strategy_type; diff --git a/include/boost/geometry/strategies/geographic/intersection.hpp b/include/boost/geometry/strategies/geographic/intersection.hpp index 6f317bb31..37f79e589 100644 --- a/include/boost/geometry/strategies/geographic/intersection.hpp +++ b/include/boost/geometry/strategies/geographic/intersection.hpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -181,6 +182,16 @@ struct geographic_segments return disjoint_box_box_strategy_type(); } + typedef disjoint::segment_box_geographic + < + FormulaPolicy, Spheroid, CalculationType + > disjoint_segment_box_strategy_type; + + inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() const + { + return disjoint_segment_box_strategy_type(m_spheroid); + } + typedef covered_by::spherical_point_box disjoint_point_box_strategy_type; typedef expand::spherical_box expand_box_strategy_type; diff --git a/include/boost/geometry/strategies/spherical/intersection.hpp b/include/boost/geometry/strategies/spherical/intersection.hpp index 9142009fe..4cf4fca11 100644 --- a/include/boost/geometry/strategies/spherical/intersection.hpp +++ b/include/boost/geometry/strategies/spherical/intersection.hpp @@ -2,7 +2,7 @@ // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2016-2018, Oracle and/or its affiliates. +// Copyright (c) 2016-2019, 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, @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -189,6 +190,13 @@ struct ecef_segments return disjoint_box_box_strategy_type(); } + typedef disjoint::segment_box_spherical disjoint_segment_box_strategy_type; + + static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy() + { + return disjoint_segment_box_strategy_type(); + } + typedef covered_by::spherical_point_box disjoint_point_box_strategy_type; typedef expand::spherical_box expand_box_strategy_type;