|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator over the vertices of a regular polygon. More...
#include <polygon.H>
Public Member Functions | |
| Vertex_Iterator (const Regular_Polygon &poly) | |
| Construct iterator from a regular polygon. | |
| bool | has_curr () const |
| Check if there is a current vertex. | |
| Vertex & | get_current_vertex () |
| Get the current vertex. | |
| void | next_ne () noexcept |
| Advance to the next vertex (no exception on overflow). | |
| void | next () |
| Advance to the next vertex. | |
| void | prev () |
| Move to previous vertex. | |
Private Attributes | |
| const Regular_Polygon & | poly_ |
| Reference to the polygon. | |
| size_t | curr_ |
| Current vertex index. | |
| Vertex | vertex_ |
| Cache for compatibility with Polygon::Vertex_Iterator. | |
Iterator over the vertices of a regular polygon.
This iterator provides the same interface as Polygon::Vertex_Iterator to enable generic code that works with both polygon types.
|
inline |
|
inline |
Get the current vertex.
| std::overflow_error | If no current vertex exists. |
Definition at line 1266 of file polygon.H.
References ah_overflow_error_if, curr_, Aleph::divide_and_conquer_partition_dp(), Aleph::Regular_Polygon::get_vertex(), has_curr(), poly_, and vertex_.
|
inline |
Check if there is a current vertex.
Definition at line 1261 of file polygon.H.
References curr_, poly_, and Aleph::Regular_Polygon::size().
Referenced by get_current_vertex(), next(), prev(), TEST_F(), and TEST_F().
|
inline |
Advance to the next vertex.
| std::overflow_error | If already at end. |
Definition at line 1280 of file polygon.H.
References ah_overflow_error_if, Aleph::divide_and_conquer_partition_dp(), has_curr(), and next_ne().
Referenced by TEST_F().
|
inlinenoexcept |
|
inline |
Move to previous vertex.
| std::underflow_error | If already at the beginning. |
Definition at line 1288 of file polygon.H.
References ah_underflow_error_if, curr_, Aleph::divide_and_conquer_partition_dp(), and has_curr().
|
private |
Current vertex index.
Definition at line 1247 of file polygon.H.
Referenced by get_current_vertex(), has_curr(), next_ne(), and prev().
|
private |
Reference to the polygon.
Definition at line 1246 of file polygon.H.
Referenced by get_current_vertex(), and has_curr().
|
private |
Cache for compatibility with Polygon::Vertex_Iterator.
Definition at line 1248 of file polygon.H.
Referenced by get_current_vertex().