Added a VertexConstDataWrapper to the kdtree helper classes for a simpler use of a kdtree to index the vertexes of a mesh

This commit is contained in:
Paolo Cignoni 2012-10-25 16:55:52 +00:00
parent c43920bb2e
commit 2c32f546ef
1 changed files with 9 additions and 2 deletions

View File

@ -9,8 +9,6 @@
#include <limits>
#include <iostream>
template<typename _DataType>
class ConstDataWrapper
{
@ -33,6 +31,15 @@ protected:
size_t mSize;
};
template<class MeshType>
class VertexConstDataWrapper :public ConstDataWrapper<typename MeshType::CoordType>
{
public:
inline VertexConstDataWrapper(MeshType &m):
ConstDataWrapper<typename MeshType::CoordType> ( &(m.vert[0].P()), m.vert.size(), sizeof(typename MeshType::VertexType))
{}
};
/**
* This class allows to create a Kd-Tree thought to perform the k-nearest neighbour query
*/