1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 
3 // Copyright (c) 2017 Oracle and/or its affiliates.
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 
14 
15 #include <boost/geometry/algorithms/detail/envelope/segment.hpp>
16 #include <boost/geometry/core/tags.hpp>
17 #include <boost/geometry/strategies/envelope.hpp>
18 #include <boost/geometry/util/select_calculation_type.hpp>
19 
20 
21 namespace boost { namespace geometry
22 {
23 
24 namespace strategy { namespace envelope
25 {
26 
27 template
28 <
29     typename CalculationType = void
30 >
31 class cartesian_segment
32 {
33 public :
34 
35     template <typename Point1, typename Point2, typename Box>
36     inline void
apply(Point1 const & point1,Point2 const & point2,Box & box) const37     apply(Point1 const& point1, Point2 const& point2, Box& box) const
38     {
39         geometry::detail::envelope::envelope_one_segment
40                 <
41                     0,
42                     dimension<Point1>::value
43                 >
44                 ::apply(point1,
45                         point2,
46                         box,
47                         strategy::envelope::cartesian_segment<CalculationType>());
48     }
49 
50 };
51 
52 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
53 
54 namespace services
55 {
56 
57 template <typename CalculationType>
58 struct default_strategy<cartesian_tag, CalculationType>
59 {
60     typedef strategy::envelope::cartesian_segment<CalculationType> type;
61 };
62 
63 }
64 
65 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
66 
67 
68 }} // namespace strategy::envelope
69 
70 }} //namepsace boost::geometry
71 
72 #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP
73