1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_RANGE_HPP
- #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_RANGE_HPP
- #include <boost/range/begin.hpp>
- #include <boost/range/end.hpp>
- #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
- #include <boost/geometry/strategy/cartesian/envelope_point.hpp>
- #include <boost/geometry/strategy/cartesian/expand_point.hpp>
- namespace boost { namespace geometry
- {
- namespace strategy { namespace envelope
- {
- class cartesian_range
- {
- public:
- template <typename Range, typename Box>
- static inline void apply(Range const& range, Box& mbr)
- {
- auto it = boost::begin(range);
- auto const end = boost::end(range);
- if (it == end)
- {
-
- geometry::detail::envelope::initialize<Box>::apply(mbr);
- return;
- }
-
- envelope::cartesian_point::apply(*it, mbr);
-
- for (++it; it != end; ++it)
- {
- expand::cartesian_point::apply(mbr, *it);
- }
- }
- };
- }}
- }}
- #endif
|