// Boost.Geometry Index // // n-dimensional bounds // // Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland. // // 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_INDEX_DETAIL_ALGORITHMS_BOUNDS_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_BOUNDS_HPP #include namespace boost { namespace geometry { namespace index { namespace detail { namespace dispatch { template ::type, typename TagBounds = typename geometry::tag::type> struct bounds { static inline void apply(Geometry const& g, Bounds & b) { geometry::convert(g, b); } }; template struct bounds { static inline void apply(Geometry const& g, Bounds & b) { index::detail::bounded_view v(g); geometry::convert(v, b); } }; } // namespace dispatch template inline void bounds(Geometry const& g, Bounds & b) { concept::check_concepts_and_equal_dimensions(); dispatch::bounds::apply(g, b); } namespace dispatch { template ::type> struct return_ref_or_bounds { typedef Geometry const& result_type; static inline result_type apply(Geometry const& g) { return g; } }; template struct return_ref_or_bounds { typedef typename point_type::type point_type; typedef geometry::model::box bounds_type; typedef index::detail::bounded_view result_type; static inline result_type apply(Geometry const& g) { return result_type(g); } }; } // namespace dispatch template inline typename dispatch::return_ref_or_bounds::result_type return_ref_or_bounds(Geometry const& g) { return dispatch::return_ref_or_bounds::apply(g); } }}}} // namespace boost::geometry::index::detail #endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_BOUNDS_HPP