File indexing completed on 2025-01-18 09:35:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_SEGMENT_HPP
0019 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_SEGMENT_HPP
0020
0021 #include <cstddef>
0022
0023 #include <boost/geometry/core/tags.hpp>
0024
0025 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
0026 #include <boost/geometry/algorithms/dispatch/envelope.hpp>
0027
0028
0029 #include <boost/geometry/strategies/detail.hpp>
0030
0031 namespace boost { namespace geometry
0032 {
0033
0034 #ifndef DOXYGEN_NO_DETAIL
0035 namespace detail { namespace envelope
0036 {
0037
0038
0039 template
0040 <
0041 typename Strategy,
0042 bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategy>::value
0043 >
0044 struct envelope_segment_call_strategy
0045 {
0046 template <typename Point, typename Segment, typename Box>
0047 static inline void apply(Point const& p1, Point const& p2,
0048 Segment const& segment, Box& mbr,
0049 Strategy const& strategy)
0050 {
0051 strategy.envelope(segment, mbr).apply(p1, p2, mbr);
0052 }
0053 };
0054
0055 template <typename Strategy>
0056 struct envelope_segment_call_strategy<Strategy, false>
0057 {
0058 template <typename Point, typename Segment, typename Box>
0059 static inline void apply(Point const& p1, Point const& p2,
0060 Segment const&, Box& mbr,
0061 Strategy const& strategy)
0062 {
0063 strategy.apply(p1, p2, mbr);
0064 }
0065 };
0066
0067 struct envelope_segment
0068 {
0069 template <typename Segment, typename Box, typename Strategy>
0070 static inline void apply(Segment const& segment, Box& mbr,
0071 Strategy const& strategy)
0072 {
0073 typename point_type<Segment>::type p[2];
0074 detail::assign_point_from_index<0>(segment, p[0]);
0075 detail::assign_point_from_index<1>(segment, p[1]);
0076
0077
0078 envelope_segment_call_strategy<Strategy>::apply(p[0], p[1], segment, mbr, strategy);
0079 }
0080 };
0081
0082 }}
0083 #endif
0084
0085
0086 #ifndef DOXYGEN_NO_DISPATCH
0087 namespace dispatch
0088 {
0089
0090
0091 template <typename Segment>
0092 struct envelope<Segment, segment_tag>
0093 {
0094 template <typename Box, typename Strategy>
0095 static inline void apply(Segment const& segment,
0096 Box& mbr,
0097 Strategy const& strategy)
0098 {
0099 detail::envelope::envelope_segment
0100
0101
0102 ::apply(segment, mbr, strategy);
0103 }
0104 };
0105
0106 }
0107 #endif
0108
0109 }}
0110
0111 #endif