-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstaticcube.cpp
97 lines (67 loc) · 1.85 KB
/
staticcube.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
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
#include "staticcube.hpp"
StaticCube::StaticCube()
{
std::vector<std::vector<std::vector<int>>> vect(SIZE_X,std::vector<std::vector<int>>(SIZE_Y,std::vector<int>(SIZE_Z,0)));
_static_cube = vect;
vect.clear();
}
StaticCube::~StaticCube()
{
}
void StaticCube::print_My_static_cube()
{
std::cout<<_static_cube[0][0][0]<<std::endl;
}
void StaticCube::set_Static_Voxel(int x, int y, int z, int state){
_static_cube[x][y][z] = state;
}
void StaticCube::set_Static_X_Line(int y, int z, int state){
for(int i = 0; i<SIZE_X; i++){
StaticCube::set_Static_Voxel(i, y, z, state);
}
}
void StaticCube::set_Static_Y_Line(int x, int z, int state){
for(int j = 0; j<SIZE_Y; j++){
StaticCube::set_Static_Voxel(x, j, z, state);
}
}
void StaticCube::set_Static_Z_Line(int x, int y, int state){
for(int k = 0; k<SIZE_Z; k++){
StaticCube::set_Static_Voxel(x, y, k, state);
}
}
void StaticCube::set_Static_XY_Plane(int z, int state){
for(int i = 0; i<SIZE_X; i++){
StaticCube::set_Static_Y_Line(i, z, state);
}
}
void StaticCube::set_Static_XZ_Plane(int y, int state){
for(int i = 0; i<SIZE_X; i++){
StaticCube::set_Static_Z_Line(i, y, state);
}
}
void StaticCube::set_Static_YZ_Plane(int x, int state){
for(int j = 0; j<SIZE_Y; j++){
StaticCube::set_Static_Z_Line(x, j, state);
}
}
void StaticCube::set_Static_Cube(int state){
for(int i = 0; i<SIZE_X; i++){
StaticCube::set_Static_YZ_Plane(i, state);
}
}
void StaticCube::set_Static_Cube_High(){
StaticCube::set_Static_Cube(1);
}
void StaticCube::set_Static_Cube_Low(){
StaticCube::set_Static_Cube(0);
}
int StaticCube::get_Static_voxel(int x, int y, int z){
return(_static_cube[x][y][z]);
}
std::vector<std::vector<std::vector<int>>> StaticCube::get_StaticCube(){
return _static_cube;
}
void StaticCube::clear_Static_Voxel(int x, int y, int z){
StaticCube::set_Static_Voxel(x, y, z, 0);
}