What pattern for mesh representation?
I've got a mesh consisting of a list of its vertices and a list of its faces. Some of the vertices are flagged as fixed, irregular or as border vertices. Perhaps other properties will be added later.
When I'm iterating over the vertices, I always have this form: If the vertex is fixed then do this calculation, else do another calculation if it's irregular and else do something else.
Is there a way to get rid of these checks? How can I automatically switch to the right calculation when iteration over the vertices? I thought about introducing different vertex classs for fixed, irregular or border vertices. But what if a vertex is fixed and irregular or fixed, irregular and at the border?
Thanks for your answers,
Enza Fröhlich, Mar 20, 2012