File indexing completed on 2025-09-15 08:36:33
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/geometry/core/access.hpp>
0020 #include <boost/geometry/core/tags.hpp>
0021 #include <boost/geometry/core/coordinate_dimension.hpp>
0022 #include <boost/geometry/core/point_type.hpp>
0023
0024 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
0025 #include <boost/geometry/algorithms/detail/disjoint/segment_box.hpp>
0026
0027
0028 #include <boost/geometry/strategies/cartesian/point_in_box.hpp>
0029 #include <boost/geometry/strategies/disjoint.hpp>
0030 #include <boost/geometry/strategies/normalize.hpp>
0031 #include <boost/geometry/strategies/spherical/azimuth.hpp>
0032 #include <boost/geometry/strategies/spherical/disjoint_box_box.hpp>
0033
0034 #include <boost/geometry/util/math.hpp>
0035 #include <boost/geometry/util/calculation_type.hpp>
0036
0037
0038 namespace boost { namespace geometry { namespace strategy { namespace disjoint
0039 {
0040
0041
0042
0043
0044
0045 struct segment_box_spherical
0046 {
0047 typedef covered_by::spherical_point_box disjoint_point_box_strategy_type;
0048
0049 static inline disjoint_point_box_strategy_type get_disjoint_point_box_strategy()
0050 {
0051 return disjoint_point_box_strategy_type();
0052 }
0053
0054 template <typename Segment, typename Box>
0055 static inline bool apply(Segment const& segment, Box const& box)
0056 {
0057 geometry::strategy::azimuth::spherical<coordinate_type_t<point_type_t<Segment>>> azimuth_strategy;
0058
0059 return geometry::detail::disjoint::disjoint_segment_box_sphere_or_spheroid
0060 <
0061 spherical_equatorial_tag
0062 >::apply(segment, box,
0063 azimuth_strategy,
0064 strategy::normalize::spherical_point(),
0065 strategy::covered_by::spherical_point_box(),
0066 strategy::disjoint::spherical_box_box());
0067 }
0068 };
0069
0070
0071 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0072
0073
0074 namespace services
0075 {
0076
0077 template <typename Linear, typename Box, typename LinearTag>
0078 struct default_strategy<Linear, Box, LinearTag, box_tag, 1, 2,
0079 spherical_equatorial_tag, spherical_equatorial_tag>
0080 {
0081 typedef segment_box_spherical type;
0082 };
0083
0084 template <typename Box, typename Linear, typename LinearTag>
0085 struct default_strategy<Box, Linear, box_tag, LinearTag, 2, 1,
0086 spherical_equatorial_tag, spherical_equatorial_tag>
0087 {
0088 typedef segment_box_spherical type;
0089 };
0090
0091 }
0092
0093
0094 #endif
0095
0096
0097 }}}}
0098
0099
0100 #endif
0101