00001 /**************************************************************************** 00002 * VCGLib o o * 00003 * Visual and Computer Graphics Library o o * 00004 * _ O _ * 00005 * Copyright(C) 2004 \/)\/ * 00006 * Visual Computing Lab /\/| * 00007 * ISTI - Italian National Research Council | * 00008 * \ * 00009 * All rights reserved. * 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 * This program is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00019 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * 00020 * for more details. * 00021 * * 00022 ****************************************************************************/ 00023 /**************************************************************************** 00024 History 00025 00026 $Log: not supported by cvs2svn $ 00027 Revision 1.1 2005/07/06 08:02:27 cignoni 00028 Initial commit 00029 00030 00031 ****************************************************************************/ 00032 #ifndef __VCG_VERTEX_UPDATE_POSITION 00033 #define __VCG_VERTEX_UPDATE_POSITION 00034 00035 namespace vcg { 00036 namespace vrt { 00037 00040 00042 template <class VERTEX_CONTAINER> 00043 class UpdatePositionBase 00044 { 00045 00046 public: 00047 typedef typename VERTEX_CONTAINER::value_type::ScalarType ScalarType; 00048 typedef typename VERTEX_CONTAINER::iterator VertexIterator; 00049 00051 static void Matrix(VERTEX_CONTAINER &vert, const Matrix44<ScalarType> &mm) 00052 { 00053 VertexIterator vi; 00054 for(vi= vert.begin();vi!= vert.end();++vi) 00055 if(!(*vi).IsD()) (*vi).P()=mm*(*vi).cP(); 00056 } 00057 00058 00059 }; // end class 00060 00061 template <class VertexMeshType> 00062 class UpdatePosition: public UpdatePositionBase<typename VertexMeshType::VertexContainer> { 00063 public: 00064 typedef typename VertexMeshType::VertexContainer VertexContainer; 00065 00066 static void Matrix(VertexMeshType &vm, const Matrix44<ScalarType> &mm) 00067 { UpdatePositionBase<typename VertexMeshType::VertexContainer>::Matrix(vm.vert,mm); 00068 } 00069 00070 }; 00071 00072 00073 } // End namespace 00074 } // End namespace 00075 00076 00077 #endif