|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55898 - sandbox/gtl/boost/polygon
From: lucanus.j.simonson_at_[hidden]
Date: 2009-08-30 21:28:34
Author: ljsimons
Date: 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
New Revision: 55898
URL: http://svn.boost.org/trac/boost/changeset/55898
Log:
some fixes for issues found during review
Text files modified:
sandbox/gtl/boost/polygon/interval_concept.hpp | 4 +-
sandbox/gtl/boost/polygon/isotropy.hpp | 43 ++++++++++++++++-----------------------
sandbox/gtl/boost/polygon/point_3d_concept.hpp | 22 ++++++++++----------
sandbox/gtl/boost/polygon/point_3d_traits.hpp | 3 ++
sandbox/gtl/boost/polygon/point_traits.hpp | 2 +
sandbox/gtl/boost/polygon/polygon.hpp | 13 ------------
6 files changed, 36 insertions(+), 51 deletions(-)
Modified: sandbox/gtl/boost/polygon/interval_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/interval_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/interval_concept.hpp 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
@@ -187,8 +187,8 @@
flip(interval_type& interval,
typename interval_traits<interval_type>::coordinate_type axis = 0) {
typename interval_traits<interval_type>::coordinate_type newLow, newHigh;
- newLow = axis - high(interval);
- newHigh = axis - low(interval);
+ newLow = 2 * axis - high(interval);
+ newHigh = 2 * axis - low(interval);
low(interval, newLow);
high(interval, newHigh);
return interval;
Modified: sandbox/gtl/boost/polygon/isotropy.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/isotropy.hpp (original)
+++ sandbox/gtl/boost/polygon/isotropy.hpp 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
@@ -9,6 +9,21 @@
#ifndef BOOST_POLYGON_ISOTROPY_HPP
#define BOOST_POLYGON_ISOTROPY_HPP
+//external
+#include <cmath>
+#include <cstddef>
+#include <cstdlib>
+#include <vector>
+#include <deque>
+#include <map>
+#include <set>
+#include <list>
+//#include <iostream>
+#include <algorithm>
+#include <limits>
+#include <iterator>
+#include <string>
+
#ifndef BOOST_POLYGON_NO_DEPS
#include <boost/config.hpp>
@@ -180,7 +195,7 @@
struct scaling_policy {
template <typename T2>
static inline T round(T2 t2) {
- return (T)floor(t2+0.5);
+ return (T)std::floor(t2+0.5);
}
static inline T round(T t2) {
@@ -201,13 +216,6 @@
template <>
struct geometry_concept<double> { typedef coordinate_concept type; };
- template <typename T1, typename T2, typename T3>
- struct requires { };
-
- template <typename T1, typename T3>
- struct requires<T1, T1, T3> {
- typedef T3 type;
- };
#ifndef BOOST_POLYGON_NO_DEPS
struct gtl_no : mpl::bool_<false> {};
struct gtl_yes : mpl::bool_<true> {};
@@ -277,21 +285,6 @@
template <typename T, typename T2>
struct gtl_different_type { typedef typename gtl_not<typename gtl_same_type<T, T2>::type>::type type; };
- template <typename T1, typename T2>
- struct requires_type { typedef T2 type; };
-
- template <typename T, typename T2>
- struct is_same_type_SFINAE {};
- template <typename T>
- struct is_same_type_SFINAE<T, T> { typedef void type; };
-
- template <typename T, typename T2>
- struct is_different_type_SFINAE { typedef void type; };
- template <typename T>
- struct is_different_type_SFINAE<T, T> {};
-
-
-
struct manhattan_domain {};
struct forty_five_domain {};
struct general_domain {};
@@ -321,7 +314,7 @@
// predicated_swap swaps a and b if pred is true
- // predicated_swap is garenteed to behave the same as
+ // predicated_swap is guarenteed to behave the same as
// if(pred){
// T tmp = a;
// a = b;
@@ -521,7 +514,7 @@
return direction_2d(direction_2d_enum(val_ ^ 1));
}
- // N, E are positive, S, W are negative
+ // N, E, U are positive, S, W, D are negative
inline bool is_positive() const {return (val_ & 1);}
inline bool is_negative() const {return !is_positive();}
inline int get_sign() const {return ((is_positive()) << 1) -1;}
Modified: sandbox/gtl/boost/polygon/point_3d_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_3d_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/point_3d_concept.hpp 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
@@ -135,17 +135,6 @@
return x(point1) == x(point2) && y(point1) == y(point2) && z(point1) == z(point2);
}
- struct y_p3d_man_dist : gtl_yes {};
-
- template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and_3<y_p3d_man_dist, typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
- typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
- typename point_3d_difference_type<point_type_1>::type>::type
- manhattan_distance(const point_type_1& point1, const point_type_2& point2) {
- return euclidean_distance(point1, point2, HORIZONTAL) + euclidean_distance(point1, point2, VERTICAL)
- + euclidean_distance(point1, point2, PROXIMAL);
- }
-
struct y_p3d_dist : gtl_yes {};
template <typename point_type_1, typename point_type_2>
@@ -159,6 +148,17 @@
return return_value < 0 ? -return_value : return_value;
}
+ struct y_p3d_man_dist : gtl_yes {};
+
+ template <typename point_type_1, typename point_type_2>
+ typename enable_if< typename gtl_and_3<y_p3d_man_dist, typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
+ typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
+ typename point_3d_difference_type<point_type_1>::type>::type
+ manhattan_distance(const point_type_1& point1, const point_type_2& point2) {
+ return euclidean_distance(point1, point2, HORIZONTAL) + euclidean_distance(point1, point2, VERTICAL)
+ + euclidean_distance(point1, point2, PROXIMAL);
+ }
+
struct y_p3d_dist2 : gtl_yes {};
template <typename point_type_1, typename point_type_2>
Modified: sandbox/gtl/boost/polygon/point_3d_traits.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_3d_traits.hpp (original)
+++ sandbox/gtl/boost/polygon/point_3d_traits.hpp 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
@@ -7,6 +7,9 @@
*/
#ifndef BOOST_POLYGON_POINT_3D_TRAITS_HPP
#define BOOST_POLYGON_POINT_3D_TRAITS_HPP
+
+#include "isotropy.hpp"
+
namespace boost { namespace polygon{
template <typename T>
struct point_3d_traits {
Modified: sandbox/gtl/boost/polygon/point_traits.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_traits.hpp (original)
+++ sandbox/gtl/boost/polygon/point_traits.hpp 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
@@ -8,6 +8,8 @@
#ifndef BOOST_POLYGON_POINT_TRAITS_HPP
#define BOOST_POLYGON_POINT_TRAITS_HPP
+#include "isotropy.hpp"
+
namespace boost { namespace polygon{
template <typename T>
struct point_traits {
Modified: sandbox/gtl/boost/polygon/polygon.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon.hpp 2009-08-30 21:28:31 EDT (Sun, 30 Aug 2009)
@@ -8,19 +8,6 @@
#ifndef BOOST_POLYGON_POLYGON_HPP
#define BOOST_POLYGON_POLYGON_HPP
-//external
-#include <cmath>
-#include <vector>
-#include <deque>
-#include <map>
-#include <set>
-#include <list>
-//#include <iostream>
-#include <algorithm>
-#include <limits>
-#include <iterator>
-#include <string>
-
#include "isotropy.hpp"
//point
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