|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator over the edges (segments) of a regular polygon. More...
#include <polygon.H>
Public Member Functions | |
| Segment_Iterator (const Regular_Polygon &__poly) | |
| Construct segment iterator from a regular polygon. | |
| bool | has_curr () const |
| Check if there is a current segment. | |
| const Segment | get_current_segment () const |
| Get the current segment (edge). | |
| void | next_ne () noexcept |
| Advance to next segment (no exception on overflow). | |
| void | next () |
| Advance to next segment. | |
| void | prev () |
| Move to previous segment. | |
Private Attributes | |
| const Regular_Polygon & | poly |
| Reference to the polygon. | |
| size_t | curr |
| Current segment index. | |
Iterator over the edges (segments) of a regular polygon.
This iterator provides the same interface as Polygon::Segment_Iterator to enable generic code that works with both polygon types.
|
inline |
Get the current segment (edge).
| std::overflow_error | If no current segment exists. |
Definition at line 1030 of file polygon.H.
References ah_overflow_error_if, curr, Regular_Polygon::get_vertex(), has_curr(), Aleph::maps(), poly, and Regular_Polygon::size().
|
inline |
Check if there is a current segment.
Definition at line 1025 of file polygon.H.
References curr, poly, and Regular_Polygon::size().
Referenced by get_current_segment(), next(), prev(), TEST_F(), and TEST_F().
|
inline |
Advance to next segment.
| std::overflow_error | If already at end. |
Definition at line 1044 of file polygon.H.
References ah_overflow_error_if, has_curr(), Aleph::maps(), and next_ne().
Referenced by TEST_F().
|
inlinenoexcept |
|
inline |
Move to previous segment.
| std::underflow_error | If already at beginning. |
Definition at line 1053 of file polygon.H.
References ah_underflow_error_if, curr, has_curr(), and Aleph::maps().
|
private |
Current segment index.
Definition at line 1012 of file polygon.H.
Referenced by get_current_segment(), has_curr(), next_ne(), and prev().
|
private |
Reference to the polygon.
Definition at line 1011 of file polygon.H.
Referenced by get_current_segment(), and has_curr().