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

vuNormalTable Class Reference

The vuNormalTable class can quantize a large set of normals to a smaller collection. More...

#include <vuNormalTable.h>

Collaboration diagram for vuNormalTable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuNormalTable ()
 Default constructor.
 vuNormalTable (const vuNormalTable &inst)
 Copy constructor doing a deep copy.
 ~vuNormalTable ()
 Destructor.
void setCollection (const float *n, dword size)
 Initializes the normal collection to an array of normals.
void initCollection (dword size)
 Initializes the normal collection to the given size of zero normals.
void addToCollection (const float *n)
 Adds a normal to the collection.
void computeTable (void)
 Computes the quantized normal table.
void destroyTable (void)
 Destroys the allocated normal table and frees memory.
dword findNearest (const float *n)
 Returns the index of the nearest normal that's in the table.
vuNormalTableoperator= (const vuNormalTable &rhs)
 An assignment operator which does a deep copy.
const floatoperator[] (dword index)
 An access operator into the normal table.

Private Attributes

vuNormalBlockm_Block
 The block of quantized normals.
floatm_Table
dword m_Size
 The size of the normal table.

Detailed Description

The vuNormalTable class can quantize a large set of normals to a smaller collection.

Definition at line 9 of file vuNormalTable.h.


Constructor & Destructor Documentation

vuNormalTable::vuNormalTable  ) 
 

Default constructor.

Definition at line 19 of file vuNormalTable.cpp.

References m_Block, m_Size, and m_Table.

vuNormalTable::vuNormalTable const vuNormalTable inst  ) 
 

Copy constructor doing a deep copy.

Definition at line 26 of file vuNormalTable.cpp.

References dword, m_Block, m_Size, and m_Table.

vuNormalTable::~vuNormalTable  ) 
 

Destructor.

Definition at line 40 of file vuNormalTable.cpp.


Member Function Documentation

void vuNormalTable::addToCollection const float n  ) 
 

Adds a normal to the collection.

Definition at line 71 of file vuNormalTable.cpp.

References vuNormalBlock::addNormal(), and m_Block.

Referenced by vu1112111::preprocess(), vu1512111::preprocess(), and vu1112115::preprocess().

Here is the call graph for this function:

void vuNormalTable::computeTable void   ) 
 

Computes the quantized normal table.

Definition at line 76 of file vuNormalTable.cpp.

References vuNormalBlock::computeAverage(), vuNormalBlock::computeStats(), dword, vuNormalBlock::getRange(), vuNormalBlock::getStdDev(), m_Block, BList::m_data, BList::m_next, m_Size, m_Table, and vuNormalBlock::medianSplit().

Referenced by vu1112111::preprocess(), vu1512111::preprocess(), and vu1112115::preprocess().

Here is the call graph for this function:

void vuNormalTable::destroyTable void   ) 
 

Destroys the allocated normal table and frees memory.

Definition at line 159 of file vuNormalTable.cpp.

References m_Table.

dword vuNormalTable::findNearest const float n  ) 
 

Returns the index of the nearest normal that's in the table.

This method goes through the quantized normal table and finds the normal that's closest in length to the the one passed in.

Returns:
The index of the nearest normal.

Definition at line 168 of file vuNormalTable.cpp.

References dword, m_Size, m_Table, and min.

Referenced by vu1112111::preprocess(), vu1512111::preprocess(), and vu1112115::preprocess().

void vuNormalTable::initCollection dword  size  ) 
 

Initializes the normal collection to the given size of zero normals.

Parameters:
size The number of normals to assign to the collection.

Definition at line 62 of file vuNormalTable.cpp.

References dword, m_Block, m_Size, vuNormalBlock::setSize(), and size.

Referenced by vu1112111::preprocess(), vu1512111::preprocess(), and vu1112115::preprocess().

Here is the call graph for this function:

vuNormalTable & vuNormalTable::operator= const vuNormalTable rhs  ) 
 

An assignment operator which does a deep copy.

Definition at line 191 of file vuNormalTable.cpp.

References dword, m_Block, and m_Table.

const float * vuNormalTable::operator[] dword  index  ) 
 

An access operator into the normal table.

Definition at line 208 of file vuNormalTable.cpp.

References dword, and m_Table.

void vuNormalTable::setCollection const float n,
dword  size
 

Initializes the normal collection to an array of normals.

Parameters:
n An array of normals to add to the collection.
size The number of normals in the float array.

Definition at line 48 of file vuNormalTable.cpp.

References vuNormalBlock::addNormal(), dword, m_Block, m_Size, vuNormalBlock::setSize(), and size.

Here is the call graph for this function:


Member Data Documentation

vuNormalBlock* vuNormalTable::m_Block [private]
 

The block of quantized normals.

Definition at line 50 of file vuNormalTable.h.

Referenced by addToCollection(), computeTable(), initCollection(), operator=(), setCollection(), and vuNormalTable().

dword vuNormalTable::m_Size [private]
 

The size of the normal table.

Definition at line 54 of file vuNormalTable.h.

Referenced by computeTable(), findNearest(), initCollection(), setCollection(), and vuNormalTable().

float* vuNormalTable::m_Table [private]
 

Definition at line 52 of file vuNormalTable.h.

Referenced by computeTable(), destroyTable(), findNearest(), operator=(), operator[](), and vuNormalTable().


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