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)
 
virtual ~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.

Examples:
SIM/SIM_GasAdd.C.

Definition at line 77 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>
virtual UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::~UT_VoxelProbe ( )
virtual

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 1922 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 1886 of file UT_VoxelArray.h.

template<typename T, bool DoRead, bool DoWrite, bool TestForWrite>
T UT_VoxelProbe< T, DoRead, DoWrite, TestForWrite >::getValue ( ) const
inline
Examples:
SIM/SIM_GasAdd.C.

Definition at line 1890 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 1894 of file UT_VoxelArray.h.

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

Definition at line 1888 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 1931 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
Examples:
SIM/SIM_GasAdd.C.

Definition at line 1879 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

Examples:
SIM/SIM_GasAdd.C.

Definition at line 1913 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 1916 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 1899 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 1966 of file UT_VoxelArray.h.

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

Definition at line 1967 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 1951 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 1964 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 1948 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 1945 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 1962 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 1956 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 1958 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 1958 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 1954 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 1954 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 1955 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 1953 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 1953 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 1953 of file UT_VoxelArray.h.


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