Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/polygon/polygon_set_data.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
195 unsorted_ = true; | 195 unsorted_ = true; |
196 } | 196 } |
197 | 197 |
198 template <class iT> | 198 template <class iT> |
199 inline void insert_vertex_sequence(iT begin_vertex, iT end_vertex, direction_1d winding, bool is_hole) { | 199 inline void insert_vertex_sequence(iT begin_vertex, iT end_vertex, direction_1d winding, bool is_hole) { |
200 bool first_iteration = true; | 200 if (begin_vertex == end_vertex) { |
201 point_type first_point; | 201 // No edges to insert. |
202 point_type previous_point; | 202 return; |
203 point_type current_point; | 203 } |
204 direction_1d winding_dir = winding; | 204 // Current edge endpoints. |
205 int multiplier = winding_dir == COUNTERCLOCKWISE ? 1 : -1; | 205 iT vertex0 = begin_vertex; |
206 if(is_hole) multiplier *= -1; | 206 iT vertex1 = begin_vertex; |
207 for( ; begin_vertex != end_vertex; ++begin_vertex) { | 207 if (++vertex1 == end_vertex) { |
208 assign(current_point, *begin_vertex); | 208 // No edges to insert. |
209 if(first_iteration) { | 209 return; |
210 first_iteration = false; | 210 } |
211 first_point = previous_point = current_point; | 211 int wmultiplier = (winding == COUNTERCLOCKWISE) ? 1 : -1; |
212 } else { | 212 if (is_hole) { |
213 if(previous_point != current_point) { | 213 wmultiplier = -wmultiplier; |
214 element_type elem(edge_type(previous_point, current_point), | 214 } |
215 ( previous_point.get(HORIZONTAL) == current_point.get(HORIZONTAL) ? -1 : 1) * multiplier); | 215 dirty_ = true; |
216 insert_clean(elem); | 216 unsorted_ = true; |
217 } | 217 while (vertex0 != end_vertex) { |
218 } | 218 point_type p0, p1; |
219 previous_point = current_point; | 219 assign(p0, *vertex0); |
220 } | 220 assign(p1, *vertex1); |
221 current_point = first_point; | 221 if (p0 != p1) { |
222 if(!first_iteration) { | 222 int hmultiplier = (p0.get(HORIZONTAL) == p1.get(HORIZONTAL)) ? -1 : 1; |
223 if(previous_point != current_point) { | 223 element_type elem(edge_type(p0, p1), hmultiplier * wmultiplier); |
224 element_type elem(edge_type(previous_point, current_point), | |
225 ( previous_point.get(HORIZONTAL) == current_point.get(HORIZONTAL) ? -1 : 1) * multiplier); | |
226 insert_clean(elem); | 224 insert_clean(elem); |
227 } | 225 } |
228 dirty_ = true; | 226 ++vertex0; |
229 unsorted_ = true; | 227 ++vertex1; |
228 if (vertex1 == end_vertex) { | |
229 vertex1 = begin_vertex; | |
230 } | |
230 } | 231 } |
231 } | 232 } |
232 | 233 |
233 template <typename output_container> | 234 template <typename output_container> |
234 inline void get(output_container& output) const { | 235 inline void get(output_container& output) const { |
269 } | 270 } |
270 } | 271 } |
271 | 272 |
272 // equivalence operator | 273 // equivalence operator |
273 inline bool operator==(const polygon_set_data& p) const; | 274 inline bool operator==(const polygon_set_data& p) const; |
274 | 275 |
275 // inequivalence operator | 276 // inequivalence operator |
276 inline bool operator!=(const polygon_set_data& p) const { | 277 inline bool operator!=(const polygon_set_data& p) const { |
277 return !((*this) == p); | 278 return !((*this) == p); |
278 } | 279 } |
279 | 280 |