no_rescale_policy.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2013 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2013 Mateusz Loskot, London, UK.
  5. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
  6. // Use, modification and distribution is subject to the Boost Software License,
  7. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. #ifndef BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
  10. #define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
  11. #include <stddef.h>
  12. #include <boost/geometry/core/coordinate_type.hpp>
  13. #include <boost/geometry/policies/robustness/robust_point_type.hpp>
  14. #include <boost/geometry/policies/robustness/segment_ratio.hpp>
  15. namespace boost { namespace geometry
  16. {
  17. #ifndef DOXYGEN_NO_DETAIL
  18. namespace detail
  19. {
  20. // Redudant later.
  21. struct no_rescale_policy
  22. {
  23. static bool const enabled = false;
  24. // We don't rescale but return the reference of the input
  25. template <std::size_t Dimension, typename Value>
  26. inline Value const& apply(Value const& value) const
  27. {
  28. return value;
  29. }
  30. };
  31. } // namespace detail
  32. #endif
  33. // Implement meta-functions for this policy
  34. template <typename Point>
  35. struct robust_point_type<Point, detail::no_rescale_policy>
  36. {
  37. // The point itself
  38. typedef Point type;
  39. };
  40. }} // namespace boost::geometry
  41. #endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP