-
Notifications
You must be signed in to change notification settings - Fork 1
/
octree.h
37 lines (30 loc) · 875 Bytes
/
octree.h
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
#ifndef OCTREE_H
#define OCTREE_H
#include "point.h"
#include <math.h>
#include <vector>
class Octree {
private:
int xit[8] = {1, 1, 1, 1, -1, -1, -1, -1};
int yit[8] = {1, -1, 1, -1, 1, -1, 1, -1};
int zit[8] = {1, 1, -1, -1, 1, 1, -1, -1};
float cellLength;
void set8childNull();
void matrixSolver(const float mat[], float *answer);
float valueOfMat3(const float mat[]);
float distanceOfV3(Point<float> a, Point<float> b);
public:
int depth = 0;
std::vector<float> data;
//八个象限
Octree *childs[8];
Octree();
Octree(int cellMaxCount, const float pointCloudArry[], float c);
Octree(const std::vector<float> &pointCloudArry, Point<float> O,
float miniLength, float currentLength);
~Octree();
Point<float> getAverageOfPoints();
std::vector<float> getDBSCANPoints();
float calculateCurvature();
};
#endif // OCTREE_H