UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites > Class Template Reference

#include <UT_VoxelArray.h>

List of all members.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

T * myCurLine
T * myCacheLine
T * myAllocCacheLine
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.
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 TestForWrites>
class UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >

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.

Examples:

SIM/SIM_GasAdd.C.

Definition at line 1013 of file UT_VoxelArray.h.


Constructor & Destructor Documentation

template<typename T , bool DoRead, bool DoWrite, bool TestForWrites>
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::UT_VoxelProbe (  )  [inline]

UT_VoxelProbe methods

Definition at line 2607 of file UT_VoxelArray.C.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::UT_VoxelProbe ( UT_VoxelArray< T > *  vox,
int  prex = 0,
int  postx = 0 
) [inline]

Definition at line 2615 of file UT_VoxelArray.C.

template<typename T , bool DoRead, bool DoWrite, bool TestForWrites>
UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::~UT_VoxelProbe (  )  [inline, virtual]

Definition at line 2626 of file UT_VoxelArray.C.


Member Function Documentation

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

Blindly advances our current pointer.

Definition at line 1051 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::buildConstantCache ( value  )  [inline, protected]

Definition at line 2977 of file UT_VoxelArray.C.

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

Definition at line 1026 of file UT_VoxelArray.h.

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

Examples:
SIM/SIM_GasAdd.C.

Definition at line 1022 of file UT_VoxelArray.h.

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

Definition at line 2713 of file UT_VoxelArray.C.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::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 1060 of file UT_VoxelArray.h.

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

Examples:
SIM/SIM_GasAdd.C.

Definition at line 2641 of file UT_VoxelArray.C.

template<typename T , bool DoRead, bool DoWrite, bool TestForWrites>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::setIndex ( int  x,
int  y,
int  z 
) [inline]

Definition at line 2670 of file UT_VoxelArray.C.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
template<typename S >
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::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

Examples:
SIM/SIM_GasAdd.C.

Definition at line 1045 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::setValue ( value  )  [inline]

Definition at line 1031 of file UT_VoxelArray.h.

template<typename T , bool DoRead, bool DoWrite, bool TestForWrites>
void UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::writeCacheLine (  )  [inline, protected]

Definition at line 3005 of file UT_VoxelArray.C.


Friends And Related Function Documentation

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
friend class UT_VoxelProbeCube< T > [friend]

Definition at line 1095 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
friend class UT_VoxelProbeFace< T > [friend]

Definition at line 1096 of file UT_VoxelArray.h.


Member Data Documentation

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
T* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myAllocCacheLine [protected]

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

Definition at line 1080 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
UT_VoxelArray<T>* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myArray [protected]

Definition at line 1093 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
T* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myCacheLine [protected]

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

Definition at line 1077 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
T* UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myCurLine [protected]

Definition at line 1074 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myDirty [protected]

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

Definition at line 1091 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
bool UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myForceCopy [protected]

Definition at line 1085 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myMaxValidX [protected]

Definition at line 1087 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myMinValidX [protected]

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

Definition at line 1087 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myPostX [protected]

Definition at line 1083 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myPreX [protected]

Definition at line 1083 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myStride [protected]

Definition at line 1084 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myX [protected]

Definition at line 1082 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myY [protected]

Definition at line 1082 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrites>
int UT_VoxelProbe< T, DoRead, DoWrite, TestForWrites >::myZ [protected]

Definition at line 1082 of file UT_VoxelArray.h.


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

Generated on Fri May 25 00:10:56 2012 for HDK by  doxygen 1.5.9