added VertexValence function
This commit is contained in:
parent
2e3e2d5194
commit
555fd55b35
vcg/complex/algorithms/update
|
@ -56,6 +56,7 @@ public:
|
||||||
typedef typename MeshType::FacePointer FacePointer;
|
typedef typename MeshType::FacePointer FacePointer;
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
typedef typename MeshType::FaceIterator FaceIterator;
|
||||||
|
|
||||||
|
|
||||||
/** Assign to each vertex of the mesh a constant quality value. Useful for initialization.
|
/** Assign to each vertex of the mesh a constant quality value. Useful for initialization.
|
||||||
*/
|
*/
|
||||||
static void VertexConstant(MeshType &m, ScalarType q)
|
static void VertexConstant(MeshType &m, ScalarType q)
|
||||||
|
@ -65,6 +66,23 @@ static void VertexConstant(MeshType &m, ScalarType q)
|
||||||
(*vi).Q()=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.
|
/** Clamp each vertex of the mesh with a range of values.
|
||||||
*/
|
*/
|
||||||
static void VertexClamp(MeshType &m,
|
static void VertexClamp(MeshType &m,
|
||||||
|
|
Loading…
Reference in New Issue