]> git.proxmox.com Git - ceph.git/blobdiff - 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
index 19e935bbb93d9c19e077611fe973498db2327013..fa861c206d66de30834ac46a722a9f417c2036c8 100644 (file)
 #ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
 #define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
 
-#include <boost/geometry/algorithms/not_implemented.hpp>
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
 
-namespace boost { namespace geometry
+#include <boost/config.hpp>
+#include <boost/mpl/if.hpp>
+
+namespace boost { namespace geometry { namespace detail
 {
 
-// Meta-function to access segment-ratio for a policy
+// Temporary meta-function to access segment-ratio for a policy
 template <typename Point, typename Policy>
-struct segment_ratio_type {}; // : not_implemented<> {};
-
-
-}} // namespace boost::geometry
+struct segment_ratio_type
+{
+    // Type in segment ratio is either the coordinate type, or for
+    // deprecated robust point types it is a long_long type
+    typedef typename boost::mpl::if_c
+    <
+        boost::is_same
+        <
+            typename rescale_policy_type<Policy>::type,
+            no_rescale_policy_tag
+        >::value,
+        typename geometry::coordinate_type<Point>::type,
+        boost::long_long_type
+    >::type coordinate_type;
+
+    // Define segment ratio based on the coordinate type
+    typedef geometry::segment_ratio<coordinate_type> type;
+};
+
+
+}}} // namespace boost::geometry::deatil
 
 
 #endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP