$darkmode
VCG Library
bounding.h
1 /****************************************************************************
2 * VCGLib o o *
3 * Visual and Computer Graphics Library o o *
4 * _ O _ *
5 * Copyright(C) 2004-2016 \/)\/ *
6 * Visual Computing Lab /\/| *
7 * ISTI - Italian National Research Council | *
8 * \ *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
20 * for more details. *
21 * *
22 ****************************************************************************/
23 #ifndef __VCG_TRI_UPDATE_BOUNDING
24 #define __VCG_TRI_UPDATE_BOUNDING
25 
26 namespace vcg {
27 namespace tri {
28 
32 
33 template <class ComputeMeshType>
35 {
36 
37 public:
38 typedef ComputeMeshType MeshType;
39 typedef typename MeshType::VertexType VertexType;
40 typedef typename MeshType::VertexPointer VertexPointer;
41 typedef typename MeshType::VertexIterator VertexIterator;
42 
44 
45 static void Box(ComputeMeshType &m)
46 {
47  m.bbox.SetNull();
48  for(VertexIterator vi = m.vert.begin(); vi != m.vert.end(); ++vi)
49  if( !(*vi).IsD() ) m.bbox.Add((*vi).cP());
50 }
51 
52 
53 }; // end class
54 
55 } // End namespace
56 } // End namespace
57 
58 
59 #endif
This class is used to compute or update the bounding box of a mesh..
Definition: bounding.h:35
static void Box(ComputeMeshType &m)
Calculates the bounding box of the given mesh m.
Definition: bounding.h:45
Definition: namespaces.dox:6