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 2004/05/04 11:15:13 pietroni 00028 First working version! 00029 00030 00031 ****************************************************************************/ 00032 #ifndef __VCG_TETRA_UPDATE_BOUNDING 00033 #define __VCG_TETRA_UPDATE_BOUNDING 00034 00035 namespace vcg { 00036 namespace tetra { 00037 00040 00042 00043 template <class ComputeMeshType> 00044 class UpdateBounding 00045 { 00046 00047 public: 00048 typedef ComputeMeshType MeshType; 00049 typedef typename MeshType::VertexType VertexType; 00050 typedef typename MeshType::VertexPointer VertexPointer; 00051 typedef typename MeshType::VertexIterator VertexIterator; 00052 typedef typename MeshType::TetraType TetraType; 00053 typedef typename MeshType::TetraPointer TetraPointer; 00054 typedef typename MeshType::TetraIterator TetraIterator; 00055 00057 static void Box(ComputeMeshType &m) 00058 { 00059 m.bbox.SetNull(); 00060 VertexIterator vi; 00061 for(vi=m.vert.begin();vi!=m.vert.end();++vi) 00062 if( !(*vi).IsD() ) m.bbox.Add((*vi).P()); 00063 00064 } 00065 00066 00067 }; // end class 00068 00069 } // End namespace 00070 } // End namespace 00071 00072 00073 #endif