32 #ifndef __VCG_TRI_UPDATE_POSITION
33 #define __VCG_TRI_UPDATE_POSITION
45 template <
class ComputeMeshType>
50 typedef ComputeMeshType MeshType;
51 typedef typename MeshType::ScalarType ScalarType;
52 typedef typename MeshType::VertexType VertexType;
53 typedef typename MeshType::VertexPointer VertexPointer;
54 typedef typename MeshType::VertexIterator VertexIterator;
55 typedef typename MeshType::FaceType FaceType;
56 typedef typename MeshType::FacePointer FacePointer;
57 typedef typename MeshType::FaceIterator FaceIterator;
60 static void Matrix(ComputeMeshType &m,
const Matrix44<ScalarType> &M,
bool update_also_normals =
true)
63 for(vi=m.vert.begin();vi!=m.vert.end();++vi)
64 if(!(*vi).IsD()) (*vi).P()=M*(*vi).cP();
66 if(update_also_normals){
67 if(HasPerVertexNormal(m)){
70 if(HasPerFaceNormal(m)){
76 static void Translate(ComputeMeshType &m,
const Point3<ScalarType> &t)
79 for(vi=m.vert.begin();vi!=m.vert.end();++vi)
80 if(!(*vi).IsD()) (*vi).P()+=t;
83 static void Scale(ComputeMeshType &m,
const ScalarType s)
85 Scale(m,Point3<ScalarType>(s,s,s));
88 static void Scale(ComputeMeshType &m,
const Point3<ScalarType> &s)
91 for(vi=m.vert.begin();vi!=m.vert.end();++vi)