Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80547 - in trunk/boost/geometry/extensions/nsphere: algorithms core geometries
From: bruno.lalande_at_[hidden]
Date: 2012-09-16 18:52:05


Author: bruno.lalande
Date: 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
New Revision: 80547
URL: http://svn.boost.org/trac/boost/changeset/80547

Log:
Updated nsphere code to reflect latest core changes.
Text files modified:
   trunk/boost/geometry/extensions/nsphere/algorithms/area.hpp | 11 ++++++-----
   trunk/boost/geometry/extensions/nsphere/algorithms/envelope.hpp | 21 ++++-----------------
   trunk/boost/geometry/extensions/nsphere/algorithms/num_points.hpp | 2 +-
   trunk/boost/geometry/extensions/nsphere/algorithms/within.hpp | 35 +++++++++++++++++++++--------------
   trunk/boost/geometry/extensions/nsphere/core/access.hpp | 2 +-
   trunk/boost/geometry/extensions/nsphere/core/replace_point_type.hpp | 3 +--
   trunk/boost/geometry/extensions/nsphere/geometries/nsphere.hpp | 2 +-
   7 files changed, 35 insertions(+), 41 deletions(-)

Modified: trunk/boost/geometry/extensions/nsphere/algorithms/area.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/algorithms/area.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/algorithms/area.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -17,7 +17,7 @@
 #include <boost/math/constants/constants.hpp>
 
 #include <boost/geometry/algorithms/area.hpp>
-
+#include <boost/geometry/extensions/nsphere/core/radius.hpp>
 #include <boost/geometry/extensions/nsphere/core/tags.hpp>
 
 
