File indexing completed on 2025-01-18 09:36:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISJOINT_SEGMENT_BOX_HPP
0013 #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISJOINT_SEGMENT_BOX_HPP
0014
0015
0016 #include <cstddef>
0017 #include <utility>
0018
0019 #include <boost/numeric/conversion/cast.hpp>
0020
0021 #include <boost/geometry/util/math.hpp>
0022 #include <boost/geometry/util/calculation_type.hpp>
0023
0024 #include <boost/geometry/core/access.hpp>
0025 #include <boost/geometry/core/tags.hpp>
0026 #include <boost/geometry/core/coordinate_dimension.hpp>
0027 #include <boost/geometry/core/point_type.hpp>
0028
0029 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
0030 #include <boost/geometry/algorithms/detail/disjoint/segment_box.hpp>
0031
0032
0033 #include <boost/geometry/strategies/cartesian/point_in_box.hpp>
0034 #include <boost/geometry/strategies/disjoint.hpp>
0035 #include <boost/geometry/strategies/normalize.hpp>
0036 #include <boost/geometry/strategies/spherical/azimuth.hpp>
0037 #include <boost/geometry/strategies/spherical/disjoint_box_box.hpp>
0038
0039
0040 namespace boost { namespace geometry { namespace strategy { namespace disjoint
0041 {
0042
0043
0044
0045
0046
0047 struct segment_box_spherical
0048 {
0049 typedef covered_by::spherical_point_box disjoint_point_box_strategy_type;
0050
0051 static inline disjoint_point_box_strategy_type get_disjoint_point_box_strategy()
0052 {
0053 return disjoint_point_box_strategy_type();
0054 }
0055
0056 template <typename Segment, typename Box>
0057 static inline bool apply(Segment const& segment, Box const& box)
0058 {
0059 typedef typename point_type<Segment>::type segment_point_type;
0060 typedef typename coordinate_type<segment_point_type>::type CT;
0061 geometry::strategy::azimuth::spherical<CT> azimuth_strategy;
0062
0063 return geometry::detail::disjoint::disjoint_segment_box_sphere_or_spheroid
0064 <
0065 spherical_equatorial_tag
0066 >::apply(segment, box,
0067 azimuth_strategy,
0068 strategy::normalize::spherical_point(),
0069 strategy::covered_by::spherical_point_box(),
0070 strategy::disjoint::spherical_box_box());
0071 }
0072 };
0073
0074
0075 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0076
0077
0078 namespace services
0079 {
0080
0081 template <typename Linear, typename Box, typename LinearTag>
0082 struct default_strategy<Linear, Box, LinearTag, box_tag, 1, 2,
0083 spherical_equatorial_tag, spherical_equatorial_tag>
0084 {
0085 typedef segment_box_spherical type;
0086 };
0087
0088 template <typename Box, typename Linear, typename LinearTag>
0089 struct default_strategy<Box, Linear, box_tag, LinearTag, 2, 1,
0090 spherical_equatorial_tag, spherical_equatorial_tag>
0091 {
0092 typedef segment_box_spherical type;
0093 };
0094
0095 }
0096
0097
0098 #endif
0099
0100
0101 }}}}
0102
0103
0104 #endif
0105