From dbc5a559c4f318fd49d9b55d71fcfe63ee883e3a Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 22 Nov 2005 15:47:35 +0000 Subject: [PATCH] Moved ComputeNormal and ComputeNormalizedNormal out of the face class (no more a member function!) --- vcg/complex/trimesh/update/normal.h | 5 ++++- vcg/simplex/face/base.h | 31 ++++++++++++----------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/vcg/complex/trimesh/update/normal.h b/vcg/complex/trimesh/update/normal.h index ea635461..91712fc4 100644 --- a/vcg/complex/trimesh/update/normal.h +++ b/vcg/complex/trimesh/update/normal.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.8 2005/11/21 21:44:43 cignoni +Moved ComputeNormal and ComputeNormalizedNormal out of the face class (no more a member function!) + Revision 1.7 2005/10/13 08:38:00 cignoni removed the access to the face member function normal and substituted with vcg::normal(*f); @@ -85,7 +88,7 @@ static void PerFace(ComputeMeshType &m) if( !m.HasPerFaceNormal()) return; FaceIterator f; for(f=m.face.begin();f!=m.face.end();++f) - if( !(*f).IsD() ) ComputeNormal(*f); + if( !(*f).IsD() ) face::ComputeNormal(*f); } diff --git a/vcg/simplex/face/base.h b/vcg/simplex/face/base.h index db69db99..f6ada0b5 100644 --- a/vcg/simplex/face/base.h +++ b/vcg/simplex/face/base.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.32 2005/11/12 18:39:54 cignoni +Added dummy static member for avoiding annoying warning in empty functions... + Revision 1.31 2005/11/01 18:16:36 cignoni Added intialization of _flags to zero in the default constructor of face @@ -324,24 +327,6 @@ public: #endif } - /// Calculate the normal to the face, the value is store in the field _n of the face -void ComputeNormal() -{ -#ifdef __VCGLIB_FACE_FN - _n = vcg::Normal(*this); -#else - assert(0); -#endif -} -void ComputeNormalizedNormal() -{ -#ifdef __VCGLIB_FACE_FN - _n = vcg::NormalizedNormal(*this); -#else - assert(0); -#endif -} - /// Return the value of the face normal as it correspond to the current geometry. /// it is always computed and never stored. const CoordType Normal() const @@ -1223,7 +1208,17 @@ inline void Nexts( BaseFaceType *&f,int &z ) }; //end Class +/// Calculate the normal to the face, the value is store in the field _n of the face +namespace face +{ +template +void ComputeNormal(FACE_TYPE &f) { f.N() = vcg::Normal< FACE_TYPE >(f); } + +template +void ComputeNormalizedNormal(FACE_TYPE &f) { f.N() = vcg::NormalizedNormal< FACE_TYPE >(f); } + +} //@} } // end namespace