File indexing completed on 2025-01-18 09:36:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_RANGE_HPP
0011 #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_RANGE_HPP
0012
0013 #include <boost/range/begin.hpp>
0014 #include <boost/range/end.hpp>
0015
0016 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
0017 #include <boost/geometry/strategy/cartesian/envelope_point.hpp>
0018 #include <boost/geometry/strategy/cartesian/expand_point.hpp>
0019
0020 namespace boost { namespace geometry
0021 {
0022
0023 namespace strategy { namespace envelope
0024 {
0025
0026 class cartesian_range
0027 {
0028 public:
0029 template <typename Range, typename Box>
0030 static inline void apply(Range const& range, Box& mbr)
0031 {
0032 auto it = boost::begin(range);
0033 auto const end = boost::end(range);
0034 if (it == end)
0035 {
0036
0037 geometry::detail::envelope::initialize<Box>::apply(mbr);
0038 return;
0039 }
0040
0041
0042 envelope::cartesian_point::apply(*it, mbr);
0043
0044
0045 for (++it; it != end; ++it)
0046 {
0047 expand::cartesian_point::apply(mbr, *it);
0048 }
0049 }
0050 };
0051
0052 }}
0053
0054 }}
0055
0056 #endif