added typedef VertContainer VertexContainer to avoid inconsistency with pre-existing methods
This commit is contained in:
parent
c5e02633d8
commit
0004ccb15a
|
@ -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;
|
||||
|
|
|
@ -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 VERTEX_CONTAINER>
|
||||
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<ScalarType> Box(VERTEX_CONTAINER &vert)
|
||||
{
|
||||
Box3<ScalarType> res;res.SetNull();
|
||||
static Box3<ScalarType> Box(VERTEX_CONTAINER &vert)
|
||||
{
|
||||
Box3<ScalarType> res; res.SetNull();
|
||||
VertexIterator vi;
|
||||
for(vi= vert.begin();vi!= vert.end();++vi)
|
||||
if( !(*vi).IsD() ) res.Add((*vi).P());
|
||||
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
|
||||
} // End namespace vertex
|
||||
} // End namespace vcg
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue