Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:36:33

0001 // Boost.Geometry
0002 
0003 // Copyright (c) 2017-2019 Oracle and/or its affiliates.
0004 
0005 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0006 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0007 
0008 // Use, modification and distribution is subject to the Boost Software License,
0009 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0010 // http://www.boost.org/LICENSE_1_0.txt)
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 // TODO: spherical_point_box currently defined in the same file as cartesian
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 // NOTE: This may be temporary place for this or corresponding strategy
0042 // It seems to be more appropriate to implement the opposite of it
0043 // e.g. intersection::segment_box because in disjoint() algorithm
0044 // other strategies that are used are intersection and covered_by strategies.
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 } // namespace services
0092 
0093 
0094 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0095 
0096 
0097 }}}} // namespace boost::geometry::strategy::disjoint
0098 
0099 
0100 #endif // BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISJOINT_SEGMENT_BOX_HPP
0101