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)){
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)
88 static void Scale(ComputeMeshType &m,
const Point3<ScalarType> &s)
91 for(vi=m.vert.begin();vi!=m.vert.end();++vi)
static void PerVertexMatrix(ComputeMeshType &m, const Matrix44< ScalarType > &mat, bool remove_scaling=true)
Multiply the vertex normals by the matrix passed. By default, the scale component is removed.
Definition: normal.h:348
static void PerFaceMatrix(ComputeMeshType &m, const Matrix44< ScalarType > &mat, bool remove_scaling=true)
Multiply the face normals by the matrix passed. By default, the scale component is removed.
Definition: normal.h:370
This class is used to update vertex position according to a transformation matrix.
Definition: position.h:47
static void Matrix(ComputeMeshType &m, const Matrix44< ScalarType > &M, bool update_also_normals=true)
Multiply.
Definition: position.h:60
Definition: namespaces.dox:6