1 // Boost.Geometry (aka GGL, Generic Geometry Library)
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.
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (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)
14 #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
15 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
19 #include <boost/concept_check.hpp>
22 namespace boost { namespace geometry { namespace concepts
27 \brief Checks strategy for centroid
30 template <typename Strategy>
31 class CentroidStrategy
33 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
35 // 1) must define state_type,
36 typedef typename Strategy::state_type state_type;
38 // 2) must define point_type,
39 typedef typename Strategy::point_type point_type;
41 // 3) must define point_type, of polygon (segments)
42 typedef typename Strategy::segment_point_type spoint_type;
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);
56 // 5) must implement a static method result
57 // getting the centroid
59 bool r = str->result(*st, *c);
61 boost::ignore_unused_variable_warning(str);
62 boost::ignore_unused_variable_warning(r);
67 BOOST_CONCEPT_USAGE(CentroidStrategy)
69 check_methods::apply();
75 }}} // namespace boost::geometry::concepts
78 #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP