Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
pgl::Rectangle< PointType_, TLabel >::CornerIterator Class Reference

Forward iterator over the four corners in counterclockwise order. More...

#include <rectangle.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
using value_type = PointType
using difference_type = std::ptrdiff_t
using pointer = void
using reference = PointType

Public Member Functions

constexpr CornerIterator ()=default
constexpr CornerIterator (const Rectangle *rect, std::size_t index)
constexpr PointType operator* () const
constexpr CornerIteratoroperator++ ()
constexpr CornerIterator operator++ (int)
constexpr bool operator== (const CornerIterator &) const =default

Detailed Description

template<class PointType_, class TLabel>
class pgl::Rectangle< PointType_, TLabel >::CornerIterator

Forward iterator over the four corners in counterclockwise order.

Dereferences via Rectangle::operator[], so two of the four corners are synthesized on the fly and yielded by value.

Member Typedef Documentation

◆ difference_type

template<class PointType_, class TLabel>
using pgl::Rectangle< PointType_, TLabel >::CornerIterator::difference_type = std::ptrdiff_t

◆ iterator_category

template<class PointType_, class TLabel>
using pgl::Rectangle< PointType_, TLabel >::CornerIterator::iterator_category = std::forward_iterator_tag

◆ pointer

template<class PointType_, class TLabel>
using pgl::Rectangle< PointType_, TLabel >::CornerIterator::pointer = void

◆ reference

template<class PointType_, class TLabel>
using pgl::Rectangle< PointType_, TLabel >::CornerIterator::reference = PointType

◆ value_type

template<class PointType_, class TLabel>
using pgl::Rectangle< PointType_, TLabel >::CornerIterator::value_type = PointType

Constructor & Destructor Documentation

◆ CornerIterator() [1/2]

template<class PointType_, class TLabel>
pgl::Rectangle< PointType_, TLabel >::CornerIterator::CornerIterator ( )
constexprdefault

◆ CornerIterator() [2/2]

template<class PointType_, class TLabel>
pgl::Rectangle< PointType_, TLabel >::CornerIterator::CornerIterator ( const Rectangle * rect,
std::size_t index )
inlineconstexpr

Member Function Documentation

◆ operator*()

template<class PointType_, class TLabel>
PointType pgl::Rectangle< PointType_, TLabel >::CornerIterator::operator* ( ) const
inlineconstexpr

◆ operator++() [1/2]

template<class PointType_, class TLabel>
CornerIterator & pgl::Rectangle< PointType_, TLabel >::CornerIterator::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<class PointType_, class TLabel>
CornerIterator pgl::Rectangle< PointType_, TLabel >::CornerIterator::operator++ ( int )
inlineconstexpr

◆ operator==()

template<class PointType_, class TLabel>
bool pgl::Rectangle< PointType_, TLabel >::CornerIterator::operator== ( const CornerIterator & ) const
constexprdefault