GLTree.h 755 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <vector>
using namespace std;// per usare i vector


struct Coord3D
{
	    double x;
		double y;
		double z;
};

struct GLNode
{
	 int idpoint;
	int next;
};

class GLTREE
{
    private:
	int N;//number of points
  GLNode *Leaves;
  int *First;
  double Toll;
  double Minx,Miny,Minz,PX,PY,PZ;//Sistema di riferimento
  int nxint,nyint,nzint;
  
  

  public:


	GLTREE( Coord3D *p,int Np);//constructor
	~GLTREE();//destructor
	
	

//funzioni membro
	//void GLTREE::SearchRadius(Coord3D* p,Coord3D* pk,double r,vector<int>* idcv);
    void SearchClosest(Coord3D *p,Coord3D *pk,int* idc,double* mindist);
    void SearchKClosest(Coord3D *p,Coord3D *pk,int* idc,double* mindist,int k);

};