Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75972 - in trunk: boost/geometry/algorithms boost/geometry/multi/algorithms libs/geometry/doc/src/docutils/tools/support_status
From: bruno.lalande_at_[hidden]
Date: 2011-12-15 17:13:29


Author: bruno.lalande
Date: 2011-12-15 17:13:26 EST (Thu, 15 Dec 2011)
New Revision: 75972
URL: http://svn.boost.org/trac/boost/changeset/75972

Log:
dispatch::distance now gets the geometry tags by itself.
Text files modified:
   trunk/boost/geometry/algorithms/distance.hpp | 41 ++++++++++++++++++---------------------
   trunk/boost/geometry/multi/algorithms/distance.hpp | 8 +++---
   trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp | 11 ++-------
   3 files changed, 26 insertions(+), 34 deletions(-)

Modified: trunk/boost/geometry/algorithms/distance.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/distance.hpp (original)
+++ trunk/boost/geometry/algorithms/distance.hpp 2011-12-15 17:13:26 EST (Thu, 15 Dec 2011)
@@ -247,9 +247,10 @@
 
 template
 <
- typename Tag1, typename Tag2,
     typename Geometry1, typename Geometry2,
- typename StrategyTag, typename Strategy
+ typename StrategyTag, typename Strategy,
+ typename Tag1 = typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
+ typename Tag2 = typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type
>
 struct distance: not_implemented<for_geometry<Tag1>,
                                  and_geometry<Tag2> >
@@ -259,9 +260,9 @@
 template <typename P1, typename P2, typename Strategy>
 struct distance
     <
- point_tag, point_tag,
         P1, P2,
- strategy_tag_distance_point_point, Strategy
+ strategy_tag_distance_point_point, Strategy,
+ point_tag, point_tag
>
     : detail::distance::point_to_point<P1, P2, Strategy>
 {};
@@ -271,9 +272,9 @@
 template <typename Point, typename Linestring, typename Strategy>
 struct distance
 <
- point_tag, linestring_tag,
     Point, Linestring,
- strategy_tag_distance_point_point, Strategy
+ strategy_tag_distance_point_point, Strategy,
+ point_tag, linestring_tag
>
 {
 
@@ -300,9 +301,9 @@
 template <typename Point, typename Linestring, typename Strategy>
 struct distance
 <
- point_tag, linestring_tag,
     Point, Linestring,
- strategy_tag_distance_point_segment, Strategy
+ strategy_tag_distance_point_segment, Strategy,
+ point_tag, linestring_tag
>
 {
     static inline typename return_type<Strategy>::type apply(Point const& point,
@@ -321,9 +322,9 @@
 template <typename Point, typename Ring, typename Strategy>
 struct distance
 <
- point_tag, ring_tag,
     Point, Ring,
- strategy_tag_distance_point_point, Strategy
+ strategy_tag_distance_point_point, Strategy,
+ point_tag, ring_tag
>
 {
     typedef typename return_type<Strategy>::type return_type;
@@ -356,9 +357,9 @@
 template <typename Point, typename Polygon, typename Strategy>
 struct distance
 <
- point_tag, polygon_tag,
     Point, Polygon,
- strategy_tag_distance_point_point, Strategy
+ strategy_tag_distance_point_point, Strategy,
+ point_tag, polygon_tag
>
 {
     typedef typename return_type<Strategy>::type return_type;
@@ -392,9 +393,9 @@
 template <typename Point, typename Segment, typename Strategy>
 struct distance
 <
- point_tag, segment_tag,
     Point, Segment,
- strategy_tag_distance_point_point, Strategy
+ strategy_tag_distance_point_point, Strategy,
+ point_tag, segment_tag
> : detail::distance::point_to_segment<Point, Segment, Strategy>
 {};
 
@@ -402,8 +403,8 @@
 template <typename Point, typename Segment, typename Strategy>
 struct distance
 <
- point_tag, segment_tag,
     Point, Segment,
+ point_tag, segment_tag,
     strategy_tag_distance_point_segment, Strategy
>
 {
@@ -423,9 +424,10 @@
 // Strictly spoken this might be in namespace <impl> again
 template
 <
- typename GeometryTag1, typename GeometryTag2,
     typename G1, typename G2,
- typename StrategyTag, typename Strategy
+ typename StrategyTag, typename Strategy,
+ typename GeometryTag1 = typename tag_cast<typename tag<G1>::type, multi_tag>::type,
+ typename GeometryTag2 = typename tag_cast<typename tag<G2>::type, multi_tag>::type
>
 struct distance_reversed
 {
@@ -434,7 +436,6 @@
     {
         return distance
             <
- GeometryTag2, GeometryTag1,
                 G2, G1,
                 StrategyTag, Strategy
>::apply(g2, g1, strategy);
@@ -493,8 +494,6 @@
             typename geometry::reverse_dispatch<Geometry1, Geometry2>::type,
             dispatch::distance_reversed
                 <
- typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
- typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type,
                     Geometry1,
                     Geometry2,
                     typename strategy::distance::services::tag<Strategy>::type,
@@ -502,8 +501,6 @@
>,
                 dispatch::distance
                 <
- typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
- typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type,
                     Geometry1,
                     Geometry2,
                     typename strategy::distance::services::tag<Strategy>::type,

Modified: trunk/boost/geometry/multi/algorithms/distance.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/distance.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/distance.hpp 2011-12-15 17:13:26 EST (Thu, 15 Dec 2011)
@@ -105,17 +105,17 @@
 
 template
 <
- typename SingleGeometryTag,
     typename G1,
     typename G2,
- typename Strategy
+ typename Strategy,
+ typename SingleGeometryTag
>
-struct distance<SingleGeometryTag, multi_tag, G1, G2, strategy_tag_distance_point_point, Strategy>
+struct distance<G1, G2, strategy_tag_distance_point_point, Strategy, SingleGeometryTag, multi_tag>
     : detail::distance::distance_single_to_multi<G1, G2, Strategy>
 {};
 
 template <typename G1, typename G2, typename Strategy>
-struct distance<multi_tag, multi_tag, G1, G2, strategy_tag_distance_point_point, Strategy>
+struct distance<G1, G2, strategy_tag_distance_point_point, Strategy, multi_tag, multi_tag>
     : detail::distance::distance_multi_to_multi<G1, G2, Strategy>
 {};
 

Modified: trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp 2011-12-15 17:13:26 EST (Thu, 15 Dec 2011)
@@ -30,11 +30,9 @@
> types;
 
 
-template <typename Tag1, typename Tag2, typename G1, typename G2>
+template <typename G1, typename G2>
 struct check_distance
   : boost::geometry::dispatch::distance<
- Tag1,
- Tag2,
         G1,
         G2,
         boost::geometry::strategy_tag_distance_point_point,
@@ -57,11 +55,8 @@
     template <typename T2>
     void operator()(T2)
     {
- typedef typename boost::geometry::tag<T1>::type tag1;
- typedef typename boost::geometry::tag<T2>::type tag2;
-
- if (boost::is_base_of<boost::geometry::not_implemented_base, check_distance<tag1, tag2, T1, T2> >::type::value
- && boost::is_base_of<boost::geometry::not_implemented_base, check_distance<tag2, tag1, T2, T1> >::type::value)
+ if (boost::is_base_of<boost::geometry::not_implemented_base, check_distance<T1, T2> >::type::value
+ && boost::is_base_of<boost::geometry::not_implemented_base, check_distance<T2, T1> >::type::value)
         {
             std::cout << "-\t";
         }


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