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_MULTIPOINT_HPP
0012 #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_MULTIPOINT_HPP
0013
0014 #include <boost/range/begin.hpp>
0015 #include <boost/range/end.hpp>
0016
0017 #include <boost/geometry/core/tags.hpp>
0018
0019 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
0020
0021 #include <boost/geometry/strategy/cartesian/envelope.hpp>
0022 #include <boost/geometry/strategy/cartesian/envelope_point.hpp>
0023 #include <boost/geometry/strategy/cartesian/expand_point.hpp>
0024
0025
0026 namespace boost { namespace geometry
0027 {
0028
0029 namespace strategy { namespace envelope
0030 {
0031
0032 class cartesian_multipoint
0033 {
0034 public:
0035 template <typename MultiPoint, typename Box>
0036 static inline void apply(MultiPoint const& multipoint, Box& mbr)
0037 {
0038 apply(boost::begin(multipoint), boost::end(multipoint), mbr);
0039 }
0040
0041 private:
0042 template <typename Iterator, typename Box>
0043 static inline void apply(Iterator it,
0044 Iterator last,
0045 Box& mbr)
0046 {
0047 geometry::detail::envelope::initialize<Box, 0, dimension<Box>::value>::apply(mbr);
0048
0049 if (it != last)
0050 {
0051 strategy::envelope::cartesian_point::apply(*it, mbr);
0052
0053 for (++it; it != last; ++it)
0054 {
0055 strategy::expand::cartesian_point::apply(mbr, *it);
0056 }
0057 }
0058 }
0059 };
0060
0061
0062 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0063
0064 namespace services
0065 {
0066
0067 template <typename CalculationType>
0068 struct default_strategy<multi_point_tag, cartesian_tag, CalculationType>
0069 {
0070 typedef strategy::envelope::cartesian_multipoint type;
0071 };
0072
0073
0074 }
0075
0076 #endif
0077
0078
0079 }}
0080
0081 }}
0082
0083 #endif