added a simple wrapper to add a single vertex to a mesh given its coords

This commit is contained in:
Paolo Cignoni 2013-10-03 09:57:45 +00:00
parent 97d14f173f
commit ad17f61dc0
1 changed files with 23 additions and 2 deletions

View File

@ -99,6 +99,8 @@ namespace tri {
typedef typename MeshType::HEdgeIterator HEdgeIterator;
typedef typename MeshType::HEdgeContainer HEdgeContainer;
typedef typename MeshType::CoordType CoordType;
typedef typename MeshType::PointerToAttribute PointerToAttribute;
typedef typename std::set<PointerToAttribute>::iterator AttrIterator;
@ -227,11 +229,30 @@ namespace tri {
VertexIterator v_ret = AddVertices(m, n,pu);
typename std::vector<VertexPointer *>::iterator vi;
for(vi=local_vec.begin();vi!=local_vec.end();++vi)
pu.Update(**vi);
for(vi=local_vec.begin();vi!=local_vec.end();++vi)
pu.Update(**vi);
return v_ret;
}
/** \brief Wrapper to AddVertices() to add a single vertex with given coords
*/
static VertexIterator AddVertex(MeshType &m, const CoordType &p)
{
VertexIterator v_ret = AddVertices(m, 1);
v_ret->P()=p;
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)
{
VertexIterator v_ret = AddVertices(m, 1);
v_ret->P()=p;
v_ret->C()=c;
return v_ret;
}
/* ++++++++++ edges +++++++++++++ */
/** \brief Add n edges to the mesh.
Function to add n edges to the mesh.