1 // Boost.Geometry (aka GGL, Generic Geometry Library)
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.
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)
12 #ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
13 #define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
15 #include <boost/geometry/core/coordinate_type.hpp>
16 #include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
18 #include <boost/config.hpp>
19 #include <boost/mpl/if.hpp>
21 namespace boost { namespace geometry { namespace detail
24 // Temporary meta-function to access segment-ratio for a policy
25 template <typename Point, typename Policy>
26 struct segment_ratio_type
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
34 typename rescale_policy_type<Policy>::type,
37 typename geometry::coordinate_type<Point>::type,
39 >::type coordinate_type;
41 // Define segment ratio based on the coordinate type
42 typedef geometry::segment_ratio<coordinate_type> type;
46 }}} // namespace boost::geometry::deatil
49 #endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP