convex_hull_concept.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2014.
  6. // Modifications copyright (c) 2014 Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  10. // Use, modification and distribution is subject to the Boost Software License,
  11. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CONVEX_HULL_CONCEPT_HPP
  14. #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CONVEX_HULL_CONCEPT_HPP
  15. #include <vector>
  16. #include <boost/concept_check.hpp>
  17. namespace boost { namespace geometry { namespace concepts
  18. {
  19. /*!
  20. \brief Checks strategy for convex_hull
  21. \ingroup convex_hull
  22. */
  23. template <typename Strategy>
  24. class ConvexHullStrategy
  25. {
  26. #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
  27. // 1) must define state_type
  28. typedef typename Strategy::state_type state_type;
  29. // 2) must define point_type
  30. typedef typename Strategy::point_type point_type;
  31. // 3) must define geometry_type
  32. typedef typename Strategy::geometry_type geometry_type;
  33. struct check_methods
  34. {
  35. static void apply()
  36. {
  37. Strategy const* str = 0;
  38. state_type* st = 0;
  39. geometry_type* sp = 0;
  40. std::vector<point_type> *v = 0;
  41. // 4) must implement a method apply, iterating over a range
  42. str->apply(*sp, *st);
  43. // 5) must implement a method result, with an output iterator
  44. str->result(*st, std::back_inserter(*v), true, true);
  45. }
  46. };
  47. public :
  48. BOOST_CONCEPT_USAGE(ConvexHullStrategy)
  49. {
  50. check_methods::apply();
  51. }
  52. #endif
  53. };
  54. }}} // namespace boost::geometry::concepts
  55. #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CONVEX_HULL_CONCEPT_HPP