1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
6 // Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
8 // This file was modified by Oracle on 2015, 2016, 2017.
9 // Modifications copyright (c) 2015-2017, Oracle and/or its affiliates.
11 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
12 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
13 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
15 // Distributed under the Boost Software License, Version 1.0.
16 // (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
19 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_BOX_HPP
20 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_BOX_HPP
25 #include <boost/mpl/assert.hpp>
26 #include <boost/type_traits/is_same.hpp>
28 #include <boost/geometry/core/coordinate_dimension.hpp>
29 #include <boost/geometry/core/tags.hpp>
31 #include <boost/geometry/algorithms/detail/envelope/box.hpp>
32 #include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
34 #include <boost/geometry/algorithms/detail/expand/indexed.hpp>
36 #include <boost/geometry/algorithms/dispatch/expand.hpp>
39 namespace boost { namespace geometry
42 #ifndef DOXYGEN_NO_DETAIL
43 namespace detail { namespace expand
47 struct box_on_spheroid
49 template <typename BoxOut, typename BoxIn, typename Strategy>
50 static inline void apply(BoxOut& box_out,
52 Strategy const& strategy)
54 // normalize both boxes and convert box-in to be of type of box-out
56 detail::envelope::envelope_box_on_spheroid::apply(box_in, mbrs[0], strategy);
57 detail::envelope::envelope_box_on_spheroid::apply(box_out, mbrs[1], strategy);
59 // compute the envelope of the two boxes
60 detail::envelope::envelope_range_of_boxes::apply(mbrs, box_out, strategy);
65 }} // namespace detail::expand
66 #endif // DOXYGEN_NO_DETAIL
68 #ifndef DOXYGEN_NO_DISPATCH
73 // Box + box -> new box containing two input boxes
76 typename BoxOut, typename BoxIn,
77 typename CSTagOut, typename CSTag
86 BOOST_MPL_ASSERT_MSG((false),
87 NOT_IMPLEMENTED_FOR_THESE_COORDINATE_SYSTEMS,
88 (types<CSTagOut, CSTag>()));
91 template <typename BoxOut, typename BoxIn>
96 cartesian_tag, cartesian_tag
97 > : detail::expand::expand_indexed
99 0, dimension<BoxIn>::value
103 template <typename BoxOut, typename BoxIn>
108 spherical_equatorial_tag, spherical_equatorial_tag
109 > : detail::expand::box_on_spheroid
112 template <typename BoxOut, typename BoxIn>
117 spherical_polar_tag, spherical_polar_tag
118 > : detail::expand::box_on_spheroid
121 template <typename BoxOut, typename BoxIn>
126 geographic_tag, geographic_tag
127 > : detail::expand::box_on_spheroid
131 } // namespace dispatch
132 #endif // DOXYGEN_NO_DISPATCH
134 }} // namespace boost::geometry
136 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_INDEXED_HPP