added VertexValence function

This commit is contained in:
nico 2017-01-25 17:27:25 +01:00
parent 2e3e2d5194
commit 555fd55b35
1 changed files with 18 additions and 0 deletions

View File

@ -56,6 +56,7 @@ public:
typedef typename MeshType::FacePointer FacePointer;
typedef typename MeshType::FaceIterator FaceIterator;
/** Assign to each vertex of the mesh a constant quality value. Useful for initialization.
*/
static void VertexConstant(MeshType &m, ScalarType q)
@ -65,6 +66,23 @@ static void VertexConstant(MeshType &m, ScalarType q)
(*vi).Q()=q;
}
/** Assign to each vertex of the mesh the valence of faces.
*/
static void VertexValence(UpdateMeshType &m)
{
VertexConstant(m,0);
for (size_t i=0;i<m.face.size();i++)
{
if (m.face[i].IsD())continue;
for (int j=0;j<m.face[i].VN();j++)
{
VertexType *v=m.face[i].V(j);
v->Q()+=1;
}
}
}
/** Clamp each vertex of the mesh with a range of values.
*/
static void VertexClamp(MeshType &m,