3dpcp/include/slam6d/kd.h

51 lines
1 KiB
C
Raw Normal View History

2012-09-16 12:33:11 +00:00
/** @file
* @brief Representation of the optimized k-d tree.
* @author Andreas Nuechter. Institute of Computer Science, University of Osnabrueck, Germany.
* @author Kai Lingemann. Institute of Computer Science, University of Osnabrueck, Germany.
* @author Thomas Escher
*/
#ifndef __KD_H__
#define __KD_H__
#include "slam6d/kdparams.h"
#include "slam6d/searchTree.h"
2012-10-24 09:22:27 +00:00
#include "slam6d/kdTreeImpl.h"
2012-09-16 12:33:11 +00:00
#ifdef _MSC_VER
#if !defined _OPENMP && defined OPENMP
#define _OPENMP
#endif
#endif
#ifdef _OPENMP
#include <omp.h>
#endif
2012-10-24 09:22:27 +00:00
struct Void { };
struct PtrAccessor {
inline double *operator() (Void, double* indices) {
return indices;
}
};
2012-09-16 12:33:11 +00:00
/**
* @brief The optimized k-d tree.
*
* A kD tree for points, with limited
* capabilities (find nearest point to
* a given point, or to a ray).
**/
2012-10-24 09:22:27 +00:00
class KDtree : public SearchTree, private KDTreeImpl<Void, double*, PtrAccessor> {
2012-09-16 12:33:11 +00:00
public:
KDtree(double **pts, int n);
virtual ~KDtree();
virtual double *FindClosest(double *_p, double maxdist2, int threadNum = 0) const;
};
#endif