]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | ||
92f5a8d4 | 3 | // Copyright (c) 2017-2018 Oracle and/or its affiliates. |
b32b8144 FG |
4 | // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle |
5 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle | |
6 | ||
7 | // Use, modification and distribution is subject to the Boost Software License, | |
8 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
9 | // http://www.boost.org/LICENSE_1_0.txt) | |
10 | ||
11 | #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP | |
12 | #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP | |
13 | ||
92f5a8d4 | 14 | #include <cstddef> |
b32b8144 | 15 | |
92f5a8d4 | 16 | #include <boost/geometry/core/coordinate_dimension.hpp> |
b32b8144 | 17 | #include <boost/geometry/core/tags.hpp> |
92f5a8d4 TL |
18 | |
19 | #include <boost/geometry/strategies/cartesian/envelope_point.hpp> | |
20 | #include <boost/geometry/strategies/cartesian/expand_point.hpp> | |
b32b8144 | 21 | #include <boost/geometry/strategies/envelope.hpp> |
b32b8144 | 22 | |
92f5a8d4 TL |
23 | namespace boost { namespace geometry { namespace strategy { namespace envelope |
24 | { | |
b32b8144 | 25 | |
92f5a8d4 TL |
26 | #ifndef DOXYGEN_NO_DETAIL |
27 | namespace detail | |
b32b8144 FG |
28 | { |
29 | ||
92f5a8d4 TL |
30 | template <std::size_t Dimension, std::size_t DimensionCount> |
31 | struct envelope_one_segment | |
b32b8144 | 32 | { |
92f5a8d4 TL |
33 | template<typename Point, typename Box> |
34 | static inline void apply(Point const& p1, | |
35 | Point const& p2, | |
36 | Box& mbr) | |
37 | { | |
38 | geometry::detail::envelope::envelope_one_point | |
39 | < | |
40 | Dimension, DimensionCount | |
41 | >::apply(p1, mbr); | |
42 | ||
43 | strategy::expand::detail::point_loop | |
44 | < | |
45 | Dimension, DimensionCount | |
46 | >::apply(mbr, p2); | |
47 | } | |
48 | }; | |
49 | ||
50 | } // namespace detail | |
51 | #endif // DOXYGEN_NO_DETAIL | |
52 | ||
b32b8144 FG |
53 | |
54 | template | |
55 | < | |
56 | typename CalculationType = void | |
57 | > | |
58 | class cartesian_segment | |
59 | { | |
92f5a8d4 TL |
60 | public: |
61 | template <typename Point, typename Box> | |
62 | static inline void apply(Point const& point1, Point const& point2, Box& box) | |
b32b8144 | 63 | { |
92f5a8d4 TL |
64 | strategy::envelope::detail::envelope_one_segment |
65 | < | |
66 | 0, | |
67 | dimension<Point>::value | |
68 | >::apply(point1, point2, box); | |
b32b8144 FG |
69 | } |
70 | ||
71 | }; | |
72 | ||
73 | #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS | |
74 | ||
75 | namespace services | |
76 | { | |
77 | ||
78 | template <typename CalculationType> | |
92f5a8d4 | 79 | struct default_strategy<segment_tag, cartesian_tag, CalculationType> |
b32b8144 FG |
80 | { |
81 | typedef strategy::envelope::cartesian_segment<CalculationType> type; | |
82 | }; | |
83 | ||
84 | } | |
85 | ||
86 | #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS | |
87 | ||
88 | ||
89 | }} // namespace strategy::envelope | |
90 | ||
91 | }} //namepsace boost::geometry | |
92 | ||
93 | #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP |