#include <UT_VoxelArray.h>
Public Types | |
| enum | CompressionType { COMPRESS_RAW, COMPRESS_RAWFULL, COMPRESS_CONSTANT, COMPRESS_ENGINE } |
Public Member Functions | |
| UT_VoxelTile (int xres, int yres, int zres) | |
| virtual | ~UT_VoxelTile () |
| UT_VoxelTile (const UT_VoxelTile< T > &src) | |
| const UT_VoxelTile< T > & | operator= (const UT_VoxelTile< T > &src) |
| T | operator() (int x, int y, int z) const |
| T | lerp (int x, int y, int z, float fx, float fy, float fz) const |
| T * | fillCacheLine (T *cacheline, int &stride, int x, int y, int z, bool forcecopy, bool strideofone) const |
| void | writeCacheLine (T *cacheline, int y, int z) |
| Fills a cache line from an external buffer into our own data. | |
| void | setValue (int x, int y, int z, T t) |
| void | findMinMax (T &min, T &max) const |
| Finds the minimum and maximum T values. | |
| bool | isConstant () const |
| Returns if this tile is constant. | |
| bool | isRaw () const |
| Returns if this tile is in raw format. | |
| bool | isRawFull () const |
| Returns if this tile is in raw full format. | |
| bool | tryCompress (fpreal tolerance) |
| void | makeConstant (T t) |
| Turns this tile into a constant tile of the given value. | |
| void | uncompress () |
| Turns a compressed tile into a raw tile. | |
| void | uncompressFull () |
| Turns a tile into a raw full tile. | |
| T * | rawFullData () |
| Returns the raw full data of the tile. | |
| int | xres () const |
| Read the current resolution. | |
| int | yres () const |
| int | zres () const |
| int | getRes (int dim) const |
| int64 | getMemoryUsage () const |
| Returns the amount of memory used by this tile. | |
| int64 | getDataLength () const |
| Returns the amount of data used by the tile myData pointer. | |
| void | weightedSum (int pstart[3], int pend[3], float *weights[3], int start[3], T &result) |
| void | save (ostream &os) |
| void | load (UT_IStream &is, const UT_IntArray &compression) |
Static Public Member Functions | |
| static T | lerpValues (T v1, T v2, fpreal32 bias) |
| Lerps two numbers, templated to work with T. | |
| static void | expandMinMax (T v, T &min, T &max) |
| Designed to be specialized according to T. | |
| static fpreal | dist (T a, T b) |
| static void | registerCompressionEngine (UT_VoxelTileCompress< T > *engine) |
| static int | lookupCompressionEngine (const char *name) |
| static UT_VoxelTileCompress< T > * | getCompressionEngine (int index) |
| static void | saveCompressionTypes (ostream &os) |
| Stores a list of compresson engines to os. | |
| static void | loadCompressionTypes (UT_IStream &is, UT_IntArray &compressions) |
Public Attributes | |
| void * | myData |
Protected Member Functions | |
| bool | writeThrough (int x, int y, int z, T t) |
Friends | |
| class | UT_VoxelTileCompress< T > |
| class | UT_VoxelProbe |
A UT_VoxelArray is composed of a number of these tiles. This is done for two reasons: 1) Increased memory locality when processing neighbouring points. 2) Ability to compress or page out unneeded tiles. Currently, the only special ability is the ability to create constant tiles.
To the end user of the UT_VoxelArray, the UT_VoxelTile should be usually transparent. The only exception may be if they want to do a FOR_ALL_TILES in order to ensure an optimal traversal order.
Definition at line 223 of file UT_VoxelArray.h.
| enum UT_VoxelTile::CompressionType |
Definition at line 235 of file UT_VoxelArray.h.
| UT_VoxelTile< T >::UT_VoxelTile | ( | int | xres, | |
| int | yres, | |||
| int | zres | |||
| ) | [inline] |
Definition at line 57 of file UT_VoxelArray.C.
| UT_VoxelTile< T >::~UT_VoxelTile | ( | ) | [inline, virtual] |
Definition at line 74 of file UT_VoxelArray.C.
| UT_VoxelTile< T >::UT_VoxelTile | ( | const UT_VoxelTile< T > & | src | ) | [inline] |
Definition at line 80 of file UT_VoxelArray.C.
| static fpreal UT_VoxelTile< T >::dist | ( | T | a, | |
| T | b | |||
| ) | [inline, static] |
Return the "distance" of a & b. This is used for tolerance checks on equality comparisons.
Definition at line 369 of file UT_VoxelArray.h.
| static void UT_VoxelTile< T >::expandMinMax | ( | T | v, | |
| T & | min, | |||
| T & | max | |||
| ) | [inline, static] |
Designed to be specialized according to T.
Update min & max to encompass T itself.
Definition at line 362 of file UT_VoxelArray.h.
| T * UT_VoxelTile< T >::fillCacheLine | ( | T * | cacheline, | |
| int & | stride, | |||
| int | x, | |||
| int | y, | |||
| int | z, | |||
| bool | forcecopy, | |||
| bool | strideofone | |||
| ) | const [inline] |
Returns a cached line to our internal data, at local address x,y,z. cacheline is a caller allocated structure to fill out if we have to decompress. If forcecopy isn't set and we can, the result may be an internal pointer. stride is set to the update for moving one x position in the cache. strideofone should be set to true if you want to prevent 0 stride results for constant tiles.
Definition at line 323 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::findMinMax | ( | T & | min, | |
| T & | max | |||
| ) | const [inline] |
| UT_VoxelTileCompress< T > * UT_VoxelTile< T >::getCompressionEngine | ( | int | index | ) | [inline, static] |
Definition at line 921 of file UT_VoxelArray.C.
| int64 UT_VoxelTile< T >::getDataLength | ( | ) | const [inline] |
Returns the amount of data used by the tile myData pointer.
Definition at line 734 of file UT_VoxelArray.C.
| int64 UT_VoxelTile< T >::getMemoryUsage | ( | void | ) | const [inline] |
| int UT_VoxelTile< T >::getRes | ( | int | dim | ) | const [inline] |
Definition at line 342 of file UT_VoxelArray.h.
| bool UT_VoxelTile< T >::isConstant | ( | ) | const [inline] |
| bool UT_VoxelTile< T >::isRaw | ( | ) | const [inline] |
| bool UT_VoxelTile< T >::isRawFull | ( | ) | const [inline] |
| T UT_VoxelTile< T >::lerp | ( | int | x, | |
| int | y, | |||
| int | z, | |||
| float | fx, | |||
| float | fy, | |||
| float | fz | |||
| ) | const [inline] |
Does a trilinear interpolation. x,y,z should be local to this as should x+1, y+1, and z+1. fx-fz should be 0..1.
Definition at line 168 of file UT_VoxelArray.C.
| static T UT_VoxelTile< T >::lerpValues | ( | T | v1, | |
| T | v2, | |||
| fpreal32 | bias | |||
| ) | [inline, static] |
| void UT_VoxelTile< T >::load | ( | UT_IStream & | is, | |
| const UT_IntArray & | compression | |||
| ) | [inline] |
Loads tile data. Uses the compression index to map the saved compression types into the correct loading compression types.
Definition at line 977 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::loadCompressionTypes | ( | UT_IStream & | is, | |
| UT_IntArray & | compressions | |||
| ) | [inline, static] |
Builds a translation table from the given stream's compression types into our own valid compression types.
Definition at line 1063 of file UT_VoxelArray.C.
| int UT_VoxelTile< T >::lookupCompressionEngine | ( | const char * | name | ) | [inline, static] |
Definition at line 901 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::makeConstant | ( | T | t | ) | [inline] |
Turns this tile into a constant tile of the given value.
Definition at line 709 of file UT_VoxelArray.C.
| T UT_VoxelTile< T >::operator() | ( | int | x, | |
| int | y, | |||
| int | z | |||
| ) | const [inline] |
Fetch a given local value. (x,y,z) should be local to this tile.
Definition at line 245 of file UT_VoxelArray.h.
| const UT_VoxelTile< T > & UT_VoxelTile< T >::operator= | ( | const UT_VoxelTile< T > & | src | ) | [inline] |
Definition at line 90 of file UT_VoxelArray.C.
| T* UT_VoxelTile< T >::rawFullData | ( | ) | [inline] |
| void UT_VoxelTile< T >::registerCompressionEngine | ( | UT_VoxelTileCompress< T > * | engine | ) | [inline, static] |
Definition at line 882 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::save | ( | ostream & | os | ) | [inline] |
Saves this tile's data, in compressed form. May uncompress itself if the engine doesn't support saving.
Definition at line 930 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::saveCompressionTypes | ( | ostream & | os | ) | [inline, static] |
| void UT_VoxelTile< T >::setValue | ( | int | x, | |
| int | y, | |||
| int | z, | |||
| T | t | |||
| ) | [inline] |
The setData is intentionally seperate so we can avoid expanding constant data when we write the same value to it.
Definition at line 442 of file UT_VoxelArray.C.
| bool UT_VoxelTile< T >::tryCompress | ( | fpreal | tolerance | ) | [inline] |
Attempts to compress this tile. Returns true if any compression performed.
Definition at line 672 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::uncompress | ( | ) | [inline] |
| void UT_VoxelTile< T >::uncompressFull | ( | ) | [inline] |
| void UT_VoxelTile< T >::weightedSum | ( | int | pstart[3], | |
| int | pend[3], | |||
| float * | weights[3], | |||
| int | start[3], | |||
| T & | result | |||
| ) | [inline] |
A routine used by filtered evaluation to accumulated a partial filtered sum in this tile. pstart, pend - voxel bounds (in UT_VoxelArray coordinates) weights - weight array start - UT_VoxelArray coordinates at [0] in the weight array
Definition at line 763 of file UT_VoxelArray.C.
| void UT_VoxelTile< T >::writeCacheLine | ( | T * | cacheline, | |
| int | y, | |||
| int | z | |||
| ) | [inline] |
Fills a cache line from an external buffer into our own data.
Definition at line 389 of file UT_VoxelArray.C.
| bool UT_VoxelTile< T >::writeThrough | ( | int | x, | |
| int | y, | |||
| int | z, | |||
| T | t | |||
| ) | [inline, protected] |
Definition at line 137 of file UT_VoxelArray.C.
| int UT_VoxelTile< T >::xres | ( | ) | const [inline] |
| int UT_VoxelTile< T >::yres | ( | ) | const [inline] |
Definition at line 339 of file UT_VoxelArray.h.
| int UT_VoxelTile< T >::zres | ( | ) | const [inline] |
Definition at line 340 of file UT_VoxelArray.h.
friend class UT_VoxelProbe [friend] |
Definition at line 423 of file UT_VoxelArray.h.
friend class UT_VoxelTileCompress< T > [friend] |
Definition at line 421 of file UT_VoxelArray.h.
| void* UT_VoxelTile< T >::myData |
Definition at line 407 of file UT_VoxelArray.h.
1.5.9