Add Edge circulators
Adds Edge-Halfedge, Edge-Vertex, and Edge-Face circulators (and corresponding circulator ranges). These are especially useful in combination with smart ranges and their associated functional programming style. For example:
int valence_after_collapse(SmartEdgeHandle _eh)
{
return _eh.vertices().sum([&](auto _vh) { return _vh.valence(); }) - 2;
}
Their iteration behaviour is defined as follows:
Edge-Halfedge circulator
for (auto heh : eh.halfedges()) {
// ...
}
is the same as
for (int i = 0; i < 2; ++i) {
auto heh = eh.halfedge(i);
// ...
}
Edge-Vertex circulator
for (auto vh : eh.vertices()) {
// ...
}
is the same as
for (int i = 0; i < 2; ++i) {
auto vh = eh.vertex(i);
// ...
}
Edge-Face circulator
for (auto fh : eh.faces()) {
// ...
}
is the same as
for (int i = 0; i < 2; ++i) {
auto fh = eh.halfedge(i).face();
if (fh.is_valid()) {
// ...
}
}
Notes
One additional change was adding a default argument to PolyConnectivity::halfedge_handle
, i.e.
mesh.halfedge_handle(eh)
is now equivalent to
mesh.halfedge_handle(eh, 0)
This greatly simplifies the implementation of the Generic Circulator, which can now call halfedge_handle()
on any center element type to obtain a starting halfedge.
Edited by Janis Born