From fd1179672c60358ee6caf538d686dab264a84582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Thu, 7 Jan 2010 17:06:32 +0100 Subject: =?UTF-8?q?Dynamische=20Arrays=20ge=C3=A4ndert([a][b][c][d]=20zu?= =?UTF-8?q?=20[a*b*c*d])?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temparray.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'Temparray.h') diff --git a/Temparray.h b/Temparray.h index e730e07..e15ea22 100644 --- a/Temparray.h +++ b/Temparray.h @@ -3,33 +3,30 @@ #include "Cubehole.h" #include "gl.h" +#include class Temparray { public: - Temparray(float initialtemp, int x0, int y0, int z0){ - float *temperature = new float[x0, y0, z0, 6, 4]; - Cubehole *cubearray = new Cubehole[x0, y0, z0, 6]; - tempInit(initialtemp, x0, y0, z0); - size[0] = x0; size[1] = y0; size[2] = z0; - } + Temparray(float initialtemp, int x0, int y0, int z0); ~Temparray(){ delete[] temperature; delete[] cubearray; } void setTemp(float temp, int x, int y, int z, int line, int pos){ - temperature[x, y, z, line, pos] = temp; + temperature[x*size[1]*size[2]*6*4 + y*size[2]*6*4 + z*6*4 + line*4 + pos] = temp; calcAverage(); } -/* void deactivateCube(int x, int y, int z){ + void deactivateCube(int x, int y, int z){ for(int i=0; i<6; i++){ for(int j=0; j<4; j++){ setTemp(-100, x, y, z, i, j); } } - }*/ - void display(); + } + std::list getTriangles(); + void calcTemp(); private: float *temperature; @@ -37,8 +34,7 @@ class Temparray int size[3]; float averagetemp; - void setColor(){ - + void setColor(int x, int y, int z, int line){ } void tempInit(float temp0, int x0, int y0, int z0){ for(int i=0; i