envelope_segment.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2017 Oracle and/or its affiliates.
  3. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle
  4. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  5. // Use, modification and distribution is subject to the Boost Software License,
  6. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP
  9. #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP
  10. #include <boost/geometry/algorithms/detail/envelope/segment.hpp>
  11. #include <boost/geometry/core/tags.hpp>
  12. #include <boost/geometry/strategies/envelope.hpp>
  13. #include <boost/geometry/util/select_calculation_type.hpp>
  14. namespace boost { namespace geometry
  15. {
  16. namespace strategy { namespace envelope
  17. {
  18. template
  19. <
  20. typename CalculationType = void
  21. >
  22. class cartesian_segment
  23. {
  24. public :
  25. template <typename Point1, typename Point2, typename Box>
  26. inline void
  27. apply(Point1 const& point1, Point2 const& point2, Box& box) const
  28. {
  29. geometry::detail::envelope::envelope_one_segment
  30. <
  31. 0,
  32. dimension<Point1>::value
  33. >
  34. ::apply(point1,
  35. point2,
  36. box,
  37. strategy::envelope::cartesian_segment<CalculationType>());
  38. }
  39. };
  40. #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  41. namespace services
  42. {
  43. template <typename CalculationType>
  44. struct default_strategy<cartesian_tag, CalculationType>
  45. {
  46. typedef strategy::envelope::cartesian_segment<CalculationType> type;
  47. };
  48. }
  49. #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
  50. }} // namespace strategy::envelope
  51. }} //namepsace boost::geometry
  52. #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_SEGMENT_HPP