Changed many explicit exception throwing for missing components into the shorthand RequireXXXX

This commit is contained in:
Paolo Cignoni 2014-11-03 14:34:35 +00:00
parent 6830b4aea4
commit b278f29129
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ typedef typename MeshType::FaceIterator FaceIterator;
*/
static void PerVertexClear(ComputeMeshType &m, bool ClearAllVertNormal=false)
{
if(!HasPerVertexNormal(m)) throw vcg::MissingComponentException("PerVertexNormal");
RequirePerVertexNormal(m);
if(ClearAllVertNormal)
UpdateFlags<ComputeMeshType>::VertexClearV(m);
else
@ -160,7 +160,7 @@ static void PerVertexNelsonMaxWeighted(ComputeMeshType &m)
/// Not normalized. Use PerFaceNormalized() or call NormalizePerVertex() if you need unit length per face normals.
static void PerFace(ComputeMeshType &m)
{
if(!HasPerFaceNormal(m)) throw vcg::MissingComponentException("PerFaceNormal");
RequirePerFaceNormal(m);
for(FaceIterator f=m.face.begin();f!=m.face.end();++f)
if( !(*f).IsD() )
face::ComputeNormal(*f);