@@ -29,7 +29,7 @@
 namespace detail { namespace area
 {
 
-template<typename C, typename S>
+template<typename C>
 struct circle_area
 {
     typedef typename coordinate_type<C>::type coordinate_type;
@@ -42,6 +42,7 @@
                 coordinate_type
>::type return_type;
 
+ template <typename S>
     static inline return_type apply(C const& c, S const&)
     {
         // Currently only works for Cartesian circles
@@ -66,9 +67,9 @@
 {
 
 
-template <typename Geometry, typename Strategy>
-struct area<nsphere_tag, Geometry, Strategy>
- : detail::area::circle_area<Geometry, Strategy>
+template <typename Geometry>
+struct area<Geometry, nsphere_tag>
+ : detail::area::circle_area<Geometry>
 {};
 
 

Modified: trunk/boost/geometry/extensions/nsphere/algorithms/envelope.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/algorithms/envelope.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/algorithms/envelope.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -17,6 +17,7 @@
 
 #include <boost/geometry/algorithms/envelope.hpp>
 
+#include <boost/geometry/extensions/nsphere/core/radius.hpp>
 #include <boost/geometry/extensions/nsphere/core/tags.hpp>
 
 
@@ -28,9 +29,9 @@
 {
 
 /// Calculate envelope of an n-sphere, circle or sphere (currently only for Cartesian 2D points)
-template<typename Box, typename Nsphere, typename Strategy>
 struct envelope_nsphere
 {
+ template <typename Nsphere, typename Box, typename Strategy>
     static inline void apply(Nsphere const& nsphere, Box& mbr, Strategy const&)
     {
         assert_dimension<Nsphere, 2>();
@@ -53,23 +54,9 @@
 {
 
 
-template
-<
- typename Nsphere,
- typename Box,
- typename StrategyLess, typename StrategyGreater
->
-struct envelope
- <
- nsphere_tag, box_tag,
- Nsphere, Box,
- StrategyLess, StrategyGreater
- >
+template <typename Nsphere>
+struct envelope<Nsphere, nsphere_tag>
     : detail::envelope::envelope_nsphere
- <
- Nsphere, Box,
- StrategyLess
- >
 {};
 
 

Modified: trunk/boost/geometry/extensions/nsphere/algorithms/num_points.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/algorithms/num_points.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/algorithms/num_points.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -30,7 +30,7 @@
 
 
 template <typename Geometry>
-struct num_points<nsphere_tag, false, Geometry>
+struct num_points<nsphere_tag, Geometry>
         : detail::num_points::other_count<Geometry, 1>
 {};
 

Modified: trunk/boost/geometry/extensions/nsphere/algorithms/within.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/algorithms/within.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/algorithms/within.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -23,6 +23,7 @@
 #include <boost/geometry/multi/core/tags.hpp>
 
 #include <boost/geometry/extensions/nsphere/core/access.hpp>
+#include <boost/geometry/extensions/nsphere/core/radius.hpp>
 #include <boost/geometry/extensions/nsphere/core/tags.hpp>
 #include <boost/geometry/extensions/nsphere/algorithms/assign.hpp>
 
@@ -145,57 +146,63 @@
 {
 
 
-template <typename P, typename Circle, typename Strategy>
-struct within<point_tag, nsphere_tag, P, Circle, Strategy>
+template <typename P, typename Circle>
+struct within<P, Circle, point_tag, nsphere_tag>
 {
+ template <typename Strategy>
     static inline bool apply(P const& p, Circle const& c, Strategy const&)
     {
         return detail::within::point_in_circle(p, c);
     }
 };
 
-template <typename Box, typename Circle, typename Strategy>
-struct within<box_tag, nsphere_tag, Box, Circle, Strategy>
+template <typename Box, typename Circle>
+struct within<Box, Circle, box_tag, nsphere_tag>
 {
+ template <typename Strategy>
     static inline bool apply(Box const& b, Circle const& c, Strategy const&)
     {
         return detail::within::box_in_circle(b, c);
     }
 };
 
-template <typename Linestring, typename Circle, typename Strategy>
-struct within<linestring_tag, nsphere_tag, Linestring, Circle, Strategy>
+template <typename Linestring, typename Circle>
+struct within<Linestring, Circle, linestring_tag, nsphere_tag>
 {
+ template <typename Strategy>
     static inline bool apply(Linestring const& ln, Circle const& c, Strategy const&)
     {
         return detail::within::range_in_circle(ln, c);
     }
 };
 
-template <typename Ring, typename Circle, typename Strategy>
-struct within<ring_tag, nsphere_tag, Ring, Circle, Strategy>
+template <typename Ring, typename Circle>
+struct within<Ring, Circle, ring_tag, nsphere_tag>
 {
+ template <typename Strategy>
     static inline bool apply(Ring const& r, Circle const& c, Strategy const&)
     {
         return detail::within::range_in_circle(r, c);
     }
 };
 
-template <typename Polygon, typename Circle, typename Strategy>
-struct within<polygon_tag, nsphere_tag, Polygon, Circle, Strategy>
+template <typename Polygon, typename Circle>
+struct within<Polygon, Circle, polygon_tag, nsphere_tag>
 {
+ template <typename Strategy>
     static inline bool apply(Polygon const& poly, Circle const& c, Strategy const&)
     {
         return detail::within::polygon_in_circle(poly, c);
     }
 };
 
-template <typename M, typename C, typename Strategy>
-struct within<multi_polygon_tag, nsphere_tag, M, C, Strategy>
+template <typename M, typename C>
+struct within<M, C, multi_polygon_tag, nsphere_tag>
 {
- static inline bool apply(M const& m, C const& c)
+ template <typename Strategy>
+ static inline bool apply(M const& m, C const& c, Strategy const&)
     {
- return detail::within::multi_polygon_in_circle(m, c, Strategy const&);
+ return detail::within::multi_polygon_in_circle(m, c);
     }
 };
 

Modified: trunk/boost/geometry/extensions/nsphere/core/access.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/core/access.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/core/access.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -30,7 +30,7 @@
 {
 
 template <typename Nsphere, typename CoordinateType, std::size_t Dimension>
-struct access<nsphere_tag, Nsphere, CoordinateType, Dimension>
+struct access<nsphere_tag, Nsphere, CoordinateType, Dimension, boost::false_type>
 {
     static inline CoordinateType get(Nsphere const& nsphere)
     {

Modified: trunk/boost/geometry/extensions/nsphere/core/replace_point_type.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/core/replace_point_type.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/core/replace_point_type.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -16,10 +16,9 @@
 #define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_REPLACE_POINT_TYPE_HPP
 
 
-#include <boost/geometry/core/replace_point_type.hpp>
-
 #include <boost/geometry/extensions/nsphere/core/tags.hpp>
 #include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
+#include <boost/geometry/extensions/util/replace_point_type.hpp>
 
 
 namespace boost { namespace geometry

Modified: trunk/boost/geometry/extensions/nsphere/geometries/nsphere.hpp
==============================================================================
--- trunk/boost/geometry/extensions/nsphere/geometries/nsphere.hpp (original)
+++ trunk/boost/geometry/extensions/nsphere/geometries/nsphere.hpp 2012-09-16 18:52:03 EDT (Sun, 16 Sep 2012)
@@ -57,7 +57,7 @@
     nsphere()
         : m_radius(0)
     {
- detail::assign::assign_value(m_center, coordinate_type());
+ assign_value(m_center, coordinate_type());
     }
 
     nsphere(P const& center, T const& radius)


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