From fc917d50803c14f81ad49a8e6cdeb68a7aa730bc Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 10 Apr 2008 09:18:57 +0000 Subject: [PATCH] moved Index function from append to the allocate --- vcg/complex/trimesh/allocate.h | 14 +++++++++++++- vcg/complex/trimesh/append.h | 14 ++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/vcg/complex/trimesh/allocate.h b/vcg/complex/trimesh/allocate.h index b3cccc7f..982cfe86 100644 --- a/vcg/complex/trimesh/allocate.h +++ b/vcg/complex/trimesh/allocate.h @@ -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,7 +169,16 @@ namespace vcg { namespace tri { /** \addtogroup trimesh */ - + template + size_t Index(MeshType &m, typename MeshType::VertexType &v) {return &v-&*m.vert.begin();} + template + size_t Index(MeshType &m, typename MeshType::FaceType &f) {return &f-&*m.face.begin();} + + template + size_t Index(MeshType &m, const typename MeshType::VertexType *vp) {return vp-&*m.vert.begin();} + template + 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. // that manage also the additional types diff --git a/vcg/complex/trimesh/append.h b/vcg/complex/trimesh/append.h index b24350ad..5772edaa 100644 --- a/vcg/complex/trimesh/append.h +++ b/vcg/complex/trimesh/append.h @@ -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 #include namespace vcg { namespace tri { -template -int Index(MeshType &m, typename MeshType::VertexType &v) {return &v-&*m.vert.begin();} -template -int Index(MeshType &m, typename MeshType::FaceType &f) {return &f-&*m.face.begin();} - -template -int Index(MeshType &m, typename MeshType::VertexPointer &vp) {return vp-&*m.vert.begin();} -template -int Index(MeshType &m, typename MeshType::FacePointer &fp) {return fp-&*m.face.begin();} - template class Append {