From f7040ca4378f5f225e2b52b06edef675699d0e11 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 14 Dec 2012 22:12:12 +0000 Subject: [PATCH] [geometry] added combinations point/ring, point/polygon, point/multi_polygon for disjoint and intersects [SVN r81955] --- .../geometry/algorithms/detail/disjoint.hpp | 14 +++++++ .../boost/geometry/algorithms/disjoint.hpp | 10 +++++ .../geometry/multi/algorithms/disjoint.hpp | 41 +++++++++++++++++++ include/boost/geometry/multi/multi.hpp | 1 + 4 files changed, 66 insertions(+) create mode 100644 include/boost/geometry/multi/algorithms/disjoint.hpp diff --git a/include/boost/geometry/algorithms/detail/disjoint.hpp b/include/boost/geometry/algorithms/detail/disjoint.hpp index 2ced5b1ce..e944e5169 100644 --- a/include/boost/geometry/algorithms/detail/disjoint.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint.hpp @@ -26,6 +26,7 @@ #include #include +#include #include @@ -165,6 +166,19 @@ struct box_box }; +template +< + typename Geometry1, typename Geometry2 +> +struct reverse_covered_by +{ + static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2) + { + return ! geometry::covered_by(geometry1, geometry2); + } +}; + + /*! \brief Internal utility function to detect of boxes are disjoint diff --git a/include/boost/geometry/algorithms/disjoint.hpp b/include/boost/geometry/algorithms/disjoint.hpp index 1bc923d43..b2de6e01d 100644 --- a/include/boost/geometry/algorithms/disjoint.hpp +++ b/include/boost/geometry/algorithms/disjoint.hpp @@ -234,6 +234,16 @@ struct disjoint : detail::disjoint::point_box {}; +template +struct disjoint + : detail::disjoint::reverse_covered_by +{}; + +template +struct disjoint + : detail::disjoint::reverse_covered_by +{}; + template struct disjoint : detail::disjoint::disjoint_linear diff --git a/include/boost/geometry/multi/algorithms/disjoint.hpp b/include/boost/geometry/multi/algorithms/disjoint.hpp new file mode 100644 index 000000000..7d1bed794 --- /dev/null +++ b/include/boost/geometry/multi/algorithms/disjoint.hpp @@ -0,0 +1,41 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012 Bruno Lalande, Paris, France. +// Copyright (c) 2012 Mateusz Loskot, London, UK. + +// 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) + +#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DISJOINT_HPP +#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DISJOINT_HPP + + +#include +#include + + +namespace boost { namespace geometry +{ + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + +template +struct disjoint + : detail::disjoint::reverse_covered_by +{}; + +} // namespace dispatch + + +#endif // DOXYGEN_NO_DISPATCH + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DISJOINT_HPP diff --git a/include/boost/geometry/multi/multi.hpp b/include/boost/geometry/multi/multi.hpp index db33a9dd0..df10392cb 100644 --- a/include/boost/geometry/multi/multi.hpp +++ b/include/boost/geometry/multi/multi.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include