From 349b62dc7563be0817df55f0b4c8db5dfef6642f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Wed, 23 Dec 2009 22:55:41 +0100 Subject: =?UTF-8?q?CMakeLists=20aktualisiert=20und=20fehlerhaftes=20Tempar?= =?UTF-8?q?ray=20ohne=20L=C3=B6sung=20:'-(?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 7 ++----- Temparray.cpp | 5 +++++ Temparray.h | 24 +++++++++++++----------- 3 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 Temparray.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index de4bf01..7b8fd56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,16 +7,13 @@ include_directories(${OPENGL_INCLUDE_DIR}) add_executable(c3d BSPTree.cpp BSPTree.h - Color.h Cubehole.cpp Cubehole.h Cuboid.cpp Cuboid.h DisplayClass.cpp DisplayClass.h gl.h main.cpp - Matrix.h - Triangle.h + Temparray.h Temparray.cpp Trapezocube.cpp Trapezocube.h - Vector.h - Vertex.h + Triangle.h ) target_link_libraries(c3d ${OPENGL_LIBRARIES}) diff --git a/Temparray.cpp b/Temparray.cpp new file mode 100644 index 0000000..06db986 --- /dev/null +++ b/Temparray.cpp @@ -0,0 +1,5 @@ +#include "Temparray.h" + +void Temparray::display(){ + +} diff --git a/Temparray.h b/Temparray.h index 629a4fe..72b5068 100644 --- a/Temparray.h +++ b/Temparray.h @@ -7,10 +7,11 @@ class Temparray { public: - 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(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; @@ -18,7 +19,7 @@ class Temparray } void setTemp(float temp, int x, int y, int z, int direct, int pos){ - temperature[x][y][z][direct][pos]= temp; + temperature[x][y][z][direct][pos] = temp; } void deactivateCube(int x, int y, int z){ for(int i=0; i<4; i++){ @@ -30,13 +31,14 @@ class Temparray void display(); private: - float *temperature = 0; - Cubehole *cubearray = 0; + float *temperature; + Cubehole *cubearray; + int size[3]; - void tempInit(float temp0, int size[3]){ - for(int i=0; i