binarytree.h
来自「RBF平台」· C头文件 代码 · 共 62 行
H
62 行
#ifndef BINARYTREE
#define BINARYTREE
#include "PointSet.h"
#define TLEAF 100 //The maximum number of points allowed in leaf nodes
#define TMAX 200
#define TMIN 60 //The maximal and minimal number of the overlapped points
#define OVERLAPQ 0.03
class BSTree;
class BSTreeCell
{
public:
bool _leaf;
char _s_axis;
char _fromwhere; //'t' -- root, 'l'-- from left, 'r'-- from right
unsigned char _nodelevel;
float _middle;
float _low[3],_high[3]; //low and high are the diagonal vertex of this nodes bounding box
//low[i] < high[i], 0=<i<3
//off-surface points array
float (*_offsurfpoint)[3];
//coefficient on each point in this bstcell
float * _coeffalpha;
//store local points
PointSet * _localpset;
BSTree* _tree;
BSTreeCell* _leftTree;
BSTreeCell* _rightTree;
BSTreeCell(BSTree * tree, unsigned char nlevel, PointSet * localpset, char fromw,
float * lowvtx, float *highvtx);
bool isInbtcell(float x,float y, float z);
BSTreeCell();
~BSTreeCell();
bool insert();
void build();
};
class BSTree {
public:
PointSet* _ps;
BSTreeCell * _root;
//int *_index_list;
//int _listN;
BSTree(PointSet* ps);
//get the tree deepth of this tree
unsigned char GetTreeLevel(BSTreeCell * treecell);
~BSTree();
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?