Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85291 - trunk/libs/geometry/example
From: barend.gehrels_at_[hidden]
Date: 2013-08-10 17:39:45


Author: barendgehrels
Date: 2013-08-10 17:39:45 EDT (Sat, 10 Aug 2013)
New Revision: 85291
URL: http://svn.boost.org/trac/boost/changeset/85291

Log:
[geometry] adapted examples to new distance strategy structure

Text files modified:
   trunk/libs/geometry/example/07_a_graph_route_example.cpp | 2 +-
   trunk/libs/geometry/example/07_b_graph_route_example.cpp | 2 +-
   trunk/libs/geometry/example/c11_custom_cs_transform_example.cpp | 12 ++++++------
   3 files changed, 8 insertions(+), 8 deletions(-)

Modified: trunk/libs/geometry/example/07_a_graph_route_example.cpp
==============================================================================
--- trunk/libs/geometry/example/07_a_graph_route_example.cpp Sat Aug 10 17:30:57 2013 (r85290)
+++ trunk/libs/geometry/example/07_a_graph_route_example.cpp 2013-08-10 17:39:45 EDT (Sat, 10 Aug 2013) (r85291)
@@ -306,7 +306,7 @@
         << std::fixed << std::setprecision(0);
         
     // To calculate distance, declare and construct a strategy with average earth radius
- boost::geometry::strategy::distance::haversine<point_type> haversine(6372795.0);
+ boost::geometry::strategy::distance::haversine<double> haversine(6372795.0);
 
     // Main functionality: calculate shortest routes from/to all cities
     

Modified: trunk/libs/geometry/example/07_b_graph_route_example.cpp
==============================================================================
--- trunk/libs/geometry/example/07_b_graph_route_example.cpp Sat Aug 10 17:30:57 2013 (r85290)
+++ trunk/libs/geometry/example/07_b_graph_route_example.cpp 2013-08-10 17:39:45 EDT (Sat, 10 Aug 2013) (r85291)
@@ -293,7 +293,7 @@
         << std::fixed << std::setprecision(0);
 
     // To calculate distance, declare and construct a strategy with average earth radius
- boost::geometry::strategy::distance::haversine<point_type> haversine(6372795.0);
+ boost::geometry::strategy::distance::haversine<double> haversine(6372795.0);
         
     // Main functionality: calculate shortest routes from/to all cities
 

Modified: trunk/libs/geometry/example/c11_custom_cs_transform_example.cpp
==============================================================================
--- trunk/libs/geometry/example/c11_custom_cs_transform_example.cpp Sat Aug 10 17:30:57 2013 (r85290)
+++ trunk/libs/geometry/example/c11_custom_cs_transform_example.cpp 2013-08-10 17:39:45 EDT (Sat, 10 Aug 2013) (r85291)
@@ -59,9 +59,9 @@
 
 
 // 5: implement a distance strategy between the two different ones
-template <typename P1, typename P2>
 struct shift_and_calc_distance
 {
+ template <typename P1, typename P2>
     inline double apply(P1 const& p1, P2 const& p2) const
     {
         P2 p1_shifted;
@@ -77,14 +77,14 @@
 // 7: register the distance strategy
 namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services
 {
- template <typename Point1, typename Point2>
- struct tag<shift_and_calc_distance<Point1, Point2> >
+ template <>
+ struct tag<shift_and_calc_distance>
     {
         typedef strategy_tag_distance_point_point type;
     };
     
- template <typename Point1, typename Point2>
- struct return_type<shift_and_calc_distance<Point1, Point2> >
+ template <typename P1, typename P2>
+ struct return_type<shift_and_calc_distance, P1, P2>
     {
         typedef double type;
     };
@@ -92,7 +92,7 @@
     template <>
     struct default_strategy<point_tag, point1, point2, cartesian_tag, cartesian_tag>
     {
- typedef shift_and_calc_distance<point1, point2> type;
+ typedef shift_and_calc_distance type;
     };
 
 


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