From dbe0d2b7f541080d125c783ba21148d87ce70f92 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 17 Apr 2014 09:49:40 +0000 Subject: [PATCH] Wrapper to AddVertices() to add, with a single call, a single vertex with given coords and normal --- vcg/complex/allocate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcg/complex/allocate.h b/vcg/complex/allocate.h index 97cbabc6..c3832a91 100644 --- a/vcg/complex/allocate.h +++ b/vcg/complex/allocate.h @@ -245,6 +245,16 @@ void ResizeAttribute(ATTR_CONT &c,const int & sz , MeshType &/*m*/){ return v_ret; } + /** \brief Wrapper to AddVertices() to add a single vertex with given coords and normal + */ + static VertexIterator AddVertex(MeshType &m, const CoordType &p, const CoordType &n) + { + VertexIterator v_ret = AddVertices(m, 1); + v_ret->P()=p; + v_ret->N()=n; + return v_ret; + } + /** \brief Wrapper to AddVertices() to add a single vertex with given coords and color */ static VertexIterator AddVertex(MeshType &m, const CoordType &p, const Color4b &c)