-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDS_Octree.cpp
More file actions
85 lines (60 loc) · 1.41 KB
/
DS_Octree.cpp
File metadata and controls
85 lines (60 loc) · 1.41 KB
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
/*
* DS_LastNode_Quadtree.cpp
* 3d Ink
*
* Created by David Roberts on 06/07/2010.
*
*/
#include "DataStructure.h"
DS_Octree::DS_Octree(GLfloat width, GLfloat height, GLfloat depth) {
this->width = width;
this->height = height;
this->depth = depth;
root = NULL;
};
DS_Octree::~DS_Octree() {
};
void DS_Octree::addPoint(Point p) {
Area3D a;
a.topLeftForward.x = 0.0;
a.topLeftForward.y = 0.0;
a.topLeftForward.z = Settings::viewingDistance-Settings::gpdBehind;
a.bottomRightBackward.x = width;
a.bottomRightBackward.y = height;
a.bottomRightBackward.z = Settings::viewingDistance+Settings::gpdInFront;
insert(a, NULL, &root, &p);
};
void DS_Octree::insert(Area3D area, ONode *parent, ONode **n, Point *p) {
if ((*n)==NULL) {
(*n)=new ONode((*p));
(*n)->isLeaf = true;
(*n)->parent = parent;
(*n)->N_NW = NULL;
(*n)->N_NE = NULL;
(*n)->N_SW = NULL;
(*n)->N_SE = NULL;
(*n)->F_NW = NULL;
(*n)->F_NE = NULL;
(*n)->F_SW = NULL;
(*n)->F_SE = NULL;
//printf("Made a leaf node at x=%d y=%d \n \n", p->pixelX, p->pixelY);
return;
}
};
void* DS_Octree::getData() {
return this;
};
void DS_Octree::deletePoint(Point p) {
};
void DS_Octree::clearData() {
};
void DS_Octree::drawScene() {
};
void DS_Octree::saveData(FILE *file) {
};
void DS_Octree::loadData(FILE *file) {
};
void DS_Octree::saveXML(string fName) {
}
void DS_Octree::loadXML(XMLNode sketchNode) {
}