00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __RE_Texture3DMap_h__
00020 #define __RE_Texture3DMap_h__
00021
00022
00023 #include "RE_API.h"
00024 #include "RE_Texture2DMap.h"
00025
00026 class UT_Vector4;
00027 template <class T> class UT_VoxelArray;
00028 class re_Tex3D;
00029
00030 class RE_API RE_Texture3DMap
00031 {
00032 public:
00033
00034 RE_Texture3DMap();
00035 virtual ~RE_Texture3DMap();
00036
00037
00038 void setMap(const char *mapname);
00039
00040 void setVoxels(const UT_VoxelArray<UT_Vector4> *voxels);
00041
00042 int getIndex() const { return myIndex; }
00043
00044 void setBorders(int f) { hasBorders = f; }
00045 void setClamped(int f)
00046 {
00047 isClamped = f;
00048 }
00049 void setMipMapped(int f)
00050 {
00051 useMipMaps = f;
00052 }
00053
00054 int getBorders() const { return hasBorders; }
00055 int getClamped() const { return isClamped; }
00056 int getMipMapped() const { return useMipMaps; }
00057
00058 void setBorderColor(float r, float g, float b, float a)
00059 {
00060 if (myBorderColor[0] != r || myBorderColor[1] != g ||
00061 myBorderColor[2] != b || myBorderColor[3] != a)
00062 {
00063 myBorderColor[0] = r;
00064 myBorderColor[1] = g;
00065 myBorderColor[2] = b;
00066 myBorderColor[3] = a;
00067 }
00068 }
00069
00070 const float *getBorderColor() const { return myBorderColor; }
00071
00072 void setMaxRes(int xmax, int ymax, int zmax)
00073 {
00074 myMaxRes[0] = xmax;
00075 myMaxRes[1] = ymax;
00076 myMaxRes[2] = zmax;
00077 }
00078 const int *getMaxRes() const { return myMaxRes; }
00079 const int *getRes() const { return myRes; }
00080
00081
00082
00083
00084
00085
00086 int setMinFilter( RE_TexFiltType t );
00087 RE_TexFiltType getMinFilter() const { return myMinFilter; }
00088
00089 int setMagFilter( RE_TexFiltType t );
00090 RE_TexFiltType getMagFilter() const { return myMagFilter; }
00091
00092
00093 private:
00094 re_Tex3D *myTex;
00095 float myBorderColor[4];
00096 int myIndex;
00097 int myMaxRes[3];
00098 int myRes[3];
00099
00100 RE_TexFiltType myMinFilter;
00101 RE_TexFiltType myMagFilter;
00102
00103 unsigned int isClamped :1,
00104 useMipMaps:1,
00105 hasBorders:1,
00106 ownData:1;
00107 };
00108
00109 #endif