File indexing completed on 2025-01-18 09:36:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_SEGMENT_HPP
0012 #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_SEGMENT_HPP
0013
0014 #include <cstddef>
0015
0016 #include <boost/geometry/core/coordinate_dimension.hpp>
0017 #include <boost/geometry/core/tags.hpp>
0018
0019 #include <boost/geometry/strategy/cartesian/envelope_point.hpp>
0020 #include <boost/geometry/strategy/cartesian/expand_point.hpp>
0021 #include <boost/geometry/strategy/envelope.hpp>
0022
0023 namespace boost { namespace geometry { namespace strategy { namespace envelope
0024 {
0025
0026 #ifndef DOXYGEN_NO_DETAIL
0027 namespace detail
0028 {
0029
0030 template <std::size_t Dimension, std::size_t DimensionCount>
0031 struct envelope_one_segment
0032 {
0033 template<typename Point, typename Box>
0034 static inline void apply(Point const& p1,
0035 Point const& p2,
0036 Box& mbr)
0037 {
0038 geometry::detail::envelope::envelope_one_point
0039 <
0040 Dimension, DimensionCount
0041 >::apply(p1, mbr);
0042
0043 strategy::expand::detail::point_loop
0044 <
0045 Dimension, DimensionCount
0046 >::apply(mbr, p2);
0047 }
0048 };
0049
0050 }
0051 #endif
0052
0053
0054 template
0055 <
0056 typename CalculationType = void
0057 >
0058 class cartesian_segment
0059 {
0060 public:
0061 template <typename Point, typename Box>
0062 static inline void apply(Point const& point1, Point const& point2, Box& box)
0063 {
0064 strategy::envelope::detail::envelope_one_segment
0065 <
0066 0,
0067 dimension<Point>::value
0068 >::apply(point1, point2, box);
0069 }
0070
0071 };
0072
0073 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0074
0075 namespace services
0076 {
0077
0078 template <typename CalculationType>
0079 struct default_strategy<segment_tag, cartesian_tag, CalculationType>
0080 {
0081 typedef strategy::envelope::cartesian_segment<CalculationType> type;
0082 };
0083
0084 }
0085
0086 #endif
0087
0088
0089 }}
0090
0091 }}
0092
0093 #endif