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_SIMPLIFY_CONCEPT_HPP
15 #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
20 #include <boost/concept_check.hpp>
21 #include <boost/core/ignore_unused.hpp>
23 #include <boost/geometry/geometries/point.hpp>
24 #include <boost/geometry/strategies/concepts/distance_concept.hpp>
27 namespace boost { namespace geometry { namespace concepts
32 \brief Checks strategy for simplify
35 template <typename Strategy, typename Point>
36 struct SimplifyStrategy
38 #ifndef DOXYGEN_NO_CONCEPT_MEMBERS
41 // 1) must define distance_strategy_type,
42 // defining point-segment distance strategy (to be checked)
43 typedef typename Strategy::distance_strategy_type ds_type;
48 template <typename ApplyMethod>
49 static void apply(ApplyMethod)
51 namespace ft = boost::function_types;
52 typedef typename ft::parameter_types
55 >::type parameter_types;
57 typedef typename boost::mpl::if_
59 ft::is_member_function_pointer<ApplyMethod>,
66 (concepts::PointSegmentDistanceStrategy<ds_type, Point, Point>)
70 std::vector<Point> const* v1 = 0;
71 std::vector<Point> * v2 = 0;
73 // 2) must implement method apply with arguments
76 // - floating point value
77 str->apply(*v1, std::back_inserter(*v2), 1.0);
79 boost::ignore_unused<parameter_types, base_index>();
80 boost::ignore_unused(str);
85 BOOST_CONCEPT_USAGE(SimplifyStrategy)
87 checker::apply(&ds_type::template apply<Point, Point>);
94 }}} // namespace boost::geometry::concepts
96 #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP