added typedef VertContainer VertexContainer to avoid inconsistency with pre-existing methods

This commit is contained in:
Paolo Cignoni 2006-08-23 16:49:25 +00:00
parent c5e02633d8
commit 0004ccb15a
2 changed files with 28 additions and 24 deletions

View File

@ -24,6 +24,10 @@
History History
$Log: not supported by cvs2svn $ $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 Revision 1.3 2005/09/20 13:58:55 pietroni
Modified MArk function parameter form ConstVertexPointer to VertexPointer Modified MArk function parameter form ConstVertexPointer to VertexPointer
@ -62,6 +66,7 @@ template < class VertContainerType >
class VertexMesh{ class VertexMesh{
public: public:
typedef VertContainerType VertContainer; typedef VertContainerType VertContainer;
typedef VertContainer VertexContainer;
typedef typename VertContainerType::value_type VertexType; typedef typename VertContainerType::value_type VertexType;
typedef typename VertContainerType::value_type::ScalarType ScalarType; typedef typename VertContainerType::value_type::ScalarType ScalarType;
typedef typename VertContainerType::value_type::CoordType CoordType; typedef typename VertContainerType::value_type::CoordType CoordType;

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $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 Revision 1.1 2005/03/09 13:22:55 ganovelli
creation creation
@ -40,43 +43,39 @@ namespace vertex {
/** \addtogroup vertexmesh */ /** \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 VERTEX_CONTAINER> template <class VERTEX_CONTAINER>
class UpdateBoundingBase class UpdateBoundingBase
{ {
public: public:
typedef typename VERTEX_CONTAINER::value_type VertexType; typedef typename VERTEX_CONTAINER::value_type VertexType;
typedef typename VERTEX_CONTAINER::value_type * VertexPointer; typedef typename VERTEX_CONTAINER::value_type* VertexPointer;
typedef typename VERTEX_CONTAINER::iterator VertexIterator; typedef typename VERTEX_CONTAINER::iterator VertexIterator;
typedef typename VERTEX_CONTAINER::value_type::ScalarType ScalarType; typedef typename VERTEX_CONTAINER::value_type::ScalarType ScalarType;
/// Calculates the vertex normal (if stored in the current face type) static Box3<ScalarType> Box(VERTEX_CONTAINER &vert)
static Box3<ScalarType> Box(VERTEX_CONTAINER &vert) {
{ Box3<ScalarType> res; res.SetNull();
Box3<ScalarType> res;res.SetNull();
VertexIterator vi; VertexIterator vi;
for(vi= vert.begin();vi!= vert.end();++vi) for(vi= vert.begin();vi!= vert.end();++vi)
if( !(*vi).IsD() ) res.Add((*vi).P()); if( !(*vi).IsD() ) res.Add((*vi).P());
return res; return res;
}
}; // end class
template <class VMType>
class UpdateBounding: public UpdateBoundingBase<typename VMType::VertexContainer> {
public:
typedef typename VMType::VertexContainer VertexContainer;
static void Box(VMType &vm){
vm.bbox = UpdateBoundingBase<typename VMType::VertexContainer>::Box(vm.vert);
} }
}; // end class UpdateBoundingBase
template <class VMType>
class UpdateBounding: public UpdateBoundingBase<typename VMType::VertexContainer>
{
public:
static void Box(VMType &vm)
{
vm.bbox = UpdateBoundingBase<VMType::VertexContainer>::Box(vm.vert);
}
}; };
} // End namespace } // End namespace vertex
} // End namespace } // End namespace vcg
#endif #endif