stabilize build system: depends, installer, boost/bdb fixes, cross targets groundwork
This commit is contained in:
+75
@@ -0,0 +1,75 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for area
|
||||
\ingroup area
|
||||
*/
|
||||
template <typename Strategy>
|
||||
class AreaStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
// 1) must define state_type,
|
||||
typedef typename Strategy::state_type state_type;
|
||||
|
||||
// 2) must define return_type,
|
||||
typedef typename Strategy::return_type return_type;
|
||||
|
||||
// 3) must define point_type, of polygon (segments)
|
||||
typedef typename Strategy::segment_point_type spoint_type;
|
||||
|
||||
struct check_methods
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
Strategy const* str = 0;
|
||||
state_type *st = 0;
|
||||
|
||||
// 4) must implement a method apply with the following signature
|
||||
spoint_type const* sp = 0;
|
||||
str->apply(*sp, *sp, *st);
|
||||
|
||||
// 5) must implement a static method result with the following signature
|
||||
return_type r = str->result(*st);
|
||||
|
||||
boost::ignore_unused_variable_warning(r);
|
||||
boost::ignore_unused_variable_warning(str);
|
||||
}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(AreaStrategy)
|
||||
{
|
||||
check_methods::apply();
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
|
||||
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for centroid
|
||||
\ingroup centroid
|
||||
*/
|
||||
template <typename Strategy>
|
||||
class CentroidStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
// 1) must define state_type,
|
||||
typedef typename Strategy::state_type state_type;
|
||||
|
||||
// 2) must define point_type,
|
||||
typedef typename Strategy::point_type point_type;
|
||||
|
||||
// 3) must define point_type, of polygon (segments)
|
||||
typedef typename Strategy::segment_point_type spoint_type;
|
||||
|
||||
struct check_methods
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
Strategy *str = 0;
|
||||
state_type *st = 0;
|
||||
|
||||
// 4) must implement a static method apply,
|
||||
// getting two segment-points
|
||||
spoint_type const* sp = 0;
|
||||
str->apply(*sp, *sp, *st);
|
||||
|
||||
// 5) must implement a static method result
|
||||
// getting the centroid
|
||||
point_type *c = 0;
|
||||
bool r = str->result(*st, *c);
|
||||
|
||||
boost::ignore_unused_variable_warning(str);
|
||||
boost::ignore_unused_variable_warning(r);
|
||||
}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(CentroidStrategy)
|
||||
{
|
||||
check_methods::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CONVEX_HULL_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CONVEX_HULL_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for convex_hull
|
||||
\ingroup convex_hull
|
||||
*/
|
||||
template <typename Strategy>
|
||||
class ConvexHullStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
// 1) must define state_type
|
||||
typedef typename Strategy::state_type state_type;
|
||||
|
||||
// 2) must define point_type
|
||||
typedef typename Strategy::point_type point_type;
|
||||
|
||||
// 3) must define geometry_type
|
||||
typedef typename Strategy::geometry_type geometry_type;
|
||||
|
||||
struct check_methods
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
Strategy const* str = 0;
|
||||
|
||||
state_type* st = 0;
|
||||
geometry_type* sp = 0;
|
||||
std::vector<point_type> *v = 0;
|
||||
|
||||
// 4) must implement a method apply, iterating over a range
|
||||
str->apply(*sp, *st);
|
||||
|
||||
// 5) must implement a method result, with an output iterator
|
||||
str->result(*st, std::back_inserter(*v), true, true);
|
||||
}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(ConvexHullStrategy)
|
||||
{
|
||||
check_methods::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CONVEX_HULL_CONCEPT_HPP
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_DISTANCE_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_DISTANCE_CONCEPT_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/geometry/util/parameter_type_of.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
#include <boost/geometry/geometries/segment.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for point-point or point-box or box-box distance
|
||||
\ingroup distance
|
||||
*/
|
||||
template <typename Strategy, typename Point1, typename Point2>
|
||||
struct PointDistanceStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
private :
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename ApplyMethod>
|
||||
static void apply(ApplyMethod)
|
||||
{
|
||||
// 1: inspect and define both arguments of apply
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 0
|
||||
>::type ptype1;
|
||||
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 1
|
||||
>::type ptype2;
|
||||
|
||||
// 2) must define meta-function "return_type"
|
||||
typedef typename strategy::distance::services::return_type
|
||||
<
|
||||
Strategy, ptype1, ptype2
|
||||
>::type rtype;
|
||||
|
||||
// 3) must define meta-function "comparable_type"
|
||||
typedef typename strategy::distance::services::comparable_type
|
||||
<
|
||||
Strategy
|
||||
>::type ctype;
|
||||
|
||||
// 4) must define meta-function "tag"
|
||||
typedef typename strategy::distance::services::tag
|
||||
<
|
||||
Strategy
|
||||
>::type tag;
|
||||
|
||||
static const bool is_correct_strategy_tag =
|
||||
boost::is_same<tag, strategy_tag_distance_point_point>::value
|
||||
|| boost::is_same<tag, strategy_tag_distance_point_box>::value
|
||||
|| boost::is_same<tag, strategy_tag_distance_box_box>::value;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
((is_correct_strategy_tag),
|
||||
INCORRECT_STRATEGY_TAG,
|
||||
(types<tag>));
|
||||
|
||||
// 5) must implement apply with arguments
|
||||
Strategy* str = 0;
|
||||
ptype1 *p1 = 0;
|
||||
ptype2 *p2 = 0;
|
||||
rtype r = str->apply(*p1, *p2);
|
||||
|
||||
// 6) must define (meta)struct "get_comparable" with apply
|
||||
ctype c = strategy::distance::services::get_comparable
|
||||
<
|
||||
Strategy
|
||||
>::apply(*str);
|
||||
|
||||
// 7) must define (meta)struct "result_from_distance" with apply
|
||||
r = strategy::distance::services::result_from_distance
|
||||
<
|
||||
Strategy,
|
||||
ptype1, ptype2
|
||||
>::apply(*str, 1.0);
|
||||
|
||||
boost::ignore_unused<tag>();
|
||||
boost::ignore_unused(str, c, r);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(PointDistanceStrategy)
|
||||
{
|
||||
checker::apply(&Strategy::template apply<Point1, Point2>);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for point-segment distance
|
||||
\ingroup strategy_concepts
|
||||
*/
|
||||
template <typename Strategy, typename Point, typename PointOfSegment>
|
||||
struct PointSegmentDistanceStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
private :
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename ApplyMethod>
|
||||
static void apply(ApplyMethod)
|
||||
{
|
||||
// 1) inspect and define both arguments of apply
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 0
|
||||
>::type ptype;
|
||||
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 1
|
||||
>::type sptype;
|
||||
|
||||
namespace services = strategy::distance::services;
|
||||
// 2) must define meta-function "tag"
|
||||
typedef typename services::tag<Strategy>::type tag;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
((boost::is_same
|
||||
<
|
||||
tag, strategy_tag_distance_point_segment
|
||||
>::value),
|
||||
INCORRECT_STRATEGY_TAG,
|
||||
(types<tag>));
|
||||
|
||||
// 3) must define meta-function "return_type"
|
||||
typedef typename services::return_type
|
||||
<
|
||||
Strategy, ptype, sptype
|
||||
>::type rtype;
|
||||
|
||||
// 4) must define meta-function "comparable_type"
|
||||
typedef typename services::comparable_type<Strategy>::type ctype;
|
||||
|
||||
// 5) must implement apply with arguments
|
||||
Strategy *str = 0;
|
||||
ptype *p = 0;
|
||||
sptype *sp1 = 0;
|
||||
sptype *sp2 = 0;
|
||||
|
||||
rtype r = str->apply(*p, *sp1, *sp2);
|
||||
|
||||
// 6) must define (meta-)struct "get_comparable" with apply
|
||||
ctype cstrategy = services::get_comparable<Strategy>::apply(*str);
|
||||
|
||||
// 7) must define (meta-)struct "result_from_distance" with apply
|
||||
r = services::result_from_distance
|
||||
<
|
||||
Strategy, ptype, sptype
|
||||
>::apply(*str, rtype(1.0));
|
||||
|
||||
boost::ignore_unused(str, r, cstrategy);
|
||||
}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(PointSegmentDistanceStrategy)
|
||||
{
|
||||
checker::apply(&Strategy::template apply<Point, PointOfSegment>);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_DISTANCE_CONCEPT_HPP
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SEGMENT_INTERSECT_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SEGMENT_INTERSECT_CONCEPT_HPP
|
||||
|
||||
|
||||
//NOT FINISHED!
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for segment intersection
|
||||
\ingroup segment_intersection
|
||||
*/
|
||||
template <typename Strategy>
|
||||
class SegmentIntersectStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
// 1) must define return_type
|
||||
typedef typename Strategy::return_type return_type;
|
||||
|
||||
// 2) must define point_type (of segment points)
|
||||
//typedef typename Strategy::point_type point_type;
|
||||
|
||||
// 3) must define segment_type 1 and 2 (of segment points)
|
||||
typedef typename Strategy::segment_type1 segment_type1;
|
||||
typedef typename Strategy::segment_type2 segment_type2;
|
||||
|
||||
|
||||
struct check_methods
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
Strategy const* str;
|
||||
|
||||
return_type* rt;
|
||||
//point_type const* p;
|
||||
segment_type1 const* s1;
|
||||
segment_type2 const* s2;
|
||||
|
||||
// 4) must implement a method apply
|
||||
// having two segments
|
||||
*rt = str->apply(*s1, *s2);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(SegmentIntersectStrategy)
|
||||
{
|
||||
check_methods::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SEGMENT_INTERSECT_CONCEPT_HPP
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/strategies/concepts/distance_concept.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for simplify
|
||||
\ingroup simplify
|
||||
*/
|
||||
template <typename Strategy, typename Point>
|
||||
struct SimplifyStrategy
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
private :
|
||||
|
||||
// 1) must define distance_strategy_type,
|
||||
// defining point-segment distance strategy (to be checked)
|
||||
typedef typename Strategy::distance_strategy_type ds_type;
|
||||
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename ApplyMethod>
|
||||
static void apply(ApplyMethod)
|
||||
{
|
||||
namespace ft = boost::function_types;
|
||||
typedef typename ft::parameter_types
|
||||
<
|
||||
ApplyMethod
|
||||
>::type parameter_types;
|
||||
|
||||
typedef typename boost::mpl::if_
|
||||
<
|
||||
ft::is_member_function_pointer<ApplyMethod>,
|
||||
boost::mpl::int_<1>,
|
||||
boost::mpl::int_<0>
|
||||
>::type base_index;
|
||||
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::PointSegmentDistanceStrategy<ds_type, Point, Point>)
|
||||
);
|
||||
|
||||
Strategy *str = 0;
|
||||
std::vector<Point> const* v1 = 0;
|
||||
std::vector<Point> * v2 = 0;
|
||||
|
||||
// 2) must implement method apply with arguments
|
||||
// - Range
|
||||
// - OutputIterator
|
||||
// - floating point value
|
||||
str->apply(*v1, std::back_inserter(*v2), 1.0);
|
||||
|
||||
boost::ignore_unused<parameter_types, base_index>();
|
||||
boost::ignore_unused(str);
|
||||
}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(SimplifyStrategy)
|
||||
{
|
||||
checker::apply(&ds_type::template apply<Point, Point>);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP
|
||||
+291
@@ -0,0 +1,291 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_WITHIN_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_WITHIN_CONCEPT_HPP
|
||||
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/function_types/result_type.hpp>
|
||||
|
||||
#include <boost/geometry/util/parameter_type_of.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks strategy for within (point-in-polygon)
|
||||
\ingroup within
|
||||
*/
|
||||
template <typename Strategy>
|
||||
class WithinStrategyPolygonal
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
// 1) must define state_type
|
||||
typedef typename Strategy::state_type state_type;
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename ApplyMethod, typename ResultMethod>
|
||||
static void apply(ApplyMethod const&, ResultMethod const& )
|
||||
{
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 0
|
||||
>::type point_type;
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 1
|
||||
>::type segment_point_type;
|
||||
|
||||
// CHECK: apply-arguments should both fulfill point concept
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::ConstPoint<point_type>)
|
||||
);
|
||||
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::ConstPoint<segment_point_type>)
|
||||
);
|
||||
|
||||
// CHECK: return types (result: int, apply: bool)
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
(
|
||||
(boost::is_same
|
||||
<
|
||||
bool, typename boost::function_types::result_type<ApplyMethod>::type
|
||||
>::type::value),
|
||||
WRONG_RETURN_TYPE_OF_APPLY
|
||||
, (bool)
|
||||
);
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
(
|
||||
(boost::is_same
|
||||
<
|
||||
int, typename boost::function_types::result_type<ResultMethod>::type
|
||||
>::type::value),
|
||||
WRONG_RETURN_TYPE_OF_RESULT
|
||||
, (int)
|
||||
);
|
||||
|
||||
|
||||
// CHECK: calling method apply and result
|
||||
Strategy const* str = 0;
|
||||
state_type* st = 0;
|
||||
point_type const* p = 0;
|
||||
segment_point_type const* sp = 0;
|
||||
|
||||
bool b = str->apply(*p, *sp, *sp, *st);
|
||||
int r = str->result(*st);
|
||||
|
||||
boost::ignore_unused_variable_warning(r);
|
||||
boost::ignore_unused_variable_warning(b);
|
||||
boost::ignore_unused_variable_warning(str);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(WithinStrategyPolygonal)
|
||||
{
|
||||
checker::apply(&Strategy::apply, &Strategy::result);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename Strategy>
|
||||
class WithinStrategyPointBox
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename ApplyMethod>
|
||||
static void apply(ApplyMethod const&)
|
||||
{
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 0
|
||||
>::type point_type;
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 1
|
||||
>::type box_type;
|
||||
|
||||
// CHECK: apply-arguments should fulfill point/box concept
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::ConstPoint<point_type>)
|
||||
);
|
||||
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::ConstBox<box_type>)
|
||||
);
|
||||
|
||||
// CHECK: return types (apply: bool)
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
(
|
||||
(boost::is_same
|
||||
<
|
||||
bool,
|
||||
typename boost::function_types::result_type<ApplyMethod>::type
|
||||
>::type::value),
|
||||
WRONG_RETURN_TYPE
|
||||
, (bool)
|
||||
);
|
||||
|
||||
|
||||
// CHECK: calling method apply
|
||||
Strategy const* str = 0;
|
||||
point_type const* p = 0;
|
||||
box_type const* bx = 0;
|
||||
|
||||
bool b = str->apply(*p, *bx);
|
||||
|
||||
boost::ignore_unused_variable_warning(b);
|
||||
boost::ignore_unused_variable_warning(str);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(WithinStrategyPointBox)
|
||||
{
|
||||
checker::apply(&Strategy::apply);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename Strategy>
|
||||
class WithinStrategyBoxBox
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
struct checker
|
||||
{
|
||||
template <typename ApplyMethod>
|
||||
static void apply(ApplyMethod const&)
|
||||
{
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 0
|
||||
>::type box_type1;
|
||||
typedef typename parameter_type_of
|
||||
<
|
||||
ApplyMethod, 1
|
||||
>::type box_type2;
|
||||
|
||||
// CHECK: apply-arguments should both fulfill box concept
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::ConstBox<box_type1>)
|
||||
);
|
||||
|
||||
BOOST_CONCEPT_ASSERT
|
||||
(
|
||||
(concepts::ConstBox<box_type2>)
|
||||
);
|
||||
|
||||
// CHECK: return types (apply: bool)
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
(
|
||||
(boost::is_same
|
||||
<
|
||||
bool,
|
||||
typename boost::function_types::result_type<ApplyMethod>::type
|
||||
>::type::value),
|
||||
WRONG_RETURN_TYPE
|
||||
, (bool)
|
||||
);
|
||||
|
||||
|
||||
// CHECK: calling method apply
|
||||
Strategy const* str = 0;
|
||||
box_type1 const* b1 = 0;
|
||||
box_type2 const* b2 = 0;
|
||||
|
||||
bool b = str->apply(*b1, *b2);
|
||||
|
||||
boost::ignore_unused_variable_warning(b);
|
||||
boost::ignore_unused_variable_warning(str);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(WithinStrategyBoxBox)
|
||||
{
|
||||
checker::apply(&Strategy::apply);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
// So now: boost::geometry::concepts::within
|
||||
namespace within
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template <typename FirstTag, typename SecondTag, typename CastedTag, typename Strategy>
|
||||
struct check_within
|
||||
{};
|
||||
|
||||
|
||||
template <typename AnyTag, typename Strategy>
|
||||
struct check_within<point_tag, AnyTag, areal_tag, Strategy>
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (WithinStrategyPolygonal<Strategy>) );
|
||||
};
|
||||
|
||||
|
||||
template <typename Strategy>
|
||||
struct check_within<point_tag, box_tag, areal_tag, Strategy>
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (WithinStrategyPointBox<Strategy>) );
|
||||
};
|
||||
|
||||
template <typename Strategy>
|
||||
struct check_within<box_tag, box_tag, areal_tag, Strategy>
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (WithinStrategyBoxBox<Strategy>) );
|
||||
};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks, in compile-time, the concept of any within-strategy
|
||||
\ingroup concepts
|
||||
*/
|
||||
template <typename FirstTag, typename SecondTag, typename CastedTag, typename Strategy>
|
||||
inline void check()
|
||||
{
|
||||
dispatch::check_within<FirstTag, SecondTag, CastedTag, Strategy> c;
|
||||
boost::ignore_unused_variable_warning(c);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespace boost::geometry::concepts::within
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_CONCEPTS_WITHIN_CONCEPT_HPP
|
||||
Reference in New Issue
Block a user