File indexing completed on 2025-01-18 09:35:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef BOOST_GEOMETRY_ALGORITHMS_DISPATCH_DISTANCE_HPP
0022 #define BOOST_GEOMETRY_ALGORITHMS_DISPATCH_DISTANCE_HPP
0023
0024
0025 #include <boost/geometry/algorithms/not_implemented.hpp>
0026
0027 #include <boost/geometry/core/reverse_dispatch.hpp>
0028 #include <boost/geometry/core/tag.hpp>
0029 #include <boost/geometry/core/tag_cast.hpp>
0030 #include <boost/geometry/core/tags.hpp>
0031
0032 #include <boost/geometry/strategies/detail.hpp>
0033 #include <boost/geometry/strategies/distance.hpp>
0034 #include <boost/geometry/strategies/distance/services.hpp>
0035
0036
0037 namespace boost { namespace geometry
0038 {
0039
0040
0041 #ifndef DOXYGEN_NO_DISPATCH
0042 namespace dispatch
0043 {
0044
0045
0046 template
0047 <
0048 typename Geometry1, typename Geometry2, typename Strategies,
0049 bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategies>::value,
0050 bool Reverse = reverse_dispatch<Geometry1, Geometry2>::value
0051 >
0052 struct distance_strategy_type
0053 {
0054 typedef decltype(std::declval<Strategies>().distance(std::declval<Geometry1>(), std::declval<Geometry2>())) type;
0055 };
0056
0057
0058
0059 template <typename Geometry1, typename Geometry2, typename Strategy, bool Reverse>
0060 struct distance_strategy_type<Geometry1, Geometry2, Strategy, false, Reverse>
0061 {
0062 typedef Strategy type;
0063 };
0064
0065 template <typename Geometry1, typename Geometry2, typename Strategies>
0066 struct distance_strategy_type<Geometry1, Geometry2, Strategies, true, true>
0067 : distance_strategy_type<Geometry2, Geometry1, Strategies, true, false>
0068 {};
0069
0070
0071 template
0072 <
0073 typename Geometry1, typename Geometry2, typename Strategies,
0074 bool IsDynamicOrGC = util::is_dynamic_geometry<Geometry1>::value
0075 || util::is_dynamic_geometry<Geometry2>::value
0076 || util::is_geometry_collection<Geometry1>::value
0077 || util::is_geometry_collection<Geometry2>::value
0078 >
0079 struct distance_strategy_tag
0080 {
0081 using type = void;
0082 };
0083
0084 template <typename Geometry1, typename Geometry2, typename Strategies>
0085 struct distance_strategy_tag<Geometry1, Geometry2, Strategies, false>
0086 {
0087 using type = typename strategy::distance::services::tag
0088 <
0089 typename distance_strategy_type<Geometry1, Geometry2, Strategies>::type
0090 >::type;
0091 };
0092
0093
0094 template
0095 <
0096 typename Geometry1, typename Geometry2,
0097 typename Strategy = typename strategies::distance::services::default_strategy
0098 <
0099 Geometry1, Geometry2
0100 >::type,
0101 typename Tag1 = typename tag_cast
0102 <
0103 typename tag<Geometry1>::type,
0104 segment_tag,
0105 box_tag,
0106 linear_tag,
0107 areal_tag
0108 >::type,
0109 typename Tag2 = typename tag_cast
0110 <
0111 typename tag<Geometry2>::type,
0112 segment_tag,
0113 box_tag,
0114 linear_tag,
0115 areal_tag
0116 >::type,
0117 typename StrategyTag = typename distance_strategy_tag
0118 <
0119 Geometry1, Geometry2, Strategy
0120 >::type,
0121 bool Reverse = reverse_dispatch<Geometry1, Geometry2>::value
0122 >
0123 struct distance : not_implemented<Tag1, Tag2>
0124 {};
0125
0126
0127
0128 }
0129 #endif
0130
0131
0132 }}
0133
0134
0135 #endif