|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58795 - in sandbox/gtl/boost/polygon: . detail
From: lucanus.j.simonson_at_[hidden]
Date: 2010-01-07 20:13:24
Author: ljsimons
Date: 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
New Revision: 58795
URL: http://svn.boost.org/trac/boost/changeset/58795
Log:
further speedups for arbitrary angle algorithms
Text files modified:
sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp | 2
sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp | 185 ++++++++++++++++++++++++++++++++++++++-
sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp | 60 +++++++-----
sandbox/gtl/boost/polygon/point_concept.hpp | 6
sandbox/gtl/boost/polygon/polygon_45_set_data.hpp | 4
sandbox/gtl/boost/polygon/polygon_traits.hpp | 2
6 files changed, 223 insertions(+), 36 deletions(-)
Modified: sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
@@ -806,7 +806,7 @@
LongUnit delta = y1;
delta -= y2;
Unit UnitMax = (std::numeric_limits<Unit>::max)();
- if(delta & 1) {
+ if((delta & 1) == 1) {
//delta is odd, division by 2 will result in integer trunctaion
if(delta == 1) {
//the cross point is not on the integer grid and cannot be represented
Modified: sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
@@ -127,7 +127,6 @@
}
//return -1 below, 0 on and 1 above line
- //assumes point is on x interval of segment
static inline int on_above_or_below(Point pt, const half_edge& he) {
if(pt == he.first || pt == he.second) return 0;
if(equal_slope(pt.get(HORIZONTAL), pt.get(VERTICAL), he.first, he.second)) return 0;
@@ -182,6 +181,8 @@
//y = (xIn - pt.x)*(other_pt.y-pt.y)/(other_pt.x-pt.x) + pt.y
//assert pt.x != other_pt.x
typedef typename high_precision_type<Unit>::type high_precision;
+ if(pt.y() == other_pt.y())
+ return (high_precision)pt.y();
evalAtXforYxIn = (high_precision)xIn;
evalAtXforYx1 = pt.get(HORIZONTAL);
evalAtXforYy1 = pt.get(VERTICAL);
@@ -206,6 +207,10 @@
//y = (xIn - pt.x)*(other_pt.y-pt.y)/(other_pt.x-pt.x) + pt.y
//assert pt.x != other_pt.x
typedef typename high_precision_type<Unit>::type high_precision;
+ if(pt.y() == other_pt.y()) {
+ evalAtXforYret = (high_precision)pt.y();
+ return evalAtXforYret;
+ }
evalAtXforYxIn = (high_precision)xIn;
evalAtXforYx1 = pt.get(HORIZONTAL);
evalAtXforYy1 = pt.get(VERTICAL);
@@ -255,6 +260,55 @@
return true;
if(std::min(elm1.first.y(), elm1.second.y()) > std::max(elm2.first.y(), elm2.second.y()))
return false;
+
+ //check if either x of elem1 is equal to x_
+ Unit localx = *x_;
+ Unit elm1y = 0;
+ bool elm1_at_x = false;
+ if(localx == elm1.first.get(HORIZONTAL)) {
+ elm1_at_x = true;
+ elm1y = elm1.first.get(VERTICAL);
+ } else if(localx == elm1.second.get(HORIZONTAL)) {
+ elm1_at_x = true;
+ elm1y = elm1.second.get(VERTICAL);
+ }
+ Unit elm2y = 0;
+ bool elm2_at_x = false;
+ if(localx == elm2.first.get(HORIZONTAL)) {
+ elm2_at_x = true;
+ elm2y = elm2.first.get(VERTICAL);
+ } else if(localx == elm2.second.get(HORIZONTAL)) {
+ elm2_at_x = true;
+ elm2y = elm1.second.get(VERTICAL);
+ }
+ bool retval = false;
+ if(!(elm1_at_x && elm2_at_x)) {
+ //at least one of the segments doesn't have an end point a the current x
+ //-1 below, 1 above
+ int pt1_oab = on_above_or_below(elm1.first, half_edge(elm2.first, elm2.second));
+ int pt2_oab = on_above_or_below(elm1.second, half_edge(elm2.first, elm2.second));
+ if(pt1_oab == pt2_oab) {
+ if(pt1_oab == -1)
+ retval = true; //pt1 is below elm2 so elm1 is below elm2
+ } else {
+ //the segments can't cross so elm2 is on whatever side of elm1 that one of its ends is
+ int pt3_oab = on_above_or_below(elm2.first, half_edge(elm1.first, elm1.second));
+ if(pt3_oab == 1)
+ retval = true; //elm1's point is above elm1
+ }
+ } else {
+ if(elm1y < elm2y) {
+ retval = true;
+ } else if(elm1y == elm2y) {
+ retval = less_slope(elm1.second.get(HORIZONTAL) - elm1.first.get(HORIZONTAL),
+ elm1.second.get(VERTICAL) - elm1.first.get(VERTICAL),
+ elm2.second.get(HORIZONTAL) - elm2.first.get(HORIZONTAL),
+ elm2.second.get(VERTICAL) - elm2.first.get(VERTICAL));
+ retval = ((*justBefore_) != 0) ^ retval;
+ }
+ }
+ return retval;
+
typedef typename high_precision_type<Unit>::type high_precision;
high_precision y1 = pack_->evalAtXforY(*x_, elm1.first, elm1.second);
high_precision y2 = pack_->evalAtXforY(*x_, elm2.first, elm2.second);
@@ -644,18 +698,131 @@
inline less_vertex_half_edge(Unit *x, int *justBefore) : x_(x), justBefore_(justBefore) {}
inline less_vertex_half_edge(const less_vertex_half_edge& that) : x_(that.x_), justBefore_(that.justBefore_) {}
inline less_vertex_half_edge& operator=(const less_vertex_half_edge& that) { x_ = that.x_; justBefore_ = that.justBefore_; return *this; }
+ inline bool check(const vertex_half_edge& elm1, const vertex_half_edge& elm2) const {
+ Unit localx = *x_;
+ Unit elm1y = 0;
+ bool elm1_at_x = false;
+ if(localx == elm1.pt.get(HORIZONTAL)) {
+ elm1_at_x = true;
+ elm1y = elm1.pt.get(VERTICAL);
+ } else if(localx == elm1.other_pt.get(HORIZONTAL)) {
+ elm1_at_x = true;
+ elm1y = elm1.other_pt.get(VERTICAL);
+ }
+ Unit elm2y = 0;
+ bool elm2_at_x = false;
+ if(localx == elm2.pt.get(HORIZONTAL)) {
+ elm2_at_x = true;
+ elm2y = elm2.pt.get(VERTICAL);
+ } else if(localx == elm2.other_pt.get(HORIZONTAL)) {
+ elm2_at_x = true;
+ elm2y = elm1.other_pt.get(VERTICAL);
+ }
+ bool retval = false;
+ if(!(elm1_at_x && elm2_at_x)) {
+ //at least one of the segments doesn't have an end point a the current x
+ //-1 below, 1 above
+ int pt1_oab = on_above_or_below(elm1.pt, half_edge(elm2.pt, elm2.other_pt));
+ int pt2_oab = on_above_or_below(elm1.other_pt, half_edge(elm2.pt, elm2.other_pt));
+ if(pt1_oab == pt2_oab) {
+ if(pt1_oab == -1)
+ retval = true; //pt1 is below elm2 so elm1 is below elm2
+ } else {
+ //the segments can't cross so elm2 is on whatever side of elm1 that one of its ends is
+ int pt3_oab = on_above_or_below(elm2.pt, half_edge(elm1.pt, elm1.other_pt));
+ if(pt2_oab == 1)
+ retval = true; //elm1's point is above elm1
+ }
+ } else {
+ if(elm1y < elm2y) {
+ retval = true;
+ } else if(elm1y == elm2y) {
+ retval = less_slope(elm1.other_pt.get(HORIZONTAL) - elm1.pt.get(HORIZONTAL),
+ elm1.other_pt.get(VERTICAL) - elm1.pt.get(VERTICAL),
+ elm2.other_pt.get(HORIZONTAL) - elm2.pt.get(HORIZONTAL),
+ elm2.other_pt.get(VERTICAL) - elm2.pt.get(VERTICAL));
+ retval = ((*justBefore_) != 0) ^ retval;
+ }
+ }
+ return retval;
+ }
inline bool operator () (const vertex_half_edge& elm1, const vertex_half_edge& elm2) const {
+ if(std::max(elm1.pt.y(), elm1.other_pt.y()) < std::min(elm2.pt.y(), elm2.other_pt.y()))
+ return true;
+ if(std::min(elm1.pt.y(), elm1.other_pt.y()) > std::max(elm2.pt.y(), elm2.other_pt.y()))
+ return false;
+ //check if either x of elem1 is equal to x_
+ Unit localx = *x_;
+ Unit elm1y = 0;
+ bool elm1_at_x = false;
+ if(localx == elm1.pt.get(HORIZONTAL)) {
+ elm1_at_x = true;
+ elm1y = elm1.pt.get(VERTICAL);
+ } else if(localx == elm1.other_pt.get(HORIZONTAL)) {
+ elm1_at_x = true;
+ elm1y = elm1.other_pt.get(VERTICAL);
+ }
+ Unit elm2y = 0;
+ bool elm2_at_x = false;
+ if(localx == elm2.pt.get(HORIZONTAL)) {
+ elm2_at_x = true;
+ elm2y = elm2.pt.get(VERTICAL);
+ } else if(localx == elm2.other_pt.get(HORIZONTAL)) {
+ elm2_at_x = true;
+ elm2y = elm1.other_pt.get(VERTICAL);
+ }
+ bool retval = false;
+ if(!(elm1_at_x && elm2_at_x)) {
+ //at least one of the segments doesn't have an end point a the current x
+ //-1 below, 1 above
+ int pt1_oab = on_above_or_below(elm1.pt, half_edge(elm2.pt, elm2.other_pt));
+ int pt2_oab = on_above_or_below(elm1.other_pt, half_edge(elm2.pt, elm2.other_pt));
+ if(pt1_oab == pt2_oab) {
+ if(pt1_oab == -1)
+ retval = true; //pt1 is below elm2 so elm1 is below elm2
+ } else {
+ //the segments can't cross so elm2 is on whatever side of elm1 that one of its ends is
+ int pt3_oab = on_above_or_below(elm2.pt, half_edge(elm1.pt, elm1.other_pt));
+ if(pt3_oab == 1)
+ retval = true; //elm1's point is above elm1
+ }
+ } else {
+ if(elm1y < elm2y) {
+ retval = true;
+ } else if(elm1y == elm2y) {
+ retval = less_slope(elm1.other_pt.get(HORIZONTAL) - elm1.pt.get(HORIZONTAL),
+ elm1.other_pt.get(VERTICAL) - elm1.pt.get(VERTICAL),
+ elm2.other_pt.get(HORIZONTAL) - elm2.pt.get(HORIZONTAL),
+ elm2.other_pt.get(VERTICAL) - elm2.pt.get(VERTICAL));
+ retval = ((*justBefore_) != 0) ^ retval;
+ }
+ }
+ return retval;
typedef typename high_precision_type<Unit>::type high_precision;
high_precision y1 = elm1.evalAtX(*x_);
high_precision y2 = elm2.evalAtX(*x_);
- if(y1 < y2) return true;
+ if(y1 < y2) {
+ if(retval != true) {
+ check(elm1, elm2);
+ std::cout << "retval != true!\n";
+ }
+ return true;
+ }
if(y1 == y2) {
//if justBefore is true we invert the result of the comparison of slopes
bool result = less_slope(elm1.other_pt.get(HORIZONTAL) - elm1.pt.get(HORIZONTAL),
elm1.other_pt.get(VERTICAL) - elm1.pt.get(VERTICAL),
elm2.other_pt.get(HORIZONTAL) - elm2.pt.get(HORIZONTAL),
elm2.other_pt.get(VERTICAL) - elm2.pt.get(VERTICAL));
- return ((*justBefore_) != 0) ^ result;
+ result = ((*justBefore_) != 0) ^ result;
+ if(retval != result) {
+ std::cout << "retval != result!\n";
+ }
+ return result;
+ }
+ if(retval != false) {
+ check(elm1, elm2);
+ std::cout << "retval != false!\n";
}
return false;
}
@@ -1499,7 +1666,9 @@
//if(iter != scanData_.end())
// std::cout << "first iter y is " << iter->first.evalAtX(x_) << std::endl;
while(iter != scanData_.end() &&
- iter->first.evalAtX(x_) == (high_precision)currentY) {
+ ((iter->first.pt.x() == x_ && iter->first.pt.y() == currentY) ||
+ (iter->first.other_pt.x() == x_ && iter->first.other_pt.y() == currentY))) {
+ //iter->first.evalAtX(x_) == (high_precision)currentY) {
//std::cout << "loop2\n";
elementIters.push_back(iter);
counts_from_scanline.push_back(std::pair<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*>
@@ -1567,7 +1736,9 @@
//std::cout << "checking whether ot handle hole\n";
if(currentIter == inputEnd ||
currentIter->pt.get(HORIZONTAL) != x_ ||
- (high_precision)(currentIter->pt.get(VERTICAL)) >= iter->first.evalAtX(x_)) {
+ on_above_or_below(currentIter->pt, half_edge(iter->first.pt, iter->first.other_pt)) == 1) {
+ //(high_precision)(currentIter->pt.get(VERTICAL)) >= iter->first.evalAtX(x_)) {
+
//std::cout << "handle hole here\n";
if(fractureHoles_) {
//std::cout << "fracture hole here\n";
@@ -2480,7 +2651,9 @@
previter != polygon_arbitrary_formation<Unit>::scanData_.begin())
--previter;
while(iter != polygon_arbitrary_formation<Unit>::scanData_.end() &&
- iter->first.evalAtX(polygon_arbitrary_formation<Unit>::x_) == (high_precision)currentY) {
+ ((iter->first.pt.x() == polygon_arbitrary_formation<Unit>::x_ && iter->first.pt.y() == currentY) ||
+ (iter->first.other_pt.x() == polygon_arbitrary_formation<Unit>::x_ && iter->first.other_pt.y() == currentY))) {
+ //iter->first.evalAtX(polygon_arbitrary_formation<Unit>::x_) == (high_precision)currentY) {
//std::cout << "loop2\n";
elementIters.push_back(iter);
counts_from_scanline.push_back(std::pair<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*>
Modified: sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
@@ -136,15 +136,19 @@
}
validate_scan(intersection_points, bins[histogram.front().first].begin(), bins[histogram.front().first].end());
for(typename std::vector<Unit>::iterator itr = y_cuts.begin(); itr != y_cuts.end(); ++itr) {
- validate_scan(intersection_points, bins[*itr].begin(), bins[*itr].end());
+ validate_scan(intersection_points, bins[*itr].begin(), bins[*itr].end(), *itr);
}
}
- //quadratic algorithm to do same work as optimal scan for cross checking
- //assume sorted input
template <typename iT>
static inline void validate_scan(std::vector<std::set<Point> >& intersection_points,
iT begin, iT end) {
+ validate_scan(intersection_points, begin, end, (std::numeric_limits<Unit>::min)());
+ }
+ //quadratic algorithm to do same work as optimal scan for cross checking
+ template <typename iT>
+ static inline void validate_scan(std::vector<std::set<Point> >& intersection_points,
+ iT begin, iT end, Unit min_y) {
std::set<Point> pts;
std::vector<std::pair<half_edge, segment_id> > data(begin, end);
for(std::size_t i = 0; i < data.size(); ++i) {
@@ -161,20 +165,24 @@
//its own end points
pts.insert(he1.first);
pts.insert(he1.second);
+ bool have_first_y = he1.first.y() >= min_y && he1.second.y() >= min_y;
for(typename std::vector<std::pair<half_edge, segment_id> >::iterator inner = outer;
inner != data.end(); ++inner) {
const half_edge& he2 = (*inner).first;
- if(he1 == he2) continue;
- if((std::min)(he2. first.get(HORIZONTAL),
- he2.second.get(HORIZONTAL)) >
- (std::max)(he1.second.get(HORIZONTAL),
- he1.first.get(HORIZONTAL)))
- break;
- Point intersection;
- if(pack_.compute_intersection(intersection, he1, he2)) {
- //their intersection point
- pts.insert(intersection);
- }
+ if(have_first_y || he2.first.y() >= min_y && he2.second.y() >= min_y) {
+ //at least one segment has a low y value within the range
+ if(he1 == he2) continue;
+ if(he2.first.get(HORIZONTAL) >=
+ he1.second.get(HORIZONTAL))
+ break;
+ if(he1.first == he2.first || he1.second == he2.second)
+ break;
+ Point intersection;
+ if(pack_.compute_intersection(intersection, he1, he2)) {
+ //their intersection point
+ pts.insert(intersection);
+ }
+ }
}
}
//find all segments that interact with intersection points
@@ -993,23 +1001,24 @@
//current_iter should increase monotonically toward end as we process scanline stop
iterator current_iter = scan_data_.begin();
just_before_ = true;
- high_precision y = (high_precision)((std::numeric_limits<Unit>::min)());
+ Unit y = (std::numeric_limits<Unit>::min)();
bool first_iteration = true;
//we want to return from inside the loop when we hit end or new x
#ifdef BOOST_POLYGON_MSVC
#pragma warning( disable: 4127 )
#endif
while(true) {
- if(begin == end || (!first_iteration && ((high_precision)((*begin).first.first.get(VERTICAL)) != y ||
- (*begin).first.first.get(HORIZONTAL) != x_))) {
+ if(begin == end || (!first_iteration && ((*begin).first.first.get(VERTICAL) != y ||
+ (*begin).first.first.get(HORIZONTAL) != x_))) {
//lookup iterator range in scanline for elements coming in from the left
//that end at this y
- Point pt(x_, convert_high_precision_type<Unit>(y));
+ Point pt(x_, y);
//grab the properties coming in from below
property_map properties_below;
if(current_iter != scan_data_.end()) {
//make sure we are looking at element in scanline just below y
- if(evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) != y) {
+ //if(evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) != y) {
+ if(on_above_or_below(Point(x_, y), (*current_iter).first) != 0) {
Point e2(pt);
if(e2.get(VERTICAL) != (std::numeric_limits<Unit>::max)())
e2.set(VERTICAL, e2.get(VERTICAL) + 1);
@@ -1020,11 +1029,13 @@
}
if(current_iter != scan_data_.end()) {
//get the bottom iterator for elements at this point
- while(evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) >= y &&
+ //while(evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) >= (high_precision)y &&
+ while(on_above_or_below(Point(x_, y), (*current_iter).first) != 1 &&
current_iter != scan_data_.begin()) {
--current_iter;
}
- if(evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) >= y) {
+ //if(evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) >= (high_precision)y) {
+ if(on_above_or_below(Point(x_, y), (*current_iter).first) != 1) {
properties_below.clear();
} else {
properties_below = (*current_iter).second;
@@ -1035,6 +1046,7 @@
}
std::vector<iterator> edges_from_left;
while(current_iter != scan_data_.end() &&
+ //can only be true if y is integer
evalAtXforY(x_, (*current_iter).first.first, (*current_iter).first.second) == y) {
//removal_set_.push_back(current_iter);
++current_iter;
@@ -1063,7 +1075,7 @@
if(vertical_properties_above.empty()) {
return begin;
} else {
- y = (high_precision)(vertical_edge_above.second.get(VERTICAL));
+ y = vertical_edge_above.second.get(VERTICAL);
vertical_properties_below.clear();
vertical_properties_above.swap(vertical_properties_below);
vertical_edge_below = vertical_edge_above;
@@ -1079,11 +1091,11 @@
if(begin != end) {
const vertex_property& vp = *begin;
const half_edge& he = vp.first;
- y = (high_precision)(he.first.get(VERTICAL));
+ y = he.first.get(VERTICAL);
first_iteration = false;
if(! vertical_properties_below.empty() &&
vertical_edge_below.second.get(VERTICAL) < y) {
- y = (high_precision)(vertical_edge_below.second.get(VERTICAL));
+ y = vertical_edge_below.second.get(VERTICAL);
continue;
}
if(is_vertical(he)) {
Modified: sandbox/gtl/boost/polygon/point_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/point_concept.hpp 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
@@ -163,7 +163,7 @@
euclidean_distance(const point_type_1& point1, const point_type_2& point2, orientation_2d orient) {
typename coordinate_traits<typename point_traits<point_type_1>::coordinate_type>::coordinate_difference return_value =
get(point1, orient) - get(point2, orient);
- return return_value < 0 ? -return_value : return_value;
+ return return_value < 0 ? (typename coordinate_traits<typename point_traits<point_type_1>::coordinate_type>::coordinate_difference)-return_value : return_value;
}
struct y_i_ed2 : gtl_yes {};
@@ -231,8 +231,8 @@
) {
typedef typename point_traits<point_type>::coordinate_type Unit;
typedef typename coordinate_traits<Unit>::coordinate_distance dt;
- x(point, scaling_policy<Unit>::round((dt)(x(point)) / (dt)factor));
- y(point, scaling_policy<Unit>::round((dt)(y(point)) / (dt)factor));
+ x(point, scaling_policy<Unit>::round((dt)((dt)(x(point)) / (dt)factor)));
+ y(point, scaling_policy<Unit>::round((dt)((dt)(y(point)) / (dt)factor)));
return point;
}
Modified: sandbox/gtl/boost/polygon/polygon_45_set_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_45_set_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_45_set_data.hpp 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
@@ -1453,6 +1453,8 @@
template <typename cT, typename iT>
void get_error_rects_shell(cT& posE, cT& negE, iT beginr, iT endr) {
typedef typename iT::value_type Point;
+ typedef typename point_traits<Point>::coordinate_type Unit;
+ typedef typename coordinate_traits<Unit>::area_type area_type;
Point pt1, pt2, pt3;
bool i1 = true;
bool i2 = true;
@@ -1497,7 +1499,7 @@
if(local_abs(x(pt2)) % 2) { //y % 2 should also be odd
//is corner concave or convex?
Point pts[] = {pt1, pt2, pt3};
- double ar = point_sequence_area<Point*, double>(pts, pts+3);
+ area_type ar = point_sequence_area<Point*, area_type>(pts, pts+3);
direction_1d dir = ar < 0 ? COUNTERCLOCKWISE : CLOCKWISE;
//std::cout << pt1 << " " << pt2 << " " << pt3 << " " << ar << std::endl;
if(dir == CLOCKWISE) {
Modified: sandbox/gtl/boost/polygon/polygon_traits.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_traits.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_traits.hpp 2010-01-07 20:13:23 EST (Thu, 07 Jan 2010)
@@ -708,7 +708,7 @@
}
template <typename Unit>
- Unit local_abs(Unit value) { return value < 0 ? -value : value; }
+ Unit local_abs(Unit value) { return value < 0 ? (Unit)-value : value; }
template <typename Unit>
void snap_point_vector_to_45(std::vector<point_data<Unit> >& pts) {
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