]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/geometry/policies/robustness/segment_ratio_type.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / geometry / policies / robustness / segment_ratio_type.hpp
CommitLineData
7c673cae
FG
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// Use, modification and distribution is subject to the Boost Software License,
9// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10// http://www.boost.org/LICENSE_1_0.txt)
11
12#ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
13#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
14
92f5a8d4
TL
15#include <boost/geometry/core/coordinate_type.hpp>
16#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
7c673cae 17
92f5a8d4
TL
18#include <boost/config.hpp>
19#include <boost/mpl/if.hpp>
20
21namespace boost { namespace geometry { namespace detail
7c673cae
FG
22{
23
92f5a8d4 24// Temporary meta-function to access segment-ratio for a policy
7c673cae 25template <typename Point, typename Policy>
92f5a8d4
TL
26struct segment_ratio_type
27{
28 // Type in segment ratio is either the coordinate type, or for
29 // deprecated robust point types it is a long_long type
30 typedef typename boost::mpl::if_c
31 <
32 boost::is_same
33 <
34 typename rescale_policy_type<Policy>::type,
35 no_rescale_policy_tag
36 >::value,
37 typename geometry::coordinate_type<Point>::type,
38 boost::long_long_type
39 >::type coordinate_type;
40
41 // Define segment ratio based on the coordinate type
42 typedef geometry::segment_ratio<coordinate_type> type;
43};
44
45
46}}} // namespace boost::geometry::deatil
7c673cae
FG
47
48
49#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP