diff --git a/vcg/complex/vertexmesh/base.h b/vcg/complex/vertexmesh/base.h index f2f3e53e..b46339cf 100644 --- a/vcg/complex/vertexmesh/base.h +++ b/vcg/complex/vertexmesh/base.h @@ -24,6 +24,10 @@ History $Log: not supported by cvs2svn $ +Revision 1.4 2006/08/23 15:32:24 marfr960 +added bbox of the mesh +vn int->size_t + Revision 1.3 2005/09/20 13:58:55 pietroni Modified MArk function parameter form ConstVertexPointer to VertexPointer @@ -62,6 +66,7 @@ template < class VertContainerType > class VertexMesh{ public: typedef VertContainerType VertContainer; + typedef VertContainer VertexContainer; typedef typename VertContainerType::value_type VertexType; typedef typename VertContainerType::value_type::ScalarType ScalarType; typedef typename VertContainerType::value_type::CoordType CoordType; diff --git a/vcg/complex/vertexmesh/update/bounding.h b/vcg/complex/vertexmesh/update/bounding.h index 2df7eb66..8f93f280 100644 --- a/vcg/complex/vertexmesh/update/bounding.h +++ b/vcg/complex/vertexmesh/update/bounding.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.2 2006/06/29 13:02:38 ganovelli +agiunta UpdateBoundingBase, superclasse di UpdateBounding, templated sul container di vertici. + Revision 1.1 2005/03/09 13:22:55 ganovelli creation @@ -40,43 +43,39 @@ namespace vertex { /** \addtogroup vertexmesh */ /*@{*/ -/// Management, updating and computation of per-vertex and per-face normals. -/// This class is used to compute or update the normals that can be stored in the vertex or face component of a mesh. template class UpdateBoundingBase { public: -typedef typename VERTEX_CONTAINER::value_type VertexType; -typedef typename VERTEX_CONTAINER::value_type * VertexPointer; -typedef typename VERTEX_CONTAINER::iterator VertexIterator; -typedef typename VERTEX_CONTAINER::value_type::ScalarType ScalarType; + typedef typename VERTEX_CONTAINER::value_type VertexType; + typedef typename VERTEX_CONTAINER::value_type* VertexPointer; + typedef typename VERTEX_CONTAINER::iterator VertexIterator; + typedef typename VERTEX_CONTAINER::value_type::ScalarType ScalarType; -/// Calculates the vertex normal (if stored in the current face type) -static Box3 Box(VERTEX_CONTAINER &vert) -{ - Box3 res;res.SetNull(); - VertexIterator vi; - for(vi= vert.begin();vi!= vert.end();++vi) + static Box3 Box(VERTEX_CONTAINER &vert) + { + Box3 res; res.SetNull(); + VertexIterator vi; + for(vi= vert.begin();vi!= vert.end();++vi) if( !(*vi).IsD() ) res.Add((*vi).P()); - return res; -} + return res; + } -}; // end class +}; // end class UpdateBoundingBase template -class UpdateBounding: public UpdateBoundingBase { +class UpdateBounding: public UpdateBoundingBase +{ public: - typedef typename VMType::VertexContainer VertexContainer; - - static void Box(VMType &vm){ - vm.bbox = UpdateBoundingBase::Box(vm.vert); - } - + static void Box(VMType &vm) + { + vm.bbox = UpdateBoundingBase::Box(vm.vert); + } }; -} // End namespace -} // End namespace +} // End namespace vertex +} // End namespace vcg #endif