00001 #ifndef _CELLSPACE_H_NOU_
00002 #define _CELLSPACE_H_NOU_
00003
00004 #include <CL/cl.h>
00005 #include <iostream>
00006 #include <map>
00007 #include <string>
00008
00009 using namespace std;
00010
00011 class Model;
00012
00013 typedef union
00014 {
00015 float f;
00016 int i;
00017 unsigned int ui;
00018 long long l;
00019 unsigned long long ul;
00020 double d;
00021 }Variant;
00022
00023 class CellSpace
00024 {
00025 private:
00026 cl_mem space;
00027 int width,height;
00028 int which;
00029 Model *parent;
00030 map<string, Variant> values;
00031 public:
00032 CellSpace(Model *parent, int w, int h);
00033 ~CellSpace();
00034 void run(int iteration = 1);
00035 Model* getParent(){ return parent; }
00036 cl_mem* getSpace(){ return &space; }
00037 int getWidth(){ return width; }
00038 int getHeight(){ return height; }
00039 void setValue(string key, Variant v);
00040 Variant getValue(string key);
00041 unsigned char* renderToTexture();
00042 protected:
00043 };
00044
00045 #endif // _CELLSPACE_H_NOU_