]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/policies/robustness/segment_ratio_type.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / policies / robustness / segment_ratio_type.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2013 Bruno Lalande, Paris, France.
5 // Copyright (c) 2013 Mateusz Loskot, London, UK.
6 // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
7
8 // This file was modified by Oracle on 2020.
9 // Modifications copyright (c) 2020 Oracle and/or its affiliates.
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11
12 // Use, modification and distribution is subject to the Boost Software License,
13 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
14 // http://www.boost.org/LICENSE_1_0.txt)
15
16 #ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
17 #define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
18
19 #include <type_traits>
20
21 #include <boost/config.hpp>
22
23 #include <boost/geometry/core/coordinate_type.hpp>
24 #include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
25
26 namespace boost { namespace geometry { namespace detail
27 {
28
29 // Temporary meta-function to access segment-ratio for a policy
30 template <typename Point, typename Policy>
31 struct segment_ratio_type
32 {
33 // Type in segment ratio is either the coordinate type, or for
34 // deprecated robust point types it is a long_long type
35 typedef std::conditional_t
36 <
37 std::is_same
38 <
39 typename rescale_policy_type<Policy>::type,
40 no_rescale_policy_tag
41 >::value,
42 typename geometry::coordinate_type<Point>::type,
43 boost::long_long_type
44 > coordinate_type;
45
46 // Define segment ratio based on the coordinate type
47 typedef geometry::segment_ratio<coordinate_type> type;
48 };
49
50
51 }}} // namespace boost::geometry::deatil
52
53
54 #endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP