HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_VoxelArray< T > Class Template Reference

#include <RE_Texture3DMap.h>

Public Member Functions

 UT_VoxelArray ()
 
virtual ~UT_VoxelArray ()
 
 UT_VoxelArray (const UT_VoxelArray< T > &src)
 Copy constructor: More...
 
const UT_VoxelArray< T > & operator= (const UT_VoxelArray< T > &src)
 Assignment operator: More...
 
void size (int xres, int yres, int zres)
 
void match (const UT_VoxelArray< T > &src)
 
template<typename S >
bool isMatching (const UT_VoxelArray< S > &src) const
 
int getXRes () const
 
int getYRes () const
 
int getZRes () const
 
int getRes (int axis) const
 
int64 getMemoryUsage (bool inclusive) const
 Return the amount of memory used by this array. More...
 
 THREADED_METHOD1 (UT_VoxelArray< T >, numTiles() > 100, constant, T, t) void const antPartial(T t
 
bool isConstant (T *cval=0) const
 
bool hasNan () const
 Returns true if any element of the voxel array is NAN. More...
 
T operator() (UT_Vector3D pos) const
 
T operator() (UT_Vector3F pos) const
 
void evaluateMinMax (T &lerp, T &lmin, T &lmax, UT_Vector3F pos) const
 
SYS_FORCE_INLINE T lerpVoxelCoord (UT_Vector3F pos) const
 
SYS_FORCE_INLINE T lerpVoxel (int x, int y, int z, float fx, float fy, float fz) const
 
template<int AXIS2D>
SYS_FORCE_INLINE T lerpVoxelCoordAxis (UT_Vector3F pos) const
 
template<int AXIS2D>
SYS_FORCE_INLINE T lerpVoxelAxis (int x, int y, int z, float fx, float fy, float fz) const
 
SYS_FORCE_INLINE void lerpVoxelCoordMinMax (T &lerp, T &lmin, T &lmax, UT_Vector3F pos) const
 
template<int AXIS2D>
SYS_FORCE_INLINE void lerpVoxelCoordMinMaxAxis (T &lerp, T &lmin, T &lmax, UT_Vector3F pos) const
 
SYS_FORCE_INLINE void lerpVoxelMinMax (T &lerp, T &lmin, T &lmax, int x, int y, int z, float fx, float fy, float fz) const
 
template<int AXIS2D>
SYS_FORCE_INLINE void lerpVoxelMinMaxAxis (T &lerp, T &lmin, T &lmax, int x, int y, int z, float fx, float fy, float fz) const
 
SYS_FORCE_INLINE bool extractSample (int x, int y, int z, T *sample) const
 
template<int AXIS2D>
SYS_FORCE_INLINE bool extractSampleAxis (int x, int y, int z, T *sample) const
 
SYS_FORCE_INLINE bool extractSamplePlus (int x, int y, int z, T *sample) const
 
SYS_FORCE_INLINE bool extractSampleCube (int x, int y, int z, T *sample) const
 
SYS_FORCE_INLINE T lerpSample (T *samples, float fx, float fy, float fz) const
 Lerps the given sample using trilinear interpolation. More...
 
template<int AXIS2D>
SYS_FORCE_INLINE T lerpSampleAxis (T *samples, float fx, float fy, float fz) const
 
SYS_FORCE_INLINE void splitVoxelCoord (UT_Vector3F pos, int &x, int &y, int &z, float &fx, float &fy, float &fz) const
 
template<int AXIS2D>
SYS_FORCE_INLINE void splitVoxelCoordAxis (UT_Vector3F pos, int &x, int &y, int &z, float &fx, float &fy, float &fz) const
 
T evaluate (const UT_Vector3 &pos, const UT_Filter &filter, fpreal radius, int clampaxis=-1) const
 
void resample (const UT_VoxelArray< T > &src, UT_FilterType filtertype=UT_FILTER_POINT, float filterwidthscale=1.0f, int clampaxis=-1)
 Fills this by resampling the given voxel array. More...
 
 THREADED_METHOD3_CONST (UT_VoxelArray< T >, numTiles() > 16, flatten, T *, flatarray, exint, ystride, exint, zstride) void flattenPartial(T *flatarray
 
 THREADED_METHOD4_CONST (UT_VoxelArray< T >, numTiles() > 16, flattenGLFixed8, uint8 *, flatarray, exint, ystride, exint, zstride, T, dummy) void flattenGLFixed8Partial(uint8 *flatarray
 
 THREADED_METHOD4_CONST (UT_VoxelArray< T >, numTiles() > 16, flattenGL16F, UT_Vector4H *, flatarray, exint, ystride, exint, zstride, T, dummy) void flattenGL16FPartial(UT_Vector4H *flatarray
 
 THREADED_METHOD4_CONST (UT_VoxelArray< T >, numTiles() > 16, flattenGL32F, UT_Vector4F *, flatarray, exint, ystride, exint, zstride, T, dummy) void flattenGL32FPartial(UT_Vector4F *flatarray
 
 THREADED_METHOD3 (UT_VoxelArray< T >, numTiles() > 16, extractFromFlattened, const T *, flatarray, exint, ystride, exint, zstride) void extractFromFlattenedPartial(const T *flatarray
 
void copyWithOffset (const UT_VoxelArray< T > &src, int offx, int offy, int offz)
 
 THREADED_METHOD4 (UT_VoxelArray< T >, numTiles() > 4, copyWithOffsetInternal, const UT_VoxelArray< T > &, src, int, offx, int, offy, int, offz) void copyWithOffsetInternalPartial(const UT_VoxelArray< T > &src
 
template<typename S >
SextractTiles (S *dstdata, int stride, const UT_IntArray &tilelist) const
 
template<typename S >
const SwriteTiles (const S *srcdata, int srcstride, const UT_IntArray &tilelist)
 
bool posToIndex (UT_Vector3 pos, int &x, int &y, int &z) const
 
bool posToIndex (UT_Vector3 pos, UT_Vector3 &ipos) const
 
bool indexToPos (int x, int y, int z, UT_Vector3F &pos) const
 
bool indexToPos (int x, int y, int z, UT_Vector3D &pos) const
 
void findexToPos (UT_Vector3F ipos, UT_Vector3F &pos) const
 
void findexToPos (UT_Vector3D ipos, UT_Vector3D &pos) const
 
void clampIndex (int &x, int &y, int &z) const
 
bool isValidIndex (int x, int y, int z) const
 Returns true if the given x, y, z values lie inside the valid index. More...
 
T operator() (int x, int y, int z) const
 
void setValue (int x, int y, int z, T t)
 
T getValue (int x, int y, int z) const
 
void setBorder (UT_VoxelBorderType type, T t)
 
void setBorderScale (T scalex, T scaley, T scalez)
 
UT_VoxelBorderType getBorder () const
 
T getBorderValue () const
 
T getBorderScale (int axis) const
 
 THREADED_METHOD (UT_VoxelArray< T >, numTiles() > 100, collapseAllTiles) void collapseAllTilesPartial(const UT_JobInfo &info)
 
 THREADED_METHOD (UT_VoxelArray< T >, numTiles() > 100, expandAllTiles) void expandAllTilesPartial(const UT_JobInfo &info)
 
 THREADED_METHOD (UT_VoxelArray< T >, numTiles() > 100, expandAllNonConstTiles) void expandAllNonConstTilesPartial(const UT_JobInfo &info)
 
UT_VoxelTile< T > * getTile (int tx, int ty, int tz) const
 
UT_VoxelTile< T > * getLinearTile (int idx) const
 
void linearTileToXYZ (int idx, int &x, int &y, int &z) const
 
int xyzTileToLinear (int x, int y, int z) const
 
int indexToLinearTile (int x, int y, int z) const
 
int getTileRes (int dim) const
 
int numTiles () const
 
exint numVoxels () const
 
void setCompressionOptions (const UT_VoxelCompressOptions &options)
 
const UT_VoxelCompressOptionsgetCompressionOptions () const
 
void setCompressionTolerance (fpreal tol)
 
fpreal getCompressionTolerance () const
 
void saveData (std::ostream &os) const
 
bool saveData (UT_JSONWriter &w, const char *shared_mem_owner=0) const
 
void loadData (UT_IStream &is)
 Load an array, requires you have already size()d this array. More...
 
bool loadData (UT_JSONParser &p)
 
 THREADED_METHOD1 (UT_VoxelArray< T >, numTiles() > 20, copyData, const UT_VoxelArray< T > &, src) void copyDataPartial(const UT_VoxelArray< T > &src
 
template<int AXIS2D>
T lerpVoxelCoordAxis (UT_Vector3F pos) const
 
template<int AXIS2D>
T lerpVoxelAxis (int x, int y, int z, float fx, float fy, float fz) const
 
template<int AXIS2D>
void lerpVoxelCoordMinMaxAxis (T &lerp, T &lmin, T &lmax, UT_Vector3F pos) const
 
template<int AXIS2D>
void lerpVoxelMinMaxAxis (T &lerp, T &smin, T &smax, int x, int y, int z, float fx, float fy, float fz) const
 
template<int AXIS2D>
bool extractSampleAxis (int x, int y, int z, T *samples) const
 
template<int AXIS2D>
T lerpSampleAxis (T *samples, float fx, float fy, float fz) const
 

Public Attributes

const UT_JobInfoinfo
 
exint ystride
 
exint exint zstride
 
exint exint const UT_JobInfo &info const
 
exint exint T dummy
 
exint exint T const UT_JobInfo
&info 
const
 
exint exint const UT_JobInfoinfo
 
int offx
 
int int offy
 
int int int offz
 
int int int const UT_JobInfoinfo
 

Detailed Description

template<class T>
class UT_VoxelArray< T >

UT_VoxelArray

This provides data structure to hold a three dimmensional array of data. The data should be some simple arithmetic type, such as uint8, fpreal16, or UT_Vector3.

Some operations, such as gradiants, may make less sense with uint8.

Definition at line 20 of file RE_Texture3DMap.h.

Constructor & Destructor Documentation

template<typename T >
UT_VoxelArray< T >::UT_VoxelArray ( )

Definition at line 2802 of file UT_VoxelArray.C.

template<typename T >
UT_VoxelArray< T >::~UT_VoxelArray ( )
virtual

Definition at line 2826 of file UT_VoxelArray.C.

template<typename T>
UT_VoxelArray< T >::UT_VoxelArray ( const UT_VoxelArray< T > &  src)

Copy constructor:

Definition at line 2832 of file UT_VoxelArray.C.

Member Function Documentation

template<class T>
void UT_VoxelArray< T >::clampIndex ( int x,
int y,
int z 
) const
inline

Clamps the given x, y, and z values to lie inside the valid index range.

Definition at line 939 of file UT_VoxelArray.h.

template<typename T>
void UT_VoxelArray< T >::copyWithOffset ( const UT_VoxelArray< T > &  src,
int  offx,
int  offy,
int  offz 
)

Copies into this voxel array from the source array. Conceptually, this->setValue(x, y, z, src.getValue(x+offx, y+offy, z+offz);

Definition at line 4461 of file UT_VoxelArray.C.

template<typename T >
T UT_VoxelArray< T >::evaluate ( const UT_Vector3 pos,
const UT_Filter filter,
fpreal  radius,
int  clampaxis = -1 
) const

Filtered evaluation of the voxel array. This operation should exhibit the same behavior as IMG3D_Channel::evaluate.

Definition at line 4167 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::evaluateMinMax ( T lerp,
T lmin,
T lmax,
UT_Vector3F  pos 
) const

This convience function lets you sample the voxel array. pos is in the range [0..1]^3. The min/max is the range of the sampled values.

Definition at line 3401 of file UT_VoxelArray.C.

template<typename T>
bool UT_VoxelArray< T >::extractSample ( int  x,
int  y,
int  z,
T sample 
) const

Extracts a sample of [x,y,z] to [x+1,y+1,z+1]. The sample array should have 8 elements, x minor, z major.

Definition at line 3518 of file UT_VoxelArray.C.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE bool UT_VoxelArray< T >::extractSampleAxis ( int  x,
int  y,
int  z,
T sample 
) const
template<class T>
template<int AXIS2D>
bool UT_VoxelArray< T >::extractSampleAxis ( int  x,
int  y,
int  z,
T samples 
) const

Definition at line 3578 of file UT_VoxelArray.C.

template<typename T>
bool UT_VoxelArray< T >::extractSampleCube ( int  x,
int  y,
int  z,
T sample 
) const

Extracts 27 dense 3x3x3 cube centered at x,y,z into samples z major, xminor.

Definition at line 3736 of file UT_VoxelArray.C.

template<typename T>
bool UT_VoxelArray< T >::extractSamplePlus ( int  x,
int  y,
int  z,
T sample 
) const

Extracts a sample in a plus shape, dx, then dy, then dz, finally the center into 7 voxels.

Definition at line 3680 of file UT_VoxelArray.C.

template<typename T >
template<typename S >
S * UT_VoxelArray< T >::extractTiles ( S dstdata,
int  stride,
const UT_IntArray tilelist 
) const

Fills dstdata with the voxel data of listed tiles. Stride is measured in T. Data order is in tile-order. So, sorted by tilelist, then z, y, x within that tile.

Definition at line 4428 of file UT_VoxelArray.C.

template<typename T >
void UT_VoxelArray< T >::findexToPos ( UT_Vector3F  ipos,
UT_Vector3F pos 
) const

Definition at line 4779 of file UT_VoxelArray.C.

template<typename T >
void UT_VoxelArray< T >::findexToPos ( UT_Vector3D  ipos,
UT_Vector3D pos 
) const

Definition at line 4794 of file UT_VoxelArray.C.

template<class T>
UT_VoxelBorderType UT_VoxelArray< T >::getBorder ( ) const
inline

Definition at line 1036 of file UT_VoxelArray.h.

template<class T>
T UT_VoxelArray< T >::getBorderScale ( int  axis) const
inline

Definition at line 1038 of file UT_VoxelArray.h.

template<class T>
T UT_VoxelArray< T >::getBorderValue ( ) const
inline

Definition at line 1037 of file UT_VoxelArray.h.

template<class T>
const UT_VoxelCompressOptions& UT_VoxelArray< T >::getCompressionOptions ( ) const
inline

Definition at line 1096 of file UT_VoxelArray.h.

template<class T>
fpreal UT_VoxelArray< T >::getCompressionTolerance ( ) const
inline

Definition at line 1101 of file UT_VoxelArray.h.

template<class T>
UT_VoxelTile<T>* UT_VoxelArray< T >::getLinearTile ( int  idx) const
inline

Definition at line 1068 of file UT_VoxelArray.h.

template<typename T >
int64 UT_VoxelArray< T >::getMemoryUsage ( bool  inclusive) const

Return the amount of memory used by this array.

Definition at line 3003 of file UT_VoxelArray.C.

template<class T>
int UT_VoxelArray< T >::getRes ( int  axis) const
inline

Definition at line 671 of file UT_VoxelArray.h.

template<class T>
UT_VoxelTile<T>* UT_VoxelArray< T >::getTile ( int  tx,
int  ty,
int  tz 
) const
inline

The direct tile access methods are to make TBF writing a bit more efficient.

Definition at line 1066 of file UT_VoxelArray.h.

template<class T>
int UT_VoxelArray< T >::getTileRes ( int  dim) const
inline

Number of tiles along that axis. Not to be confused with the resolution of the individual tiles.

Definition at line 1088 of file UT_VoxelArray.h.

template<class T>
T UT_VoxelArray< T >::getValue ( int  x,
int  y,
int  z 
) const
inline

This will clamp the bounds to fit within the voxel array, using the border type to resolve out of range values.

Definition at line 974 of file UT_VoxelArray.h.

template<class T>
int UT_VoxelArray< T >::getXRes ( ) const
inline

Definition at line 668 of file UT_VoxelArray.h.

template<class T>
int UT_VoxelArray< T >::getYRes ( ) const
inline

Definition at line 669 of file UT_VoxelArray.h.

template<class T>
int UT_VoxelArray< T >::getZRes ( ) const
inline

Definition at line 670 of file UT_VoxelArray.h.

template<typename T >
bool UT_VoxelArray< T >::hasNan ( ) const

Returns true if any element of the voxel array is NAN.

Definition at line 3074 of file UT_VoxelArray.C.

template<class T>
int UT_VoxelArray< T >::indexToLinearTile ( int  x,
int  y,
int  z 
) const
inline

Definition at line 1083 of file UT_VoxelArray.h.

template<typename T >
bool UT_VoxelArray< T >::indexToPos ( int  x,
int  y,
int  z,
UT_Vector3F pos 
) const

Converts an index into a position. Returns false if the source index was out of range, in which case pos will be outside [0..1]^3

Definition at line 4739 of file UT_VoxelArray.C.

template<typename T >
bool UT_VoxelArray< T >::indexToPos ( int  x,
int  y,
int  z,
UT_Vector3D pos 
) const

Definition at line 4759 of file UT_VoxelArray.C.

template<typename T>
bool UT_VoxelArray< T >::isConstant ( T cval = 0) const

If this voxel array is all constant tiles, returns true. The optional pointer is initialized to the constant value iff the array is constant. (Note by constant we mean made of constant tiles of the same value - if some tiles are uncompressed but constant, it will still return false)

Definition at line 3035 of file UT_VoxelArray.C.

template<class T>
template<typename S >
bool UT_VoxelArray< T >::isMatching ( const UT_VoxelArray< S > &  src) const
inline

Definition at line 661 of file UT_VoxelArray.h.

template<class T>
bool UT_VoxelArray< T >::isValidIndex ( int  x,
int  y,
int  z 
) const
inline

Returns true if the given x, y, z values lie inside the valid index.

Definition at line 947 of file UT_VoxelArray.h.

template<typename T>
T UT_VoxelArray< T >::lerpSample ( T samples,
float  fx,
float  fy,
float  fz 
) const

Lerps the given sample using trilinear interpolation.

Definition at line 3799 of file UT_VoxelArray.C.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE T UT_VoxelArray< T >::lerpSampleAxis ( T samples,
float  fx,
float  fy,
float  fz 
) const
template<class T>
template<int AXIS2D>
T UT_VoxelArray< T >::lerpSampleAxis ( T samples,
float  fx,
float  fy,
float  fz 
) const

Definition at line 3861 of file UT_VoxelArray.C.

template<typename T >
T UT_VoxelArray< T >::lerpVoxel ( int  x,
int  y,
int  z,
float  fx,
float  fy,
float  fz 
) const

Evaluate using voxel coords, from 0,0,0 to resx,resy,resz. Allows out of range evaluation

Definition at line 3135 of file UT_VoxelArray.C.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE T UT_VoxelArray< T >::lerpVoxelAxis ( int  x,
int  y,
int  z,
float  fx,
float  fy,
float  fz 
) const
template<class T>
template<int AXIS2D>
T UT_VoxelArray< T >::lerpVoxelAxis ( int  x,
int  y,
int  z,
float  fx,
float  fy,
float  fz 
) const

Definition at line 3233 of file UT_VoxelArray.C.

template<typename T >
T UT_VoxelArray< T >::lerpVoxelCoord ( UT_Vector3F  pos) const

Evaluate using voxel coords, from 0,0,0 to resx,resy,resz. Allows out of range evaluation

Definition at line 3108 of file UT_VoxelArray.C.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE T UT_VoxelArray< T >::lerpVoxelCoordAxis ( UT_Vector3F  pos) const
template<class T>
template<int AXIS2D>
T UT_VoxelArray< T >::lerpVoxelCoordAxis ( UT_Vector3F  pos) const

Definition at line 3122 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::lerpVoxelCoordMinMax ( T lerp,
T lmin,
T lmax,
UT_Vector3F  pos 
) const

Evaluate using voxel coords, from 0,0,0 to resx,resy,resz. Allows out of range evaluation. Also computes min/max of interpolated samples.

Definition at line 3418 of file UT_VoxelArray.C.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE void UT_VoxelArray< T >::lerpVoxelCoordMinMaxAxis ( T lerp,
T lmin,
T lmax,
UT_Vector3F  pos 
) const
template<class T>
template<int AXIS2D>
void UT_VoxelArray< T >::lerpVoxelCoordMinMaxAxis ( T lerp,
T lmin,
T lmax,
UT_Vector3F  pos 
) const

Definition at line 3434 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::lerpVoxelMinMax ( T lerp,
T lmin,
T lmax,
int  x,
int  y,
int  z,
float  fx,
float  fy,
float  fz 
) const

Evaluate using voxel coords, from 0,0,0 to resx,resy,resz. Allows out of range evaluation. Also computes min/max of interpolated samples.

Definition at line 3449 of file UT_VoxelArray.C.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE void UT_VoxelArray< T >::lerpVoxelMinMaxAxis ( T lerp,
T lmin,
T lmax,
int  x,
int  y,
int  z,
float  fx,
float  fy,
float  fz 
) const
template<class T>
template<int AXIS2D>
void UT_VoxelArray< T >::lerpVoxelMinMaxAxis ( T lerp,
T smin,
T smax,
int  x,
int  y,
int  z,
float  fx,
float  fy,
float  fz 
) const

Definition at line 3478 of file UT_VoxelArray.C.

template<class T>
void UT_VoxelArray< T >::linearTileToXYZ ( int  idx,
int x,
int y,
int z 
) const
inline

Definition at line 1070 of file UT_VoxelArray.h.

template<typename T >
void UT_VoxelArray< T >::loadData ( UT_IStream is)

Load an array, requires you have already size()d this array.

Definition at line 4900 of file UT_VoxelArray.C.

template<typename T >
bool UT_VoxelArray< T >::loadData ( UT_JSONParser p)

Definition at line 5007 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::match ( const UT_VoxelArray< T > &  src)

This will ensure this voxel array matches the given voxel array in terms of dimensions & border conditions. It may invoke a size() and hence reset the field to 0.

Definition at line 2980 of file UT_VoxelArray.C.

template<class T>
int UT_VoxelArray< T >::numTiles ( ) const
inline

Definition at line 1089 of file UT_VoxelArray.h.

template<class T>
exint UT_VoxelArray< T >::numVoxels ( ) const
inline

Definition at line 1091 of file UT_VoxelArray.h.

template<typename T >
T UT_VoxelArray< T >::operator() ( UT_Vector3D  pos) const

This convience function lets you sample the voxel array. pos is in the range [0..1]^3. T value trilinearly interpolated. Edges are determined by the border mode. The cells are sampled at the center of the voxels.

Definition at line 3920 of file UT_VoxelArray.C.

template<typename T >
T UT_VoxelArray< T >::operator() ( UT_Vector3F  pos) const

Definition at line 3092 of file UT_VoxelArray.C.

template<class T>
T UT_VoxelArray< T >::operator() ( int  x,
int  y,
int  z 
) const
inline

This allows you to read & write the raw data. Out of bound reads are illegal.

Definition at line 955 of file UT_VoxelArray.h.

template<typename T>
const UT_VoxelArray< T > & UT_VoxelArray< T >::operator= ( const UT_VoxelArray< T > &  src)

Assignment operator:

Definition at line 2867 of file UT_VoxelArray.C.

template<typename T >
bool UT_VoxelArray< T >::posToIndex ( UT_Vector3  pos,
int x,
int y,
int z 
) const

Converts a 3d position in range [0..1]^3 into the closest index value. Returns false if the resulting index was out of range. The index will still be set.

Definition at line 4691 of file UT_VoxelArray.C.

template<typename T >
bool UT_VoxelArray< T >::posToIndex ( UT_Vector3  pos,
UT_Vector3 ipos 
) const

Convertes a 3d position in [0..1]^3 into the equivalent in the integer cell space. Does not clamp to the closest value.

Definition at line 4712 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::resample ( const UT_VoxelArray< T > &  src,
UT_FilterType  filtertype = UT_FILTER_POINT,
float  filterwidthscale = 1.0f,
int  clampaxis = -1 
)

Fills this by resampling the given voxel array.

Definition at line 4263 of file UT_VoxelArray.C.

template<typename T >
void UT_VoxelArray< T >::saveData ( std::ostream &  os) const

Saves only the data of this array to the given stream. To reload it you will have to have a matching array in tiles dimensions and size.

Definition at line 4866 of file UT_VoxelArray.C.

template<typename T >
bool UT_VoxelArray< T >::saveData ( UT_JSONWriter w,
const char *  shared_mem_owner = 0 
) const

Definition at line 4936 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::setBorder ( UT_VoxelBorderType  type,
T  t 
)

Definition at line 4809 of file UT_VoxelArray.C.

template<typename T>
void UT_VoxelArray< T >::setBorderScale ( T  scalex,
T  scaley,
T  scalez 
)

Definition at line 4817 of file UT_VoxelArray.C.

template<class T>
void UT_VoxelArray< T >::setCompressionOptions ( const UT_VoxelCompressOptions options)
inline

Definition at line 1094 of file UT_VoxelArray.h.

template<class T>
void UT_VoxelArray< T >::setCompressionTolerance ( fpreal  tol)
inline

Definition at line 1099 of file UT_VoxelArray.h.

template<class T>
void UT_VoxelArray< T >::setValue ( int  x,
int  y,
int  z,
T  t 
)
inline

Definition at line 963 of file UT_VoxelArray.h.

template<typename T >
void UT_VoxelArray< T >::size ( int  xres,
int  yres,
int  zres 
)

This sets the voxelarray to have the given resolution, resetting all elements to 0.

Definition at line 2912 of file UT_VoxelArray.C.

template<class T>
SYS_FORCE_INLINE void UT_VoxelArray< T >::splitVoxelCoord ( UT_Vector3F  pos,
int x,
int y,
int z,
float &  fx,
float &  fy,
float &  fz 
) const
inline

Definition at line 765 of file UT_VoxelArray.h.

template<class T>
template<int AXIS2D>
SYS_FORCE_INLINE void UT_VoxelArray< T >::splitVoxelCoordAxis ( UT_Vector3F  pos,
int x,
int y,
int z,
float &  fx,
float &  fy,
float &  fz 
) const
inline

Definition at line 777 of file UT_VoxelArray.h.

template<class T>
UT_VoxelArray< T >::THREADED_METHOD ( UT_VoxelArray< T ,
numTiles()  ,
100  ,
collapseAllTiles   
) const

This tries to compress or collapse each tile. This can be expensive (ie, converting a tile to constant), so should be saved until modifications are complete.

template<class T>
UT_VoxelArray< T >::THREADED_METHOD ( UT_VoxelArray< T ,
numTiles()  ,
100  ,
expandAllTiles   
) const

Uncompresses all tiles into non-constant tiles. Useful if you have a multithreaded algorithm that may need to both read and write, if you write to a collapsed tile while someone else reads from it, bad stuff happens. Instead, you can expandAllTiles. This may have serious consequences in memory use, however.

template<class T>
UT_VoxelArray< T >::THREADED_METHOD ( UT_VoxelArray< T ,
numTiles()  ,
100  ,
expandAllNonConstTiles   
) const

Uncompresses all tiles, but leaves constant tiles alone. Useful for cleaning out any non-standard compression algorithm that some external program can't handle.

template<class T>
UT_VoxelArray< T >::THREADED_METHOD1 ( UT_VoxelArray< T ,
numTiles()  ,
100  ,
constant  ,
T  ,
 
) const

Sets this voxel array to the given constant value. All tiles are turned into constant tiles.

template<class T>
UT_VoxelArray< T >::THREADED_METHOD1 ( UT_VoxelArray< T ,
numTiles()  ,
20  ,
copyData  ,
const UT_VoxelArray< T > &  ,
src   
) const

Copy only the data from the source array. Note that it is an error to call this unless isMatching(src).

template<class T>
UT_VoxelArray< T >::THREADED_METHOD3 ( UT_VoxelArray< T ,
numTiles()  ,
16  ,
extractFromFlattened  ,
const T ,
flatarray  ,
exint  ,
ystride  ,
exint  ,
zstride   
) const

Fills this from a flattened array. Z major, then Y, then X. setValue(x,y,z, flatarray[x + y * ystride + z * zstride];

template<class T>
UT_VoxelArray< T >::THREADED_METHOD3_CONST ( UT_VoxelArray< T ,
numTiles()  ,
16  ,
flatten  ,
T ,
flatarray  ,
exint  ,
ystride  ,
exint  ,
zstride   
)

Flattens this into an array. Z major, then Y, then X. flatarray[x + y * ystride + z * zstride] = getValue(x, y, z);

template<class T>
UT_VoxelArray< T >::THREADED_METHOD4 ( UT_VoxelArray< T ,
numTiles()  ,
,
copyWithOffsetInternal  ,
const UT_VoxelArray< T > &  ,
src  ,
int  ,
offx  ,
int  ,
offy  ,
int  ,
offz   
) const
template<class T>
UT_VoxelArray< T >::THREADED_METHOD4_CONST ( UT_VoxelArray< T ,
numTiles()  ,
16  ,
flattenGLFixed8  ,
uint8 ,
flatarray  ,
exint  ,
ystride  ,
exint  ,
zstride  ,
T  ,
dummy   
)

Flattens this into an array suitable for a GL 8bit texture. Z major, then Y, then X. flatarray[x + y * ystride + z * zstride] = getValue(x, y, z);

template<class T>
UT_VoxelArray< T >::THREADED_METHOD4_CONST ( UT_VoxelArray< T ,
numTiles()  ,
16  ,
flattenGL16F  ,
UT_Vector4H ,
flatarray  ,
exint  ,
ystride  ,
exint  ,
zstride  ,
T  ,
dummy   
)

Flattens this into an array suitable for a GL 16bit FP texture. Z major, then Y, then X. flatarray[x + y * ystride + z * zstride] = getValue(x, y, z);

template<class T>
UT_VoxelArray< T >::THREADED_METHOD4_CONST ( UT_VoxelArray< T ,
numTiles()  ,
16  ,
flattenGL32F  ,
UT_Vector4F ,
flatarray  ,
exint  ,
ystride  ,
exint  ,
zstride  ,
T  ,
dummy   
)

Flattens this into an array suitable for a GL 32b FP texture. Note that this also works around an older Nvidia driver bug that caused very small valued texels (<1e-9) to appear as huge random values in the texture. Z major, then Y, then X. flatarray[x + y * ystride + z * zstride] = getValue(x, y, z);

template<typename T >
template<typename S >
const S * UT_VoxelArray< T >::writeTiles ( const S srcdata,
int  srcstride,
const UT_IntArray tilelist 
)

Overwrites our tiles with the given data. Does checking for constant tiles. Input srcdata stream should match that of extractTiles.

Definition at line 4445 of file UT_VoxelArray.C.

template<class T>
int UT_VoxelArray< T >::xyzTileToLinear ( int  x,
int  y,
int  z 
) const
inline

Definition at line 1080 of file UT_VoxelArray.h.

Member Data Documentation

template<class T>
exint exint T const UT_JobInfo &info UT_VoxelArray< T >::const

Definition at line 834 of file UT_VoxelArray.h.

template<class T>
exint exint T const UT_JobInfo& info UT_VoxelArray< T >::const

Definition at line 847 of file UT_VoxelArray.h.

template<class T>
exint exint T UT_VoxelArray< T >::dummy

Definition at line 847 of file UT_VoxelArray.h.

template<class T>
const UT_JobInfo & UT_VoxelArray< T >::info

Definition at line 681 of file UT_VoxelArray.h.

template<class T>
exint exint const UT_JobInfo& UT_VoxelArray< T >::info

Definition at line 889 of file UT_VoxelArray.h.

template<class T>
int int int const UT_JobInfo& UT_VoxelArray< T >::info

Definition at line 904 of file UT_VoxelArray.h.

template<class T>
int UT_VoxelArray< T >::offx

Definition at line 904 of file UT_VoxelArray.h.

template<class T>
int int UT_VoxelArray< T >::offy

Definition at line 904 of file UT_VoxelArray.h.

template<class T>
int int int UT_VoxelArray< T >::offz

Definition at line 904 of file UT_VoxelArray.h.

template<class T>
exint UT_VoxelArray< T >::ystride

Definition at line 834 of file UT_VoxelArray.h.

template<class T>
exint exint UT_VoxelArray< T >::zstride

Definition at line 834 of file UT_VoxelArray.h.


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