Chris@102
|
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
|
Chris@102
|
2
|
Chris@102
|
3 // Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
Chris@102
|
4 // Copyright (c) 2013 Bruno Lalande, Paris, France.
|
Chris@102
|
5 // Copyright (c) 2013 Mateusz Loskot, London, UK.
|
Chris@102
|
6 // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
Chris@102
|
7
|
Chris@102
|
8 // Use, modification and distribution is subject to the Boost Software License,
|
Chris@102
|
9 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@102
|
10 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@102
|
11
|
Chris@102
|
12 #ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
|
Chris@102
|
13 #define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
|
Chris@102
|
14
|
Chris@102
|
15 #include <stddef.h>
|
Chris@102
|
16
|
Chris@102
|
17 #include <boost/geometry/core/coordinate_type.hpp>
|
Chris@102
|
18 #include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
Chris@102
|
19 #include <boost/geometry/policies/robustness/segment_ratio.hpp>
|
Chris@102
|
20 #include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
Chris@102
|
21
|
Chris@102
|
22 namespace boost { namespace geometry
|
Chris@102
|
23 {
|
Chris@102
|
24
|
Chris@102
|
25 #ifndef DOXYGEN_NO_DETAIL
|
Chris@102
|
26 namespace detail
|
Chris@102
|
27 {
|
Chris@102
|
28
|
Chris@102
|
29 // Probably this will be moved out of namespace detail
|
Chris@102
|
30 struct no_rescale_policy
|
Chris@102
|
31 {
|
Chris@102
|
32 static bool const enabled = false;
|
Chris@102
|
33
|
Chris@102
|
34 // We don't rescale but return the reference of the input
|
Chris@102
|
35 template <std::size_t Dimension, typename Value>
|
Chris@102
|
36 inline Value const& apply(Value const& value) const
|
Chris@102
|
37 {
|
Chris@102
|
38 return value;
|
Chris@102
|
39 }
|
Chris@102
|
40 };
|
Chris@102
|
41
|
Chris@102
|
42 } // namespace detail
|
Chris@102
|
43 #endif
|
Chris@102
|
44
|
Chris@102
|
45
|
Chris@102
|
46 // Implement meta-functions for this policy
|
Chris@102
|
47 template <typename Point>
|
Chris@102
|
48 struct robust_point_type<Point, detail::no_rescale_policy>
|
Chris@102
|
49 {
|
Chris@102
|
50 // The point itself
|
Chris@102
|
51 typedef Point type;
|
Chris@102
|
52 };
|
Chris@102
|
53
|
Chris@102
|
54 template <typename Point>
|
Chris@102
|
55 struct segment_ratio_type<Point, detail::no_rescale_policy>
|
Chris@102
|
56 {
|
Chris@102
|
57 // Define a segment_ratio defined on coordinate type, e.g.
|
Chris@102
|
58 // int/int or float/float
|
Chris@102
|
59 typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
Chris@102
|
60 typedef segment_ratio<coordinate_type> type;
|
Chris@102
|
61 };
|
Chris@102
|
62
|
Chris@102
|
63
|
Chris@102
|
64 }} // namespace boost::geometry
|
Chris@102
|
65
|
Chris@102
|
66 #endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
|