Added the ApplyOperatorAllEdges method to HbrFace, which applies a HbrHalfedgeOperator to each halfedge of the face.

This commit is contained in:
Nathan Litke 2014-06-04 14:28:21 -07:00
parent 1d1d44c881
commit 0b3e99df09

View File

@ -46,6 +46,7 @@ namespace OPENSUBDIV_VERSION {
template <class T> class HbrVertex;
template <class T> class HbrHalfedge;
template <class T> class HbrHalfedgeOperator;
template <class T> class HbrFace;
template <class T> class HbrMesh;
template <class T> class HbrHierarchicalEdit;
@ -145,6 +146,9 @@ public:
// indicated origin index
HbrHalfedge<T>* GetEdge(int index) const;
// Applies operator to all halfedges
void ApplyOperatorAllEdges(HbrHalfedgeOperator<T>& op) const;
// Return the vertex with the indicated index
HbrVertex<T>* GetVertex(int index) const;
@ -725,6 +729,16 @@ HbrFace<T>::GetEdge(int index) const {
}
}
template <class T>
void
HbrFace<T>::ApplyOperatorAllEdges(HbrHalfedgeOperator<T> &op) const {
HbrHalfedge<T>* edge = GetFirstEdge();
for (int i = 0; i < nvertices; ++i) {
op(*edge);
edge = edge->GetNext();
}
}
template <class T>
HbrVertex<T>*
HbrFace<T>::GetVertex(int index) const {