HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite > Class Template Reference

#include <UT_VoxelArray.h>

Public Member Functions

 UT_VoxelProbe ()
 
 UT_VoxelProbe (UT_VoxelArray< T > *vox, int prex=0, int postx=0)
 
 ~UT_VoxelProbe ()
 
void setArray (UT_VoxelArray< T > *vox, int prex=0, int postx=0)
 
void setConstArray (const UT_VoxelArray< T > *vox, int prex=0, int postx=0)
 
UT_VoxelArray< T > * getArray () const
 
bool isValid () const
 
T getValue () const
 
T getValue (int offset) const
 
void setValue (T value)
 
template<typename S >
bool setIndex (UT_VoxelArrayIterator< S > &vit)
 
template<typename S >
bool setIndex (UT_VoxelTileIterator< S > &vit)
 
bool setIndex (int x, int y, int z)
 
void advanceX ()
 Blindly advances our current pointer. More...
 
void resetX (int x)
 

Protected Member Functions

void reloadCache (int x, int y, int z)
 
void writeCacheLine ()
 
void buildConstantCache (T value)
 

Protected Attributes

TmyCurLine
 
TmyCacheLine
 
TmyAllocCacheLine
 
int myX
 
int myY
 
int myZ
 
int myPreX
 
int myPostX
 
int myStride
 
bool myForceCopy
 
int myMinValidX
 Half inclusive [,) range of valid x queries for current cache. More...
 
int myMaxValidX
 
bool myDirty
 
UT_VoxelArray< T > * myArray
 

Friends

class UT_VoxelProbeCube< T >
 
class UT_VoxelProbeFace< T >
 

Detailed Description

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
class UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >

Probe for Voxel Arrays

This class is designed to allow for efficient evaluation of aligned indices of a voxel array, provided the voxels are iterated in a tile-by-tile, x-inner most, manner.

This class will create a local copy of the voxel data where needed, uncompressing the information once for every 16 queries. It will also create an aligned buffer so you can safely use v4uf on fpreal32 data.

For queries where you need surrounding values, the prex and postx can specify padding on the probe. prex should be -1 to allow reading -1 offset, postx 1 to allow reading a 1 offset.

Definition at line 81 of file UT_VoxelArray.h.

Constructor & Destructor Documentation

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::UT_VoxelProbe ( )
template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::UT_VoxelProbe ( UT_VoxelArray< T > *  vox,
int  prex = 0,
int  postx = 0 
)
template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::~UT_VoxelProbe ( )

Member Function Documentation

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::advanceX ( )
inline

Blindly advances our current pointer.

Definition at line 2269 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::buildConstantCache ( T  value)
protected
template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
UT_VoxelArray<T>* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::getArray ( ) const
inline

Definition at line 2233 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
T UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::getValue ( ) const
inline

Definition at line 2237 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
T UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::getValue ( int  offset) const
inline

Definition at line 2241 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::isValid ( ) const
inline

Definition at line 2235 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::reloadCache ( int  x,
int  y,
int  z 
)
protected
template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::resetX ( int  x)
inline

Adjusts our current pointer to the given absolute location, assumes the new value is inside our valid range.

Definition at line 2278 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::setArray ( UT_VoxelArray< T > *  vox,
int  prex = 0,
int  postx = 0 
)
template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::setConstArray ( const UT_VoxelArray< T > *  vox,
int  prex = 0,
int  postx = 0 
)
inline

Definition at line 2226 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
template<typename S >
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::setIndex ( UT_VoxelArrayIterator< S > &  vit)
inline

Resets where we currently point to. Returns true if we had to reset our cache line. If we didn't, and you have multiple probes acting in-step, you can just advanceX() the other probes

Definition at line 2260 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
template<typename S >
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::setIndex ( UT_VoxelTileIterator< S > &  vit)
inline

Definition at line 2263 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::setIndex ( int  x,
int  y,
int  z 
)
template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::setValue ( T  value)
inline

Definition at line 2246 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::writeCacheLine ( )
protected

Friends And Related Function Documentation

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
friend class UT_VoxelProbeCube< T >
friend

Definition at line 2313 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
friend class UT_VoxelProbeFace< T >
friend

Definition at line 2314 of file UT_VoxelArray.h.

Member Data Documentation

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
T* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myAllocCacheLine
protected

Where we actually allocated our cache line, aligned to 4x multiple to ensure SSE compatible.

Definition at line 2298 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
UT_VoxelArray<T>* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myArray
protected

Definition at line 2311 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
T* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myCacheLine
protected

myCacheLine[0] is the start of the cache line, so -1 would be the first pre-rolled value

Definition at line 2295 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
T* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myCurLine
protected

Definition at line 2292 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myDirty
protected

Determines if we have anything to write back, only valid if TestForWrites is enabled.

Definition at line 2309 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myForceCopy
protected

Definition at line 2303 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myMaxValidX
protected

Definition at line 2305 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myMinValidX
protected

Half inclusive [,) range of valid x queries for current cache.

Definition at line 2305 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myPostX
protected

Definition at line 2301 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myPreX
protected

Definition at line 2301 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myStride
protected

Definition at line 2302 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myX
protected

Definition at line 2300 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myY
protected

Definition at line 2300 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::myZ
protected

Definition at line 2300 of file UT_VoxelArray.h.


The documentation for this class was generated from the following file: