From 555fd55b35613fec0b9906c86d3464137b364aee Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 25 Jan 2017 17:27:25 +0100 Subject: [PATCH] added VertexValence function --- vcg/complex/algorithms/update/quality.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vcg/complex/algorithms/update/quality.h b/vcg/complex/algorithms/update/quality.h index ba7a6afc..504c0089 100644 --- a/vcg/complex/algorithms/update/quality.h +++ b/vcg/complex/algorithms/update/quality.h @@ -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;iQ()+=1; + } + } +} + /** Clamp each vertex of the mesh with a range of values. */ static void VertexClamp(MeshType &m,