Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuNormalBlock.h

Go to the documentation of this file.
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         /* this performs a quicksort partition except that it randomly picks the element that it will pivot on
00049 
00050         ie, it picks a random element between p and r (inclusive)and swaps that element with element p and performs a partition
00051         on p..r. */
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

Generated on Wed Dec 15 21:20:35 2004 for vuVolume by  doxygen 1.3.9.1