-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpaceColonizationHeader.h
131 lines (83 loc) · 2.21 KB
/
SpaceColonizationHeader.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#ifndef SPACECOLONIZATIONHEADER_H_INCLUDED
#define SPACECOLONIZATIONHEADER_H_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <fstream>
#include <ctime>
#include <vector>
#include <queue>
#include "Matrix3D.h"
#include "Vector3D.h"
#include "CTree.h"
using namespace std;
typedef struct PointStructure {
int PointId;
CVector3D PointPos;
bool flag;
} PointST; //点的结构
typedef struct TreeNodeStructure {
CVector3D SkeletonNodePos;
vector<int> InfluenceList;
bool flag;
int cnum;
int Pid;
vector<int> cidList;
} TreeSkeletonST; //树的骨架点的结构
typedef struct TreeBranchStructure {
CVector3D startPoint;
CVector3D endPoint;
int BranchId;
int Pid;
int cnum;
vector<int> cid;
int level;
bool flag; //完整与否的标记
double ds;
} BranchST; //树枝结构
/*以上就是空间殖民算法用到的一些结构体*/
class SpaceColonization {
private : //成员变量
vector<PointST> PointCloud; //存储加载的点云
vector<TreeSkeletonST> SkeletonNode; //存储树的骨架节点
vector<BranchST> TreeBranch;
int PointNumber;
int SkeletonNodeNumber;
int BranchNumber;
int PointListId;
int SkeletinListId;
int PointLineListId;
int RootPointId;
CVector3D BaseTreeNode; //存储树的根骨架节点
vector<BranchST> OriginalTreeBranch; //初始的树分支结构
vector<BranchST> FinalTreeBranch; //重新索引后的树分支结构
//成员函数
int findStartPoint();
void spaceColonizationAlgorithm();
void BranchStartEndCal();
void BranchLevelConstructure();
double CalculateRadii(BranchST &branch);
void writeBranch(char *fileName);
//绘制函数
void createPointList();
void drawPointList();
void createSkeletonList();
void drawSkeletonList();
void createPointLineList();
void drawPointLineList();
//写文件函数
void writeSkeleton();
void translateTreeCenter();
void findTreeCenter();
public:
SpaceColonization();
~SpaceColonization();
void LoadPointCloud();
void drawPoint();
void drawSkeleton();
void drawPointLine();
void drawProcess();
};
#endif // SPACECOLONIZATIONHEADER_H_INCLUDED