Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@16: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@16: Chris@16: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@16: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP Chris@16: #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@101: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: Chris@16: namespace boost { namespace geometry { namespace concept Chris@16: { Chris@16: Chris@16: Chris@16: /*! Chris@16: \brief Checks strategy for simplify Chris@16: \ingroup simplify Chris@16: */ Chris@16: template Chris@16: struct SimplifyStrategy Chris@16: { Chris@16: #ifndef DOXYGEN_NO_CONCEPT_MEMBERS Chris@16: private : Chris@16: Chris@16: // 1) must define distance_strategy_type, Chris@16: // defining point-segment distance strategy (to be checked) Chris@16: typedef typename Strategy::distance_strategy_type ds_type; Chris@16: Chris@16: Chris@16: struct checker Chris@16: { Chris@16: template Chris@16: static void apply(ApplyMethod) Chris@16: { Chris@16: namespace ft = boost::function_types; Chris@16: typedef typename ft::parameter_types Chris@16: < Chris@16: ApplyMethod Chris@16: >::type parameter_types; Chris@16: Chris@16: typedef typename boost::mpl::if_ Chris@16: < Chris@16: ft::is_member_function_pointer, Chris@16: boost::mpl::int_<1>, Chris@16: boost::mpl::int_<0> Chris@16: >::type base_index; Chris@16: Chris@16: BOOST_CONCEPT_ASSERT Chris@16: ( Chris@16: (concept::PointSegmentDistanceStrategy) Chris@16: ); Chris@16: Chris@16: Strategy *str = 0; Chris@16: std::vector const* v1 = 0; Chris@16: std::vector * v2 = 0; Chris@16: Chris@16: // 2) must implement method apply with arguments Chris@16: // - Range Chris@16: // - OutputIterator Chris@16: // - floating point value Chris@16: str->apply(*v1, std::back_inserter(*v2), 1.0); Chris@16: Chris@101: boost::ignore_unused(); Chris@101: boost::ignore_unused(str); Chris@16: } Chris@16: }; Chris@16: Chris@16: public : Chris@16: BOOST_CONCEPT_USAGE(SimplifyStrategy) Chris@16: { Chris@16: checker::apply(&ds_type::template apply); Chris@16: } Chris@16: #endif Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: }}} // namespace boost::geometry::concept Chris@16: Chris@16: #endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP