Added another AddFace wrapper.

This commit is contained in:
Paolo Cignoni 2014-03-04 00:31:49 +00:00
parent 60c32eeeee
commit e042757e5a
1 changed files with 16 additions and 0 deletions

View File

@ -470,6 +470,22 @@ void ResizeAttribute(ATTR_CONT &c,const int & sz , MeshType &/*m*/){
return fi; return fi;
} }
/** Function to add a face to the mesh and initializing it with the three given coords
*/
static FaceIterator AddFace(MeshType &m, CoordType p0, CoordType p1, CoordType p2)
{
VertexIterator vi = AddVertices(m,3);
FaceIterator fi = AddFaces(m,1);
fi->Alloc(3);
vi->P()=p0;
fi->V(0)=&*vi++;
vi->P()=p1;
fi->V(1)=&*vi++;
vi->P()=p2;
fi->V(2)=&*vi;
return fi;
}
/** Function to add a quad face to the mesh and initializing it with the four given VertexPointers /** Function to add a quad face to the mesh and initializing it with the four given VertexPointers
* *
* Note that this function add a single polygonal face if the mesh has polygonal info or two tris with the corresponding faux bit set in the standard common case of a triangular mesh. * Note that this function add a single polygonal face if the mesh has polygonal info or two tris with the corresponding faux bit set in the standard common case of a triangular mesh.