From b39c46575cd08a4446630b08cdafa529b2bf32f4 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Wed, 21 May 2014 15:45:35 +0300 Subject: [PATCH] [disjoint] add dispatch specialization for point-point and point-box; move equals::point_point code to proper place; --- .../algorithms/detail/disjoint/box_box.hpp | 33 +++++++++++++-- .../detail/disjoint/point_point.hpp | 42 +++++++++++-------- 2 files changed, 54 insertions(+), 21 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/disjoint/box_box.hpp b/include/boost/geometry/algorithms/detail/disjoint/box_box.hpp index 24f9aa24e..931a52b8e 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/box_box.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/box_box.hpp @@ -1,9 +1,15 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland +// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland + +// This file was modified by Oracle on 2013-2014. +// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -15,7 +21,10 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_BOX_BOX_HPP +#include + #include +#include namespace boost { namespace geometry @@ -81,6 +90,22 @@ inline bool disjoint_box_box(Box1 const& box1, Box2 const& box2) }} // namespace detail::disjoint #endif // DOXYGEN_NO_DETAIL + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + + +template +struct disjoint + : detail::disjoint::box_box +{}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + }} // namespace boost::geometry diff --git a/include/boost/geometry/algorithms/detail/disjoint/point_point.hpp b/include/boost/geometry/algorithms/detail/disjoint/point_point.hpp index e762e1fdd..b1d32bf95 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/point_point.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/point_point.hpp @@ -1,9 +1,15 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland +// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland + +// This file was modified by Oracle on 2013-2014. +// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -19,9 +25,13 @@ #include #include +#include #include +#include + + namespace boost { namespace geometry { @@ -81,23 +91,21 @@ inline bool disjoint_point_point(Point1 const& point1, Point2 const& point2) #endif // DOXYGEN_NO_DETAIL -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace equals + + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch { -/*! - \brief Internal utility function to detect of points are disjoint - \note To avoid circular references - */ -template -inline bool equals_point_point(Point1 const& point1, Point2 const& point2) -{ - return ! detail::disjoint::disjoint_point_point(point1, point2); -} + +template +struct disjoint + : detail::disjoint::point_point +{}; -}} // namespace detail::equals -#endif // DOXYGEN_NO_DETAIL +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH }} // namespace boost::geometry