00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __UT_Cdf__
00021 #define __UT_Cdf__
00022
00023 #include "UT_API.h"
00024 #include <SYS/SYS_Types.h>
00025 #include "UT_Assert.h"
00026 #include "UT_VoxelArray.h"
00027
00028 class UT_API UT_Cdf
00029 {
00030 public:
00031
00032
00033 UT_Cdf(const UT_VoxelArrayF &voxels);
00034
00035
00036
00037
00038
00039
00040 UT_Cdf(const fpreal *data, const int *res, int dim);
00041 virtual ~UT_Cdf();
00042
00043
00044
00045 void sample(const fpreal *sval, fpreal *dval);
00046
00047
00048 fpreal getScaling()
00049 {
00050 fpreal scale = myCdf[0][myRes[0]-1];
00051 int i;
00052
00053 for (i = 0; i < myDim; i++)
00054 scale /= (fpreal)myRes[i];
00055
00056 return scale;
00057 }
00058
00059 private:
00060 UT_Cdf() {}
00061
00062 void initCdf(int size);
00063
00064 private:
00065 fpreal **myCdf;
00066 int *myRes;
00067 int myDim;
00068 };
00069
00070 #endif