moved Index function from append to the allocate

This commit is contained in:
Paolo Cignoni 2008-04-10 09:18:57 +00:00
parent a68e2a247e
commit fc917d5080
2 changed files with 17 additions and 11 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.41 2008/04/03 22:47:10 cignoni
template the reorder functions on the vector types (for ocf)
Revision 1.40 2008/03/11 09:22:07 cignoni
Completed the garbage collecting functions CompactVertexVector and CompactFaceVector.
@ -166,6 +169,15 @@ namespace vcg {
namespace tri {
/** \addtogroup trimesh */
template<class MeshType>
size_t Index(MeshType &m, typename MeshType::VertexType &v) {return &v-&*m.vert.begin();}
template<class MeshType>
size_t Index(MeshType &m, typename MeshType::FaceType &f) {return &f-&*m.face.begin();}
template<class MeshType>
size_t Index(MeshType &m, const typename MeshType::VertexType *vp) {return vp-&*m.vert.begin();}
template<class MeshType>
size_t Index(MeshType &m, const typename MeshType::FaceType * fp) {return fp-&*m.face.begin();}
// Placeholder.
// this one is called by the Compact and overridden by more specialized functions for OCF classes.

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.7 2008/01/28 08:39:56 cignoni
added management of normals
Revision 1.6 2007/03/12 15:38:03 tarini
Texture coord name change! "TCoord" and "Texture" are BAD. "TexCoord" is GOOD.
@ -48,21 +51,12 @@ Initial Release
#ifndef __VCGLIB_APPEND
#define __VCGLIB_APPEND
#include <vcg/complex/trimesh/allocate.h>
#include <vcg/complex/trimesh/update/flag.h>
namespace vcg {
namespace tri {
template<class MeshType>
int Index(MeshType &m, typename MeshType::VertexType &v) {return &v-&*m.vert.begin();}
template<class MeshType>
int Index(MeshType &m, typename MeshType::FaceType &f) {return &f-&*m.face.begin();}
template<class MeshType>
int Index(MeshType &m, typename MeshType::VertexPointer &vp) {return vp-&*m.vert.begin();}
template<class MeshType>
int Index(MeshType &m, typename MeshType::FacePointer &fp) {return fp-&*m.face.begin();}
template<class MeshLeft, class MeshRight>
class Append
{