]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/concepts/centroid_concept.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / geometry / strategies / concepts / centroid_concept.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
6
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
9
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
14 #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
15 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
16
17
18
19 #include <boost/concept_check.hpp>
20
21
22 namespace boost { namespace geometry { namespace concepts
23 {
24
25
26 /*!
27 \brief Checks strategy for centroid
28 \ingroup centroid
29 */
30 template <typename Strategy>
31 class CentroidStrategy
32 {
33 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
34
35 // 1) must define state_type,
36 typedef typename Strategy::state_type state_type;
37
38 // 2) must define point_type,
39 typedef typename Strategy::point_type point_type;
40
41 // 3) must define point_type, of polygon (segments)
42 typedef typename Strategy::segment_point_type spoint_type;
43
44 struct check_methods
45 {
46 static void apply()
47 {
48 Strategy *str = 0;
49 state_type *st = 0;
50
51 // 4) must implement a static method apply,
52 // getting two segment-points
53 spoint_type const* sp = 0;
54 str->apply(*sp, *sp, *st);
55
56 // 5) must implement a static method result
57 // getting the centroid
58 point_type *c = 0;
59 bool r = str->result(*st, *c);
60
61 boost::ignore_unused_variable_warning(str);
62 boost::ignore_unused_variable_warning(r);
63 }
64 };
65
66 public :
67 BOOST_CONCEPT_USAGE(CentroidStrategy)
68 {
69 check_methods::apply();
70 }
71 #endif
72 };
73
74
75 }}} // namespace boost::geometry::concepts
76
77
78 #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP