Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60647 - sandbox/geometry/boost/geometry/multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2010-03-16 08:41:17


Author: barendgehrels
Date: 2010-03-16 08:41:17 EDT (Tue, 16 Mar 2010)
New Revision: 60647
URL: http://svn.boost.org/trac/boost/changeset/60647

Log:
Updated multi/equals to new approach
Text files modified:
   sandbox/geometry/boost/geometry/multi/algorithms/equals.hpp | 66 ++++-----------------------------------
   1 files changed, 8 insertions(+), 58 deletions(-)

Modified: sandbox/geometry/boost/geometry/multi/algorithms/equals.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/equals.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/equals.hpp 2010-03-16 08:41:17 EDT (Tue, 16 Mar 2010)
@@ -15,58 +15,9 @@
 
 #include <boost/geometry/algorithms/equals.hpp>
 
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace equals {
-
 
-template <typename MultiPolygon1, typename MultiPolygon2>
-struct multi_polygon_twice
-{
- static inline bool apply(MultiPolygon1 const& multi1,
- MultiPolygon2 const& multi2)
- {
- if (boost::size(multi1) != boost::size(multi2))
- {
- return false;
- }
-
- typedef polygon_polygon
- <
- typename boost::range_value<MultiPolygon1>::type,
- typename boost::range_value<MultiPolygon2>::type
- > compare;
-
- return range_range<compare>(multi1, multi2);
- }
-};
-
-template <typename Polygon, typename MultiPolygon>
-struct single_eq_multi_polygon
+namespace boost { namespace geometry
 {
- static inline bool apply(Polygon const& polygon,
- MultiPolygon const& multi)
- {
- if (boost::size(multi) != 1)
- {
- return false;
- }
-
- return polygon_polygon
- <
- Polygon,
- typename boost::range_value<MultiPolygon>::type
- >::apply(polygon, multi.front());
- }
-};
-
-
-
-}} // namespace detail::equals
-#endif // DOXYGEN_NO_DETAIL
-
 
 #ifndef DOXYGEN_NO_DISPATCH
 namespace dispatch
@@ -81,15 +32,14 @@
         MultiPolygon1, MultiPolygon2,
         2
>
- : detail::equals::multi_polygon_twice
+ : detail::equals::equals_by_collection
         <
- MultiPolygon1,
- MultiPolygon2
+ MultiPolygon1, MultiPolygon2,
+ detail::equals::area_check
>
 {};
 
 
-
 template <typename Polygon, typename MultiPolygon>
 struct equals
     <
@@ -98,10 +48,10 @@
         Polygon, MultiPolygon,
         2
>
- : detail::equals::single_eq_multi_polygon
+ : detail::equals::equals_by_collection
         <
- Polygon,
- MultiPolygon
+ Polygon, MultiPolygon,
+ detail::equals::area_check
>
 {};
 
@@ -110,8 +60,8 @@
 #endif // DOXYGEN_NO_DISPATCH
 
 
-
 }} // namespace boost::geometry
 
+
 #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_EQUALS_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