|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator over the edges (segments) of a polygon. More...
#include <polygon.H>
Public Member Functions | |
| Segment_Iterator (const Polygon &__poly) | |
| Construct segment iterator from a polygon. | |
| bool | has_curr () const |
| Check if there is a current segment. | |
| Segment | get_current_segment () const |
| Get the current segment (edge). | |
Private Attributes | |
| Polygon & | poly |
| Reference to the polygon being iterated. | |
Iterator over the edges (segments) of a polygon.
Provides sequential access to all edges of the polygon. For a closed polygon, this includes the edge from the last vertex back to the first.
Construct segment iterator from a polygon.
| __poly | The polygon to iterate over. |
| std::domain_error | If the polygon has fewer than 2 vertices. |
Definition at line 458 of file polygon.H.
References ah_domain_error_if, Aleph::Dlink::is_unitarian_or_empty(), poly, and Polygon::vertex_list.
|
inline |
Get the current segment (edge).
| std::domain_error | If at last vertex of an open polygon. |
Definition at line 479 of file polygon.H.
References ah_domain_error_if, Vertex::dlink_to_vertex(), Aleph::get_curr(), Polygon::get_first_vertex(), Polygon::is_closed(), Aleph::maps(), Vertex::next_vertex(), and poly.
Referenced by Polygon::close(), Polygon::contains_to(), and TEST_F().
|
inline |
Check if there is a current segment.
Definition at line 468 of file polygon.H.
References Aleph::Dlink::Iterator::has_curr(), Polygon::is_closed(), Aleph::maps(), and poly.
Referenced by Polygon::contains_to(), demo_coverage_area(), Aleph::CuttingEarsTriangulation::diagonalie(), Polygon::intersects_with(), TEST_F(), and TEST_F().
|
private |
Reference to the polygon being iterated.
Definition at line 452 of file polygon.H.
Referenced by Segment_Iterator(), get_current_segment(), and has_curr().