summaryrefslogtreecommitdiff
path: root/boost/polygon
diff options
context:
space:
mode:
Diffstat (limited to 'boost/polygon')
-rw-r--r--boost/polygon/detail/iterator_compact_to_points.hpp10
-rw-r--r--boost/polygon/detail/max_cover.hpp2
-rw-r--r--boost/polygon/detail/scan_arbitrary.hpp3
-rw-r--r--boost/polygon/point_data.hpp8
-rw-r--r--boost/polygon/polygon_set_data.hpp3
-rw-r--r--boost/polygon/transform.hpp26
-rw-r--r--boost/polygon/voronoi_builder.hpp14
7 files changed, 49 insertions, 17 deletions
diff --git a/boost/polygon/detail/iterator_compact_to_points.hpp b/boost/polygon/detail/iterator_compact_to_points.hpp
index bed03d3..e0f61d3 100644
--- a/boost/polygon/detail/iterator_compact_to_points.hpp
+++ b/boost/polygon/detail/iterator_compact_to_points.hpp
@@ -56,10 +56,16 @@ public:
return tmp;
}
inline bool operator==(const iterator_compact_to_points& that) const {
- return (iter_ == that.iter_);
+ if (iter_ == iter_end_) {
+ return iter_ == that.iter_;
+ }
+ return (iter_ == that.iter_) && (x(pt_) == x(that.pt_));
}
inline bool operator!=(const iterator_compact_to_points& that) const {
- return (iter_ != that.iter_);
+ if (iter_ == iter_end_) {
+ return iter_ != that.iter_;
+ }
+ return (iter_ != that.iter_) || (x(pt_) != x(that.pt_));
}
inline reference operator*() const { return pt_; }
};
diff --git a/boost/polygon/detail/max_cover.hpp b/boost/polygon/detail/max_cover.hpp
index e61725c..2778701 100644
--- a/boost/polygon/detail/max_cover.hpp
+++ b/boost/polygon/detail/max_cover.hpp
@@ -118,7 +118,7 @@ namespace boost { namespace polygon{
//std::cout << "write out " << nextRect << std::endl;
outputContainer.push_back(copy_construct<typename cT::value_type, Rectangle>(nextRect2));
} else {
- //std::cout << "supress " << nextRect << std::endl;
+ //std::cout << "suppress " << nextRect << std::endl;
}
}
if(itr != node->end() && iresult && tresult) {
diff --git a/boost/polygon/detail/scan_arbitrary.hpp b/boost/polygon/detail/scan_arbitrary.hpp
index 8715225..cee2331 100644
--- a/boost/polygon/detail/scan_arbitrary.hpp
+++ b/boost/polygon/detail/scan_arbitrary.hpp
@@ -171,8 +171,9 @@ namespace boost { namespace polygon{
pts.push_back(he1.second);
std::set<Point>& segmentpts = intersection_points[(*outer).second];
for(typename std::set<Point>::iterator itr = segmentpts.begin(); itr != segmentpts.end(); ++itr) {
- if((*itr).y() > min_y - 1)
+ if ((*itr).y() >= min_y) {
pts.push_back(*itr);
+ }
}
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;
diff --git a/boost/polygon/point_data.hpp b/boost/polygon/point_data.hpp
index 23c23ed..8224657 100644
--- a/boost/polygon/point_data.hpp
+++ b/boost/polygon/point_data.hpp
@@ -45,10 +45,18 @@ class point_data {
return *this;
}
+#ifdef __GNUC__
+ // "explicit" to work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63356
+ template <typename PointType>
+ explicit point_data(const PointType& that) {
+ *this = that;
+ }
+#else // __GNUC__
template <typename PointType>
point_data(const PointType& that) {
*this = that;
}
+#endif // __GNUC__
template <typename PointType>
point_data& operator=(const PointType& that) {
diff --git a/boost/polygon/polygon_set_data.hpp b/boost/polygon/polygon_set_data.hpp
index 3c761d3..9c6420d 100644
--- a/boost/polygon/polygon_set_data.hpp
+++ b/boost/polygon/polygon_set_data.hpp
@@ -209,6 +209,9 @@ namespace boost { namespace polygon {
return;
}
int wmultiplier = (winding == COUNTERCLOCKWISE) ? 1 : -1;
+ if (is_hole) {
+ wmultiplier = -wmultiplier;
+ }
dirty_ = true;
unsorted_ = true;
while (vertex0 != end_vertex) {
diff --git a/boost/polygon/transform.hpp b/boost/polygon/transform.hpp
index 2601cff..1bb0cd9 100644
--- a/boost/polygon/transform.hpp
+++ b/boost/polygon/transform.hpp
@@ -42,16 +42,26 @@ namespace polygon {
class axis_transformation {
public:
enum ATR {
+#ifdef BOOST_POLYGON_ENABLE_DEPRECATED
+ EN = 0,
+ WN = 1,
+ ES = 2,
+ WS = 3,
+ NE = 4,
+ SE = 5,
+ NW = 6,
+ SW = 7,
+#endif
NULL_TRANSFORM = 0,
BEGIN_TRANSFORM = 0,
- EN = 0, EAST_NORTH = 0,
- WN = 1, WEST_NORTH = 1, FLIP_X = 1,
- ES = 2, EAST_SOUTH = 2, FLIP_Y = 2,
- WS = 3, WEST_SOUTH = 3, FLIP_XY = 3,
- NE = 4, NORTH_EAST = 4, SWAP_XY = 4,
- SE = 5, SOUTH_EAST = 5, ROTATE_LEFT = 5,
- NW = 6, NORTH_WEST = 6, ROTATE_RIGHT = 6,
- SW = 7, SOUTH_WEST = 7, FLIP_SWAP_XY = 7,
+ EAST_NORTH = 0,
+ WEST_NORTH = 1, FLIP_X = 1,
+ EAST_SOUTH = 2, FLIP_Y = 2,
+ WEST_SOUTH = 3, FLIP_XY = 3,
+ NORTH_EAST = 4, SWAP_XY = 4,
+ SOUTH_EAST = 5, ROTATE_LEFT = 5,
+ NORTH_WEST = 6, ROTATE_RIGHT = 6,
+ SOUTH_WEST = 7, FLIP_SWAP_XY = 7,
END_TRANSFORM = 7
};
diff --git a/boost/polygon/voronoi_builder.hpp b/boost/polygon/voronoi_builder.hpp
index 48a06a3..7da638e 100644
--- a/boost/polygon/voronoi_builder.hpp
+++ b/boost/polygon/voronoi_builder.hpp
@@ -26,14 +26,18 @@ namespace boost {
namespace polygon {
// GENERAL INFO:
// The sweepline algorithm implementation to compute Voronoi diagram of
-// points and non-intersecting segments (except endpoints).
+// points and non-intersecting segments (excluding endpoints).
// Complexity - O(N*logN), memory usage - O(N), where N is the total number
-// of input geometries. Input geometries should have integer coordinate type.
+// of input geometries.
+//
+// CONTRACT:
+// 1) Input geometries should have integral (e.g. int32, int64) coordinate type.
+// 2) Input geometries should not intersect except their endpoints.
//
// IMPLEMENTATION DETAILS:
-// Each input point creates one site event. Each input segment creates three
-// site events: two for its endpoints and one for the segment itself (this is
-// made to simplify output construction). All the site events are constructed
+// Each input point creates one input site. Each input segment creates three
+// input sites: two for its endpoints and one for the segment itself (this is
+// made to simplify output construction). All the site objects are constructed
// and sorted at the algorithm initialization step. Priority queue is used to
// dynamically hold circle events. At each step of the algorithm execution the
// leftmost event is retrieved by comparing the current site event and the