From 85939636049685a2bed67110bd9e8bb663069954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Wed, 23 Dec 2009 22:14:16 +0100 Subject: =?UTF-8?q?Temperaturinitialisierung=20und=20Temperatur=C3=A4nderu?= =?UTF-8?q?ng=20von=20Temparray=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temparray.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Temparray.h b/Temparray.h index 05be3a0..6afbe3c 100644 --- a/Temparray.h +++ b/Temparray.h @@ -2,22 +2,43 @@ #define _TEMPARRAY_H_ #include "Cubehole.h" +#include "gl.h" class Temparray { public: - Temparray(float initialtemp, int size0[3]){ - teperature = new float[size0[0]][size0[0]][size0[0]][4][6]; - cubearray = new Cubehole[size0[0]][size0[0]][size0[0]]; + Temparray(float initialtemp, int size[3]){ + teperature = new float[size[0]][size[1]][size[2]][4][6]; + cubearray = new Cubehole[size[0]][size[1]][size[2]]; + tempInit(initialtemp, size); } ~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 display(); + private: float *temperature = 0; Cubehole *cubearray = 0; + + void tempInit(float temp0, int size[3]){ + for(int i=0; i