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:
parent
c43920bb2e
commit
2c32f546ef
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue