Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:51

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2015, 2016, 2017, 2018.
0008 // Modifications copyright (c) 2015-2018, Oracle and/or its affiliates.
0009 
0010 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0011 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0012 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0013 
0014 // Distributed under the Boost Software License, Version 1.0.
0015 // (See accompanying file LICENSE_1_0.txt or copy at
0016 // http://www.boost.org/LICENSE_1_0.txt)
0017 
0018 #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_POINT_HPP
0019 #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_POINT_HPP
0020 
0021 #include <cstddef>
0022 
0023 #include <boost/geometry/core/access.hpp>
0024 #include <boost/geometry/core/cs.hpp>
0025 #include <boost/geometry/core/coordinate_dimension.hpp>
0026 #include <boost/geometry/core/coordinate_system.hpp>
0027 #include <boost/geometry/core/tags.hpp>
0028 
0029 #include <boost/geometry/views/detail/indexed_point_view.hpp>
0030 
0031 #include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
0032 #include <boost/geometry/algorithms/detail/normalize.hpp>
0033 
0034 #include <boost/geometry/algorithms/detail/envelope/transform_units.hpp>
0035 
0036 #include <boost/geometry/strategy/cartesian/envelope_point.hpp>
0037 
0038 #include <boost/geometry/strategy/envelope.hpp>
0039 
0040 
0041 namespace boost { namespace geometry
0042 {
0043 
0044 namespace strategy { namespace envelope
0045 {
0046 
0047 struct spherical_point
0048 {
0049     template<typename Point, typename Box>
0050     static inline void apply(Point const& point, Box& mbr)
0051     {
0052         Point normalized_point;
0053         strategy::normalize::spherical_point::apply(point, normalized_point);
0054 
0055         typename point_type<Box>::type box_point;
0056 
0057         // transform units of input point to units of a box point
0058         geometry::detail::envelope::transform_units(normalized_point, box_point);
0059 
0060         geometry::set<min_corner, 0>(mbr, geometry::get<0>(box_point));
0061         geometry::set<min_corner, 1>(mbr, geometry::get<1>(box_point));
0062 
0063         geometry::set<max_corner, 0>(mbr, geometry::get<0>(box_point));
0064         geometry::set<max_corner, 1>(mbr, geometry::get<1>(box_point));
0065 
0066         typedef geometry::detail::envelope::envelope_one_point
0067             <
0068                 2, dimension<Point>::value
0069             > per_corner;
0070         per_corner::template apply<min_corner>(normalized_point, mbr);
0071         per_corner::template apply<max_corner>(normalized_point, mbr);
0072     }
0073 };
0074 
0075 
0076 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0077 
0078 namespace services
0079 {
0080 
0081 template <typename CalculationType>
0082 struct default_strategy<point_tag, spherical_equatorial_tag, CalculationType>
0083 {
0084     typedef strategy::envelope::spherical_point type;
0085 };
0086 
0087 template <typename CalculationType>
0088 struct default_strategy<point_tag, spherical_polar_tag, CalculationType>
0089 {
0090     typedef strategy::envelope::spherical_point type;
0091 };
0092 
0093 template <typename CalculationType>
0094 struct default_strategy<point_tag, geographic_tag, CalculationType>
0095 {
0096     typedef strategy::envelope::spherical_point type;
0097 };
0098 
0099 
0100 }
0101 
0102 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0103 
0104 
0105 }} // namespace strategy::envelope
0106 
0107 
0108 }} // namespace boost::geometry
0109 
0110 
0111 #endif // BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_POINT_HPP