00001 #ifndef _VUNORMALBLOCK_H_
00002 #define _VUNORMALBLOCK_H_
00003
00004 #include "vuSimpleTypes.h"
00005
00006 class vuNormalBlock
00007 {
00008 public:
00010 vuNormalBlock();
00012 vuNormalBlock(const vuNormalBlock& inst);
00014 ~vuNormalBlock();
00015
00017 void setSize(dword size);
00019 dword getSize(void) const;
00021 float getRange(void) const;
00023 float getStdDev(void) const;
00024
00026 void addNormal(const float* norm);
00027
00029 void computeStats(void);
00031 bool medianSplit(vuNormalBlock& left, vuNormalBlock& right);
00033 void computeAverage(float* f) const;
00034
00036 vuNormalBlock& operator=(const vuNormalBlock& rhs);
00037
00038 private:
00039
00047 int Partition(int p, int r);
00048
00049
00050
00051
00052 int RandomPartition(int p, int r);
00054 void QuickSort(int p, int r);
00055
00056 private:
00057 dword m_Size;
00058 dword m_Current;
00059 float* m_Norms;
00060 dword m_Dim;
00061 float m_Range;
00062 float m_StdDev;
00063 };
00064
00065 #endif