-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (36 loc) · 1.06 KB
/
main.cpp
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
#include <iostream>
#include "src/Octree/OctreeNode.h"
#include "src/MeshData/MeshData.h"
using namespace std;
int main(int argc, char *argv[])
{
// preset a indepth
unsigned int inDepth = 1;
// check argument
if(argc>1)
{
// convert char to number
inDepth = (unsigned int) atoi(argv[1]);
}
// Create a tree
OctreeNode * newTree = new OctreeNode(Vect3(1024.0f,1024.0f,1024.0f));
MeshData newData;
newData.CreateMeshData(Shape::Terrain);
std::cout << "Get data" << std::endl;
std::vector<PointV3> data = newData.GetData();
std::cout << "Init point data" << std::endl;
newTree->InitPointData(data);
std::cout << "Build tree data" << std::endl;
newTree->BuildTreeFromData();
std::cout << "Print tree data" << std::endl;
newTree->PrintAllFromData();
// delete
delete newTree;
return 0;
}
// set depth base on input
//int BuildDepth = inDepth;
// build tree
//newTree->BuildTree(BuildDepth);
// print results
//newTree->PrintDepth(BuildDepth);