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 // marco: removed types FaceType, FacePointer, FaceIterator to allow the use of this method from vertex meshes 00025 00026 00027 /**************************************************************************** 00028 History 00029 00030 $Log: not supported by cvs2svn $ 00031 Revision 1.2 2004/09/15 11:16:27 ganovelli 00032 changed P() to cP() 00033 00034 Revision 1.1 2004/04/05 11:56:13 cignoni 00035 First working version! 00036 00037 Revision 1.2 2004/03/12 15:22:19 cignoni 00038 Written some documentation and added to the trimes doxygen module 00039 00040 Revision 1.1 2004/03/05 10:59:24 cignoni 00041 Changed name from plural to singular (normals->normal) 00042 00043 Revision 1.1 2004/03/04 00:05:50 cignoni 00044 First working version! 00045 00046 Revision 1.1 2004/02/19 13:11:06 cignoni 00047 Initial commit 00048 00049 00050 ****************************************************************************/ 00051 #ifndef __VCG_TRI_UPDATE_BOUNDING 00052 #define __VCG_TRI_UPDATE_BOUNDING 00053 00054 namespace vcg { 00055 namespace tri { 00056 00058 00060 00062 00066 template <class ComputeMeshType> 00067 class UpdateBounding 00068 { 00069 00070 public: 00071 typedef ComputeMeshType MeshType; 00072 typedef typename MeshType::VertexType VertexType; 00073 typedef typename MeshType::VertexPointer VertexPointer; 00074 typedef typename MeshType::VertexIterator VertexIterator; 00075 00077 00078 static void Box(ComputeMeshType &m) 00079 { 00080 m.bbox.SetNull(); 00081 VertexIterator vi; 00082 for(vi = m.vert.begin(); vi != m.vert.end(); ++vi) 00083 if( !(*vi).IsD() ) m.bbox.Add((*vi).cP()); 00084 00085 } 00086 00087 00088 }; // end class 00089 00090 } // End namespace 00091 } // End namespace 00092 00093 00094 #endif