btree.h
Go to the documentation of this file.
1 #ifndef BTREEH
2 #define BTREEH
3 
4 #include "boolean.h"
5 #include "box.h"
6 #include "chart.h"
7 
8 #if (_KDTREE==1)
9  #include <cuik-kdtree/cuik-kdtree.h>
10 #endif
11 #if (_KDTREE==2)
12  #include <DNN/ANN_C.h>
13 #endif
14 
29 #define INIT_NUM_POINTS_IN_BTREE 1000
30 
42 typedef struct {
43  unsigned int m;
44  double r;
45  unsigned int *tp;
47  #if (_KDTREE==1)
48  TKDtree *kdtree;
49  #endif
50  #if (_KDTREE==2)
51  TKDTree *kdtree;
52  unsigned int mp;
53  unsigned int np;
54  unsigned int *n2id;
57  #endif
58 } TBTree;
59 
72 void InitBTree(unsigned int id,Tchart *mp,Tbox *ambient,unsigned int *topology,TBTree *t);
73 
83 void AddChart2Btree(unsigned int id,Tchart *mp,TBTree *t);
84 
98 boolean PointInBTree(double eps,double *p,TBTree *t);
99 
119 void SearchInBtree(Tchart *mp,unsigned int *nn,unsigned int **n,TBTree *t);
120 
126 void DeleteBTree(TBTree *t);
127 
128 #endif
Definition of the boolean type.
unsigned int * tp
Definition: btree.h:45
unsigned int m
Definition: btree.h:43
void InitBTree(unsigned int id, Tchart *mp, Tbox *ambient, unsigned int *topology, TBTree *t)
Initializes a binary tree of charts.
Definition: btree.c:19
double r
Definition: btree.h:44
A chart on a manifold.
Definition: chart.h:70
void AddChart2Btree(unsigned int id, Tchart *mp, TBTree *t)
Adds a chart to the tree.
Definition: btree.c:75
boolean PointInBTree(double eps, double *p, TBTree *t)
Point in a tree.
Definition: btree.c:113
Definition of the Tbox type and the associated functions.
void SearchInBtree(Tchart *mp, unsigned int *nn, unsigned int **n, TBTree *t)
Search for neighbouring charts.
Definition: btree.c:142
Definition of a local chart on a manifold.
void DeleteBTree(TBTree *t)
Chart tree destructor.
Definition: btree.c:184
A box.
Definition: box.h:83
Binary tree of charts.
Definition: btree.h:42