nmwsharp / geometry-central

Applied 3D geometry in C++, with a focus on surface meshes.
https://geometry-central.net
MIT License
1.01k stars 141 forks source link

Add STL iterator capabilities to surface::RangeIteratorBase<T> and surface::NavigationIteratorBase<T> #130

Open bjude opened 1 year ago

bjude commented 1 year ago

The main iterators for the halfedge meshes were almost forward iterators, this PR gets them to a usable state. They dont quite meet the LegacyForwardIterator requirements (https://en.cppreference.com/w/cpp/named_req/ForwardIterator) as they generate their elements on dereference, but they do meet the C++20 std::forward_iterator requirements so there shouldnt be any issue using them with STL algorithms (including C++20 ranges)

Closes #76