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
|
#ifndef _TEMPARRAY_H_
#define _TEMPARRAY_H_
#include "Cubehole.h"
#include "gl.h"
class Temparray
{
public:
Temparray(float initialtemp, int size0[3]){
float *temperature = new float[size0[0]][size0[1]][size0[2]][4][6];
Cubehole *cubearray = new Cubehole[size0[0]][size0[1]][size0[2]];
tempInit(initialtemp, size0);
size[0] = size0[0]; size[1] = size0[1];size[2] = size0[2];
}
~Temparray(){
delete[] temperature;
delete[] cubearray;
}
void setTemp(float temp, int x, int y, int z, int direct, int pos){
temperature[x][y][z][direct][pos] = temp;
}
void deactivateCube(int x, int y, int z){
for(int i=0; i<4; i++){
for(int j=0; j<6; j++){
setTemp(-100, x, y, z, i, j);
}
}
}
void display();
private:
float *temperature;
Cubehole *cubearray;
int size[3];
void tempInit(float temp0, int size0[3]){
for(int i=0; i<size0[0]; i++){
for(int j=0; j<size0[1]; j++){
for(int k=0; k<size0[2]; k++){
for(int l=0; l<4; l++){
for(int m=0; m<6; m++){
setTemp(temp0, i, j, k, l, m);
}
}
}
}
}
}
};
#endif /* _TEMPARRAY_H_ */
|