QgsAbstractGeometry::vertex_iterator class

The vertex_iterator class provides STL-style iterator for vertices.

Constructors, destructors, conversion operators

vertex_iterator() defaulted
Create invalid iterator.
vertex_iterator(const QgsAbstractGeometry* g, int index)
Create vertex iterator for a geometry.

Public functions

auto operator*() const -> QgsPoint
Returns the current item.
auto operator++() -> vertex_iterator&
The prefix ++ operator (++it) advances the iterator to the next vertex and returns an iterator to the new current vertex.
auto operator++(int) -> vertex_iterator
The postfix ++ operator (it++) advances the iterator to the next vertex and returns an iterator to the previously current vertex.
auto vertexId() const -> QgsVertexId
Returns vertex ID of the current item.

Function documentation

vertex_iterator& QgsAbstractGeometry::vertex_iterator::operator++()

The prefix ++ operator (++it) advances the iterator to the next vertex and returns an iterator to the new current vertex.

Calling this function on iterator that is already past the last item leads to undefined results.