added a simple wrapper to add a single vertex to a mesh given its coords
This commit is contained in:
parent
97d14f173f
commit
ad17f61dc0
vcg/complex
|
@ -99,6 +99,8 @@ namespace tri {
|
||||||
typedef typename MeshType::HEdgeIterator HEdgeIterator;
|
typedef typename MeshType::HEdgeIterator HEdgeIterator;
|
||||||
typedef typename MeshType::HEdgeContainer HEdgeContainer;
|
typedef typename MeshType::HEdgeContainer HEdgeContainer;
|
||||||
|
|
||||||
|
typedef typename MeshType::CoordType CoordType;
|
||||||
|
|
||||||
|
|
||||||
typedef typename MeshType::PointerToAttribute PointerToAttribute;
|
typedef typename MeshType::PointerToAttribute PointerToAttribute;
|
||||||
typedef typename std::set<PointerToAttribute>::iterator AttrIterator;
|
typedef typename std::set<PointerToAttribute>::iterator AttrIterator;
|
||||||
|
@ -227,11 +229,30 @@ namespace tri {
|
||||||
VertexIterator v_ret = AddVertices(m, n,pu);
|
VertexIterator v_ret = AddVertices(m, n,pu);
|
||||||
|
|
||||||
typename std::vector<VertexPointer *>::iterator vi;
|
typename std::vector<VertexPointer *>::iterator vi;
|
||||||
for(vi=local_vec.begin();vi!=local_vec.end();++vi)
|
for(vi=local_vec.begin();vi!=local_vec.end();++vi)
|
||||||
pu.Update(**vi);
|
pu.Update(**vi);
|
||||||
return v_ret;
|
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 +++++++++++++ */
|
/* ++++++++++ edges +++++++++++++ */
|
||||||
/** \brief Add n edges to the mesh.
|
/** \brief Add n edges to the mesh.
|
||||||
Function to add n edges to the mesh.
|
Function to add n edges to the mesh.
|
||||||
|
|
Loading…
Reference in New Issue