Hello,
I have a situation which is probably quite common and already addressed
by boost.
So rather than write it my self, maybe someone can point me to the
answer.
I've got a geometry class that needs to expose iterators for the
underling vertex components.
Example:
Class Vertex
{
positions_iterator PositionsBegin();
positions_iterator PositionsEnd();
normals_iterator NormalsBegin();
normals _iterator NormalsEnd();
...
}
The first problem is depending on the format of the underling vertices,
the stride between the data elements will change.
Is there some easy way to implement this?
I think writing my own using the boost::iterator_adapter is probably the
way to go.
Second problem is more involved.
The texture data not only has a stride but a variable number of
elements.
Some vertices have 2 texture coordinates, some 3, some even more.
Id love to define this iterator like this:
stride_iterator< pair