Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Polygon::Vertex_Iterator Struct Reference

Iterator over the vertices of a polygon. More...

#include <polygon.H>

Inheritance diagram for Polygon::Vertex_Iterator:
[legend]
Collaboration diagram for Polygon::Vertex_Iterator:
[legend]

Public Member Functions

 Vertex_Iterator (const Polygon &poly)
 Construct iterator from a polygon.
 
Vertexget_current_vertex ()
 Get the current vertex.
 

Detailed Description

Iterator over the vertices of a polygon.

Provides sequential access to all vertices in the polygon.

for (Polygon::Vertex_Iterator it(poly); it.has_curr(); it.next())
std::cout << it.get_current_vertex().to_string() << "\n";
Iterator over the vertices of a polygon.
Definition polygon.H:419

Definition at line 418 of file polygon.H.

Constructor & Destructor Documentation

◆ Vertex_Iterator()

Polygon::Vertex_Iterator::Vertex_Iterator ( const Polygon poly)
inline

Construct iterator from a polygon.

Parameters
polyThe polygon to iterate over.
Exceptions
std::domain_errorIf the polygon has no vertices.

Definition at line 423 of file polygon.H.

References ah_domain_error_if, Aleph::Dlink::is_empty(), and Polygon::vertex_list.

Member Function Documentation

◆ get_current_vertex()

Vertex & Polygon::Vertex_Iterator::get_current_vertex ( )
inline

Get the current vertex.

Returns
Reference to the current vertex.

Definition at line 431 of file polygon.H.

References Vertex::dlink_to_vertex(), and Aleph::get_curr().

Referenced by TEST_F().


The documentation for this struct was generated from the following file: