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

vuNormalBlock Class Reference

#include <vuNormalBlock.h>

Collaboration diagram for vuNormalBlock:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuNormalBlock ()
 Default constructor creating a null table.
 vuNormalBlock (const vuNormalBlock &inst)
 Copy constructor doing a deep copy.
 ~vuNormalBlock ()
 Destructor.
void setSize (dword size)
 Sets the size of the normal block.
dword getSize (void) const
 Returns the size of the normal block.
float getRange (void) const
 Returns the range of the normals.
float getStdDev (void) const
 Returns the standard deviation between the normals.
void addNormal (const float *norm)
 Adds a normal to the normal block.
void computeStats (void)
 Computes the range and standard deviation of the normals.
bool medianSplit (vuNormalBlock &left, vuNormalBlock &right)
 Splits the normal block about the median.
void computeAverage (float *f) const
 Computes the average length of the normals.
vuNormalBlockoperator= (const vuNormalBlock &rhs)
 An assignment operator doing a deep copy.

Private Member Functions

int Partition (int p, int r)
 this performs a quicksort partition on m_dim,
int RandomPartition (int p, int r)
void QuickSort (int p, int r)
 this will perform a quicksort on the elements between p and r (inclusive)

Private Attributes

dword m_Size
 the size of the block
dword m_Current
 the current element that you are looking at
floatm_Norms
 the buffer that stores the normals
dword m_Dim
 the dimension that is being looked at currently (ie, 0, 1, or 2)
float m_Range
 the range of the normals
float m_StdDev
 the standard deviation between the normals

Constructor & Destructor Documentation

vuNormalBlock::vuNormalBlock  ) 
 

Default constructor creating a null table.

Definition at line 5 of file vuNormalBlock.cpp.

References m_Current, m_Dim, m_Norms, m_Range, m_Size, and m_StdDev.

vuNormalBlock::vuNormalBlock const vuNormalBlock inst  ) 
 

Copy constructor doing a deep copy.

Definition at line 15 of file vuNormalBlock.cpp.

References dword, m_Current, m_Dim, m_Norms, m_Range, m_Size, and m_StdDev.

vuNormalBlock::~vuNormalBlock  ) 
 

Destructor.

Definition at line 30 of file vuNormalBlock.cpp.


Member Function Documentation

void vuNormalBlock::addNormal const float norm  ) 
 

Adds a normal to the normal block.

Definition at line 64 of file vuNormalBlock.cpp.

References m_Current, and m_Norms.

Referenced by vuNormalTable::addToCollection(), and vuNormalTable::setCollection().

void vuNormalBlock::computeAverage float f  )  const
 

Computes the average length of the normals.

Definition at line 168 of file vuNormalBlock.cpp.

References dword, m_Norms, and m_Size.

Referenced by vuNormalTable::computeTable().

void vuNormalBlock::computeStats void   ) 
 

Computes the range and standard deviation of the normals.

Definition at line 71 of file vuNormalBlock.cpp.

References dword, m_Dim, m_Norms, m_Range, m_Size, m_StdDev, max, and min.

Referenced by vuNormalTable::computeTable(), and medianSplit().

float vuNormalBlock::getRange void   )  const
 

Returns the range of the normals.

Definition at line 54 of file vuNormalBlock.cpp.

Referenced by vuNormalTable::computeTable().

dword vuNormalBlock::getSize void   )  const
 

Returns the size of the normal block.

Definition at line 49 of file vuNormalBlock.cpp.

References dword.

float vuNormalBlock::getStdDev void   )  const
 

Returns the standard deviation between the normals.

Definition at line 59 of file vuNormalBlock.cpp.

Referenced by vuNormalTable::computeTable().

bool vuNormalBlock::medianSplit vuNormalBlock left,
vuNormalBlock right
 

Splits the normal block about the median.

Definition at line 120 of file vuNormalBlock.cpp.

References computeStats(), dword, m_Norms, m_Size, QuickSort(), and setSize().

Referenced by vuNormalTable::computeTable().

Here is the call graph for this function:

vuNormalBlock & vuNormalBlock::operator= const vuNormalBlock rhs  ) 
 

An assignment operator doing a deep copy.

Definition at line 192 of file vuNormalBlock.cpp.

References dword, m_Current, m_Norms, m_Range, m_Size, and m_StdDev.

int vuNormalBlock::Partition int  p,
int  r
[private]
 

this performs a quicksort partition on m_dim,

ie, this will m_th component of each element between p and r (inclusive) in the block and will swap elements to ensure that the all elements that have an m_th component less than the initial m_th component at position p will be before all other elements in the range of p..r

Definition at line 213 of file vuNormalBlock.cpp.

References m_Norms.

Referenced by RandomPartition().

void vuNormalBlock::QuickSort int  p,
int  r
[private]
 

this will perform a quicksort on the elements between p and r (inclusive)

Definition at line 250 of file vuNormalBlock.cpp.

References RandomPartition().

Referenced by medianSplit().

Here is the call graph for this function:

int vuNormalBlock::RandomPartition int  p,
int  r
[private]
 

Definition at line 238 of file vuNormalBlock.cpp.

References m_Norms, and Partition().

Referenced by QuickSort().

Here is the call graph for this function:

void vuNormalBlock::setSize dword  size  ) 
 

Sets the size of the normal block.

Definition at line 36 of file vuNormalBlock.cpp.

References dword, m_Current, m_Norms, m_Range, m_Size, m_StdDev, and size.

Referenced by vuNormalTable::initCollection(), medianSplit(), and vuNormalTable::setCollection().


Member Data Documentation

dword vuNormalBlock::m_Current [private]
 

the current element that you are looking at

Definition at line 58 of file vuNormalBlock.h.

Referenced by addNormal(), operator=(), setSize(), and vuNormalBlock().

dword vuNormalBlock::m_Dim [private]
 

the dimension that is being looked at currently (ie, 0, 1, or 2)

Definition at line 60 of file vuNormalBlock.h.

Referenced by computeStats(), and vuNormalBlock().

float* vuNormalBlock::m_Norms [private]
 

the buffer that stores the normals

Definition at line 59 of file vuNormalBlock.h.

Referenced by addNormal(), computeAverage(), computeStats(), medianSplit(), operator=(), Partition(), RandomPartition(), setSize(), and vuNormalBlock().

float vuNormalBlock::m_Range [private]
 

the range of the normals

Definition at line 61 of file vuNormalBlock.h.

Referenced by computeStats(), operator=(), setSize(), and vuNormalBlock().

dword vuNormalBlock::m_Size [private]
 

the size of the block

Definition at line 57 of file vuNormalBlock.h.

Referenced by computeAverage(), computeStats(), medianSplit(), operator=(), setSize(), and vuNormalBlock().

float vuNormalBlock::m_StdDev [private]
 

the standard deviation between the normals

Definition at line 62 of file vuNormalBlock.h.

Referenced by computeStats(), operator=(), setSize(), and vuNormalBlock().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:00 2004 for vuVolume by  doxygen 1.3.9.1