Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73602 - in trunk/boost/geometry: algorithms/detail/overlay strategies/cartesian
From: barend.gehrels_at_[hidden]
Date: 2011-08-07 14:30:54


Author: barendgehrels
Date: 2011-08-07 14:30:52 EDT (Sun, 07 Aug 2011)
New Revision: 73602
URL: http://svn.boost.org/trac/boost/changeset/73602

Log:
Small changes to enable Boost.Rational (part 1)
Text files modified:
   trunk/boost/geometry/algorithms/detail/overlay/assign_parents.hpp | 2 +-
   trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp | 6 +++---
   trunk/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp | 22 ++++++++++++++++------
   trunk/boost/geometry/strategies/cartesian/area_surveyor.hpp | 2 +-
   trunk/boost/geometry/strategies/cartesian/cart_intersect.hpp | 4 ++--
   5 files changed, 23 insertions(+), 13 deletions(-)

Modified: trunk/boost/geometry/algorithms/detail/overlay/assign_parents.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/assign_parents.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/assign_parents.hpp 2011-08-07 14:30:52 EDT (Sun, 07 Aug 2011)
@@ -76,7 +76,7 @@
     {}
 
     inline ring_info_helper(ring_identifier i, area_type a)
- : id(i), real_area(a), abs_area(abs(a))
+ : id(i), real_area(a), abs_area(geometry::math::abs(a))
     {}
 };
 

Modified: trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp 2011-08-07 14:30:52 EDT (Sun, 07 Aug 2011)
@@ -10,7 +10,7 @@
 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CALCULATE_DISTANCE_POLICY_HPP
 
 
-#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/algorithms/comparable_distance.hpp>
 
 
 namespace boost { namespace geometry
@@ -34,9 +34,9 @@
     static inline void apply(Info& info, Point1 const& p1, Point2 const& p2)
     {
         info.operations[0].enriched.distance
- = geometry::distance(info.point, p1);
+ = geometry::comparable_distance(info.point, p1);
         info.operations[1].enriched.distance
- = geometry::distance(info.point, p2);
+ = geometry::comparable_distance(info.point, p2);
     }
 
 };

Modified: trunk/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp 2011-08-07 14:30:52 EDT (Sun, 07 Aug 2011)
@@ -10,7 +10,7 @@
 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP
 
 
-#include <boost/geometry/strategies/default_distance_result.hpp>
+#include <boost/geometry/strategies/distance.hpp>
 
 
 namespace boost { namespace geometry
@@ -23,15 +23,25 @@
 
 
 /*!
- \brief Keeps info to enrich intersection info (per source)
- \details Class to keep information necessary for traversal phase (a phase
- of the overlay process). The information is gathered during the
- enrichment phase
+\brief Keeps info to enrich intersection info (per source)
+\details Class to keep information necessary for traversal phase (a phase
+ of the overlay process). The information is gathered during the
+ enrichment phase
  */
 template<typename P>
 struct enrichment_info
 {
- typedef typename default_distance_result<P, P>::type distance_type;
+ typedef typename strategy::distance::services::return_type
+ <
+ typename strategy::distance::services::comparable_type
+ <
+ typename strategy::distance::services::default_strategy
+ <
+ point_tag,
+ P
+ >::type
+ >::type
+ >::type distance_type;
 
     inline enrichment_info()
         : travels_to_vertex_index(-1)

Modified: trunk/boost/geometry/strategies/cartesian/area_surveyor.hpp
==============================================================================
--- trunk/boost/geometry/strategies/cartesian/area_surveyor.hpp (original)
+++ trunk/boost/geometry/strategies/cartesian/area_surveyor.hpp 2011-08-07 14:30:52 EDT (Sun, 07 Aug 2011)
@@ -82,7 +82,7 @@
         inline return_type area() const
         {
             return_type result = sum;
- result *= 0.5;
+ result /= 2;
             return result;
         }
     };

Modified: trunk/boost/geometry/strategies/cartesian/cart_intersect.hpp
==============================================================================
--- trunk/boost/geometry/strategies/cartesian/cart_intersect.hpp (original)
+++ trunk/boost/geometry/strategies/cartesian/cart_intersect.hpp 2011-08-07 14:30:52 EDT (Sun, 07 Aug 2011)
@@ -376,8 +376,8 @@
                 // In robustness it can occur that a point of A is inside B AND a point of B is inside A,
                 // still while has_common_points is true (so one point equals the other).
                 // If that is the case we select on length.
- coordinate_type const length_a = abs(a_1 - a_2);
- coordinate_type const length_b = abs(b_1 - b_2);
+ coordinate_type const length_a = geometry::math::abs(a_1 - a_2);
+ coordinate_type const length_b = geometry::math::abs(b_1 - b_2);
                 if (length_a > length_b)
                 {
                     a_in_b = false;


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