From b572187a6333a0685c1dbc7fc26b1a9195062242 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 15 May 2014 16:31:39 +0000 Subject: [PATCH] added yet another wrapper for the Allocator Add face. it is quite useful to add faces just with indexes... --- vcg/complex/allocate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcg/complex/allocate.h b/vcg/complex/allocate.h index c3832a91..aeef5b4d 100644 --- a/vcg/complex/allocate.h +++ b/vcg/complex/allocate.h @@ -480,6 +480,16 @@ void ResizeAttribute(ATTR_CONT &c,const int & sz , MeshType &/*m*/){ return fi; } + /** Function to add a face to the mesh and initializing it with three indexes + */ + static FaceIterator AddFace(MeshType &m, size_t v0, size_t v1, size_t v2) + { + assert((v0!=v1) && (v1!=v2) && (v0!=v2)); + assert(v0>=0 && v0<=m.vert.size()); + assert(v1>=0 && v1<=m.vert.size()); + assert(v2>=0 && v2<=m.vert.size()); + return AddFace(m,&(m.vert[v0]),&(m.vert[v1]),&(m.vert[v2])); + } /** 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)