Returns the first non-hidden EDGEPT that has a different src_outline to its predecessor, or, if all the same, the lowest indexed point.
| 297 | // Returns the first non-hidden EDGEPT that has a different src_outline to |
| 298 | // its predecessor, or, if all the same, the lowest indexed point. |
| 299 | EDGEPT* TESSLINE::FindBestStartPt() const { |
| 300 | EDGEPT* best_start = loop; |
| 301 | int best_step = loop->start_step; |
| 302 | // Iterate the polygon. |
| 303 | EDGEPT* pt = loop; |
| 304 | do { |
| 305 | if (pt->IsHidden()) continue; |
| 306 | if (pt->prev->IsHidden() || pt->prev->src_outline != pt->src_outline) |
| 307 | return pt; // Qualifies as the best. |
| 308 | if (pt->start_step < best_step) { |
| 309 | best_step = pt->start_step; |
| 310 | best_start = pt; |
| 311 | } |
| 312 | } while ((pt = pt->next) != loop); |
| 313 | return best_start; |
| 314 | } |
| 315 | |
| 316 | // Iterate the given list of outlines, converting to TESSLINE by polygonal |
| 317 | // approximation and recursively any children, returning the current tail |
no test coverage detected