File indexing completed on 2025-01-18 09:36:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_BOX_HPP
0019 #define BOOST_GEOMETRY_STRATEGY_CARTESIAN_ENVELOPE_BOX_HPP
0020
0021 #include <cstddef>
0022
0023 #include <boost/geometry/core/access.hpp>
0024 #include <boost/geometry/core/coordinate_dimension.hpp>
0025 #include <boost/geometry/core/tags.hpp>
0026
0027 #include <boost/geometry/views/detail/indexed_point_view.hpp>
0028
0029 #include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
0030 #include <boost/geometry/algorithms/detail/normalize.hpp>
0031 #include <boost/geometry/algorithms/detail/envelope/transform_units.hpp>
0032
0033 #include <boost/geometry/algorithms/dispatch/envelope.hpp>
0034
0035 #include <boost/geometry/strategy/cartesian/expand_box.hpp>
0036
0037 #include <boost/geometry/strategy/envelope.hpp>
0038
0039
0040 namespace boost { namespace geometry
0041 {
0042
0043 #ifndef DOXYGEN_NO_DETAIL
0044 namespace detail { namespace envelope
0045 {
0046
0047
0048 template
0049 <
0050 std::size_t Index,
0051 std::size_t Dimension,
0052 std::size_t DimensionCount
0053 >
0054 struct envelope_indexed_box
0055 {
0056 template <typename BoxIn, typename BoxOut>
0057 static inline void apply(BoxIn const& box_in, BoxOut& mbr)
0058 {
0059 detail::indexed_point_view<BoxIn const, Index> box_in_corner(box_in);
0060 detail::indexed_point_view<BoxOut, Index> mbr_corner(mbr);
0061
0062 detail::conversion::point_to_point
0063 <
0064 detail::indexed_point_view<BoxIn const, Index>,
0065 detail::indexed_point_view<BoxOut, Index>,
0066 Dimension,
0067 DimensionCount
0068 >::apply(box_in_corner, mbr_corner);
0069 }
0070 };
0071
0072
0073 }}
0074 #endif
0075
0076
0077 namespace strategy { namespace envelope
0078 {
0079
0080
0081 struct cartesian_box
0082 {
0083 typedef cartesian_tag cs_tag;
0084
0085 template<typename BoxIn, typename BoxOut>
0086 static inline void apply(BoxIn const& box_in, BoxOut& mbr)
0087 {
0088 geometry::detail::envelope::envelope_indexed_box
0089 <
0090 min_corner, 0, dimension<BoxIn>::value
0091 >::apply(box_in, mbr);
0092
0093 geometry::detail::envelope::envelope_indexed_box
0094 <
0095 max_corner, 0, dimension<BoxIn>::value
0096 >::apply(box_in, mbr);
0097 }
0098 };
0099
0100
0101 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0102
0103 namespace services
0104 {
0105
0106 template <typename CalculationType>
0107 struct default_strategy<box_tag, cartesian_tag, CalculationType>
0108 {
0109 typedef strategy::envelope::cartesian_box type;
0110 };
0111
0112 }
0113
0114 #endif
0115
0116
0117 }}
0118
0119
0120 }}
0121
0122
0123 #endif