File indexing completed on 2025-01-18 09:36:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
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
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
0103
0104
0105 }}
0106
0107
0108 }}
0109
0110
0111 #endif