diff --git a/vcg/complex/foreach.h b/vcg/complex/foreach.h index 61a70de3..15180e5c 100644 --- a/vcg/complex/foreach.h +++ b/vcg/complex/foreach.h @@ -127,6 +127,34 @@ inline void ForEachVertex(MeshType &m, std::function +inline void ForEachEdge(MeshType &m, std::function action) +{ + if(m.en == (int) m.edge.size()) + { + for(auto ei=m.edge.begin();ei!=m.edge.end();++ei) { + action(*ei); + } + } + else + { + for(auto ei=m.edge.begin();ei!=m.edge.end();++ei) + if(!(*ei).IsD()) + { + action(*ei); + } + } +}