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 #ifndef __VCG_TRI_UPDATE_BOUNDING 00024 #define __VCG_TRI_UPDATE_BOUNDING 00025 00026 namespace vcg { 00027 namespace tri { 00028 00032 00033 template <class ComputeMeshType> 00034 class UpdateBounding 00035 { 00036 00037 public: 00038 typedef ComputeMeshType MeshType; 00039 typedef typename MeshType::VertexType VertexType; 00040 typedef typename MeshType::VertexPointer VertexPointer; 00041 typedef typename MeshType::VertexIterator VertexIterator; 00042 00044 00045 static void Box(ComputeMeshType &m) 00046 { 00047 m.bbox.SetNull(); 00048 for(VertexIterator vi = m.vert.begin(); vi != m.vert.end(); ++vi) 00049 if( !(*vi).IsD() ) m.bbox.Add((*vi).cP()); 00050 } 00051 00052 00053 }; // end class 00054 00055 } // End namespace 00056 } // End namespace 00057 00058 00059 #endif