Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60342 - in sandbox/geometry/boost/geometry: extensions/nsphere/algorithms multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2010-03-08 04:56:24


Author: barendgehrels
Date: 2010-03-08 04:56:24 EST (Mon, 08 Mar 2010)
New Revision: 60342
URL: http://svn.boost.org/trac/boost/changeset/60342

Log:
Fix in circle
Added reverse for multi
Added:
   sandbox/geometry/boost/geometry/multi/algorithms/reverse.hpp (contents, props changed)
Text files modified:
   sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/within.hpp | 26 +++++++++++++-------------
   1 files changed, 13 insertions(+), 13 deletions(-)

Modified: sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/within.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/within.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/within.hpp 2010-03-08 04:56:24 EST (Mon, 08 Mar 2010)
@@ -50,7 +50,7 @@
 
     P const center = geometry::make<P>(get<0>(c), get<1>(c));
     strategy_type distance;
- return_type const r = distance(p, center);
+ return_type const r = geometry::distance(p, center);
     return_type const rad = make_distance_result<return_type>(get_radius<0>(c));
 
     return r < rad;
@@ -134,8 +134,8 @@
 {
 
 
-template <typename P, typename Circle>
-struct within<point_tag, nsphere_tag, P, Circle>
+template <typename P, typename Circle, typename Strategy>
+struct within<point_tag, nsphere_tag, P, Circle, Strategy>
 {
     static inline bool apply(P const& p, Circle const& c)
     {
@@ -143,8 +143,8 @@
     }
 };
 
-template <typename Box, typename Circle>
-struct within<box_tag, nsphere_tag, Box, Circle>
+template <typename Box, typename Circle, typename Strategy>
+struct within<box_tag, nsphere_tag, Box, Circle, Strategy>
 {
     static inline bool apply(Box const& b, Circle const& c)
     {
@@ -152,8 +152,8 @@
     }
 };
 
-template <typename Linestring, typename Circle>
-struct within<linestring_tag, nsphere_tag, Linestring, Circle>
+template <typename Linestring, typename Circle, typename Strategy>
+struct within<linestring_tag, nsphere_tag, Linestring, Circle, Strategy>
 {
     static inline bool apply(Linestring const& ln, Circle const& c)
     {
@@ -161,8 +161,8 @@
     }
 };
 
-template <typename Ring, typename Circle>
-struct within<ring_tag, nsphere_tag, Ring, Circle>
+template <typename Ring, typename Circle, typename Strategy>
+struct within<ring_tag, nsphere_tag, Ring, Circle, Strategy>
 {
     static inline bool apply(Ring const& r, Circle const& c)
     {
@@ -170,8 +170,8 @@
     }
 };
 
-template <typename Polygon, typename Circle>
-struct within<polygon_tag, nsphere_tag, Polygon, Circle>
+template <typename Polygon, typename Circle, typename Strategy>
+struct within<polygon_tag, nsphere_tag, Polygon, Circle, Strategy>
 {
     static inline bool apply(Polygon const& poly, Circle const& c)
     {
@@ -179,8 +179,8 @@
     }
 };
 
-template <typename M, typename C>
-struct within<multi_polygon_tag, nsphere_tag, M, C>
+template <typename M, typename C, typename Strategy>
+struct within<multi_polygon_tag, nsphere_tag, M, C, Strategy>
 {
     static inline bool apply(const M& m, const C& c)
     {

Added: sandbox/geometry/boost/geometry/multi/algorithms/reverse.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/boost/geometry/multi/algorithms/reverse.hpp 2010-03-08 04:56:24 EST (Mon, 08 Mar 2010)
@@ -0,0 +1,64 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2010, Geodan, Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// 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_MULTI_ALGORITHMS_REVERSE_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_REVERSE_HPP
+
+#include <boost/range/functions.hpp>
+#include <boost/range/metafunctions.hpp>
+
+
+#include <boost/geometry/algorithms/reverse.hpp>
+
+#include <boost/geometry/multi/core/tags.hpp>
+
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace reverse {
+
+template <typename MultiPolygon>
+struct reverse_multi_polygon
+{
+ static inline void apply(MultiPolygon& mp)
+ {
+ typedef typename boost::range_value<MultiPolygon>::type polygon_type;
+ for (typename boost::range_iterator<MultiPolygon>::type it
+ = boost::begin(mp);
+ it != boost::end(mp);
+ ++it)
+ {
+ polygon_reverse<polygon_type>::apply(*it);
+ }
+ }
+};
+
+}} // namespace detail::reverse
+#endif
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+template <typename Geometry>
+struct reverse<multi_polygon_tag, Geometry>
+ : detail::reverse::reverse_multi_polygon<Geometry>
+{};
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_REVERSE_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk