Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:44

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0008 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
0013 
0014 #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
0015 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
0016 
0017 
0018 
0019 #include <boost/concept_check.hpp>
0020 #include <boost/core/ignore_unused.hpp>
0021 
0022 namespace boost { namespace geometry { namespace concepts
0023 {
0024 
0025 
0026 /*!
0027     \brief Checks strategy for centroid
0028     \ingroup centroid
0029 */
0030 template <typename Strategy>
0031 class CentroidStrategy
0032 {
0033 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
0034 
0035     // 1) must define state_type,
0036     typedef typename Strategy::state_type state_type;
0037 
0038     // 2) must define point_type,
0039     typedef typename Strategy::point_type point_type;
0040 
0041     // 3) must define point_type, of polygon (segments)
0042     typedef typename Strategy::segment_point_type spoint_type;
0043 
0044     struct check_methods
0045     {
0046         static void apply()
0047         {
0048             Strategy *str = 0;
0049             state_type *st = 0;
0050 
0051             // 4) must implement a static method apply,
0052             // getting two segment-points
0053             spoint_type const* sp = 0;
0054             str->apply(*sp, *sp, *st);
0055 
0056             // 5) must implement a static method result
0057             //  getting the centroid
0058             point_type *c = 0;
0059             bool r = str->result(*st, *c);
0060 
0061             boost::ignore_unused(str, r);
0062         }
0063     };
0064 
0065 public :
0066     BOOST_CONCEPT_USAGE(CentroidStrategy)
0067     {
0068         check_methods::apply();
0069     }
0070 #endif
0071 };
0072 
0073 
0074 }}} // namespace boost::geometry::concepts
0075 
0076 
0077 #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP