#include <UT_VoxelArray.h>
Public Types | |
| enum | mipmaptype { MIPMAP_MAXIMUM = 0, MIPMAP_AVERAGE = 1, MIPMAP_MINIMUM = 2 } |
Public Member Functions | |
| UT_VoxelMipMap () | |
| virtual | ~UT_VoxelMipMap () |
| UT_VoxelMipMap (const UT_VoxelMipMap< T > &src) | |
| Copy constructor. | |
| const UT_VoxelMipMap< T > & | operator= (const UT_VoxelMipMap< T > &src) |
| Assignment operator:. | |
| void | build (UT_VoxelArray< T > *baselevel, mipmaptype function) |
| void | build (UT_VoxelArray< T > *baselevel, const UT_RefArray< mipmaptype > &functions) |
| void | traverseTopDown (bool(*function)(const UT_RefArray< T > &, const UT_BoundingBox &, bool, void *), void *data) const |
| int64 | getMemoryUsage () const |
| Return the amount of memory used by this mipmap. | |
Protected Member Functions | |
| T | mixValues (T t1, T t2, mipmaptype function) const |
Protected Attributes | |
| UT_VoxelArray< T > * | myBaseLevel |
| bool | myOwnBase |
| If true, we will delete the base level when we are done. | |
| int | myNumLevels |
| UT_PtrArray< UT_VoxelArray< T > ** > | myLevels |
This provides a mip-map type structure for a voxel array. It manages the different levels of voxels arrays that are needed. You can create different types of mip maps: average, maximum, etc, which can allow different tricks. Each level is one half the previous level, rounded up. Out of bound voxels are ignored from the lower levels.
Definition at line 697 of file UT_VoxelArray.h.
| enum UT_VoxelMipMap::mipmaptype |
The different types of functions that can be used for constructing a mip map.
Definition at line 702 of file UT_VoxelArray.h.
| UT_VoxelMipMap< T >::UT_VoxelMipMap | ( | ) | [inline] |
Definition at line 1913 of file UT_VoxelArray.C.
| UT_VoxelMipMap< T >::~UT_VoxelMipMap | ( | ) | [inline, virtual] |
Definition at line 1919 of file UT_VoxelArray.C.
| UT_VoxelMipMap< T >::UT_VoxelMipMap | ( | const UT_VoxelMipMap< T > & | src | ) | [inline] |
| void UT_VoxelMipMap< T >::build | ( | UT_VoxelArray< T > * | baselevel, | |
| const UT_RefArray< mipmaptype > & | functions | |||
| ) | [inline] |
Same as above but construct mipmaps simultaneously for more than one function. The order of the functions will correspond to the order of the data values passed to the traversal callback.
Definition at line 1978 of file UT_VoxelArray.C.
| void UT_VoxelMipMap< T >::build | ( | UT_VoxelArray< T > * | baselevel, | |
| mipmaptype | function | |||
| ) | [inline] |
Builds from a given voxel array. The ownership flag determines if we gain ownership of the voxel array and should delete it. In any case, the new levels are owned by us.
Definition at line 1967 of file UT_VoxelArray.C.
| int64 UT_VoxelMipMap< T >::getMemoryUsage | ( | void | ) | const [inline] |
| T UT_VoxelMipMap< T >::mixValues | ( | T | t1, | |
| T | t2, | |||
| mipmaptype | function | |||
| ) | const [inline, protected] |
Definition at line 2089 of file UT_VoxelArray.C.
| const UT_VoxelMipMap< T > & UT_VoxelMipMap< T >::operator= | ( | const UT_VoxelMipMap< T > & | src | ) | [inline] |
| void UT_VoxelMipMap< T >::traverseTopDown | ( | bool(*)(const UT_RefArray< T > &, const UT_BoundingBox &, bool, void *) | function, | |
| void * | data | |||
| ) | const [inline] |
This does a top down traversal of the implicit octtree defined by the voxel array. Returning false will abort that branch of the octree. The bounding box given is in cell space and is an exclusive box of the included cells (ie: (0..1)^3 means just cell 0,0,0) Note that each bounding box will not be square, unless you have the good fortune of starting with a power of 2 cube. The boolean goes true when the the callback is invoked on a base level.
Definition at line 2123 of file UT_VoxelArray.C.
UT_VoxelArray<T>* UT_VoxelMipMap< T >::myBaseLevel [protected] |
This stores the base most level that was provided externally.
Definition at line 760 of file UT_VoxelArray.h.
UT_PtrArray<UT_VoxelArray<T> **> UT_VoxelMipMap< T >::myLevels [protected] |
The array of VoxelArrays, one per level. myLevels[0] is a 1x1x1 array. Each successive layer is twice as big in each each dimension. However, every layer is clamped against the resolution of the base layer. We own all these layers.
Definition at line 772 of file UT_VoxelArray.h.
int UT_VoxelMipMap< T >::myNumLevels [protected] |
Tracks the number of levels which we used to represent this hierarchy.
Definition at line 766 of file UT_VoxelArray.h.
bool UT_VoxelMipMap< T >::myOwnBase [protected] |
If true, we will delete the base level when we are done.
Definition at line 762 of file UT_VoxelArray.h.
1.5.9