HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
__linearTileIndexConverter Class Reference

Public Member Functions

template<typename T >
 __linearTileIndexConverter (const UT_VoxelArray< T > *dst, const UT_VoxelArray< T > *src, int xoff, int yoff, int zoff)
 
int getNTilesBP () const
 Returns the number of tiles in each part. More...
 
int getNTilesIP () const
 
void toLinearBP (int k, int &x, int &y, int &z) const
 
void toLinearIP (int k, int &x, int &y, int &z) const
 

Static Protected Member Functions

static void _toRegularLinear (int k, int xdim, int ydim, int &x, int &y, int &z)
 

Protected Attributes

int myXMax
 
int myYMax
 
int myZMax
 
int myXSkipMin
 
int myYSkipMin
 
int myZSkipMin
 
int myXSkipLen
 
int myYSkipLen
 
int myZSkipLen
 

Detailed Description

This helper class can be used for iterating over a voxel array in relation to another one. In particular, dst is the destination voxel array that is to be iterated over; its tile at [X, Y, Z] is taken to be coincident with tile [X + xoff, Y + yoff, Z + zoff] of src. Tiles of dst are partitioned into two sets:

  • BP (boundary pass): these are tiles of dst that are coincident with tiles of src that are at the boundary (so they affect extrapolation);
  • IP (internal pass): these tiles are coincident with internal tiles of src (those that are irrelevant for extrapolation). Once created, an object of this class can return the number of tiles in each set and convert from a linear 0-N index to [X, Y, Z] coordinates that identify the tile within dst.

This class can be roughly used as follows... Main function:

__linearTileIndexConverter index(dst, src, xoff, yoff, zoff);
customFunctionBP(..., index);
customFunctionIP(..., index);

BPPartial(..., const __linearTileIndexConverter& index, const UT_JobInfo& i) function:

int t0, t1;
i.divideWork(index.getNTilesBP(), t0, t1);
for (int j = t0; j < t1; j++)
{
    int x, y, z;
    index.toLinearBP(j, x, y, z);
    UT_VoxerTile<T>* dtile = src.getTile(x, y, z);
    ...
}

With a similar implementation for IP. See moveTilesWithOffset() for an example.

Definition at line 5105 of file UT_VoxelArray.C.

Constructor & Destructor Documentation

template<typename T >
__linearTileIndexConverter::__linearTileIndexConverter ( const UT_VoxelArray< T > *  dst,
const UT_VoxelArray< T > *  src,
int  xoff,
int  yoff,
int  zoff 
)
inline

Creates an index converter from the given voxel arrays. This object partitions tiles of dst into those that are affected by

Definition at line 5111 of file UT_VoxelArray.C.

Member Function Documentation

static void __linearTileIndexConverter::_toRegularLinear ( int  k,
int  xdim,
int  ydim,
int x,
int y,
int z 
)
inlinestaticprotected

Definition at line 5207 of file UT_VoxelArray.C.

int __linearTileIndexConverter::getNTilesBP ( ) const
inline

Returns the number of tiles in each part.

Definition at line 5134 of file UT_VoxelArray.C.

int __linearTileIndexConverter::getNTilesIP ( ) const
inline

Definition at line 5138 of file UT_VoxelArray.C.

void __linearTileIndexConverter::toLinearBP ( int  k,
int x,
int y,
int z 
) const
inline

Converts a linear index (between 0 and getNTiles*P()-1) to the [X, Y, Z] tile coordinate with respect to dst.

Definition at line 5145 of file UT_VoxelArray.C.

void __linearTileIndexConverter::toLinearIP ( int  k,
int x,
int y,
int z 
) const
inline

Definition at line 5198 of file UT_VoxelArray.C.

Member Data Documentation

int __linearTileIndexConverter::myXMax
protected

Definition at line 5216 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myXSkipLen
protected

Definition at line 5218 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myXSkipMin
protected

Definition at line 5217 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myYMax
protected

Definition at line 5216 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myYSkipLen
protected

Definition at line 5218 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myYSkipMin
protected

Definition at line 5217 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myZMax
protected

Definition at line 5216 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myZSkipLen
protected

Definition at line 5218 of file UT_VoxelArray.C.

int __linearTileIndexConverter::myZSkipMin
protected

Definition at line 5217 of file UT_VoxelArray.C.


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