#include <UT_VoxelArray.h>
Public Member Functions | |
| UT_VoxelTileIterator () | |
| UT_VoxelTileIterator (const UT_VoxelArrayIterator< T > &vit) | |
| template<typename S > | |
| UT_VoxelTileIterator (const UT_VoxelArrayIterator< S > &vit, UT_VoxelArray< T > *array) | |
| virtual | ~UT_VoxelTileIterator () |
| template<typename S > | |
| void | setTile (const UT_VoxelArrayIterator< S > &vit, UT_VoxelArray< T > *array) |
| void | setTile (const UT_VoxelArrayIterator< T > &vit) |
| void | rewind () |
| Resets the iterator to point to the first voxel. | |
| bool | atEnd () const |
| Returns true if we have iterated over all of the voxels. | |
| void | advance () |
| Advances the iterator to point to the next voxel. | |
| int | x () const |
| int | y () const |
| int | z () const |
| int | idx (int idx) const |
| T | getValue () const |
| void | setValue (T t) const |
| Sets the voxel we are currently pointing to the given value. | |
| bool | isTileConstant () const |
| Returns true if the tile we are currently in is a constant tile. | |
| bool | isStartOfTile () const |
| Returns true if we are at the start of a new tile. | |
| UT_VoxelTile< T > * | getTile () const |
| Returns the VoxelTile we are currently processing. | |
| void | advanceTile () |
| bool | getCompressOnExit () const |
| void | setCompressOnExit (bool shouldcompress) |
| template<typename OP > | |
| bool | reduceOperation (OP &op) |
| UT_VoxelArray< T > * | getArray () const |
Public Attributes | |
| int | myTileLocalPos [3] |
| Our position within the current tile. | |
| int | myTileSize [3] |
| The size of the current tile. | |
Protected Attributes | |
| UT_VoxelTile< T > * | myCurTile |
| Current processing tile. | |
| UT_VoxelArray< T > * | myArray |
| int | myPos [3] |
| Absolute index into voxel array. | |
| int | myTileStart [3] |
| Absolute index of start of tile. | |
| bool | myShouldCompressOnExit |
| bool | myAtEnd |
This class eliminates the need for having for (z = 0; z < zres; z++) ... for (x = 0; x < xres; x++) loops everywhere.
The iterator is similar in principal to an STL iterator, but somewhat simpler. The classic STL loop for ( it = begin(); it != end(); ++it ) is done using for ( it.rewind(); !it.atEnd(); it.advance() )
Definition at line 1197 of file UT_VoxelArray.h.
| UT_VoxelTileIterator< T >::UT_VoxelTileIterator | ( | ) | [inline] |
UT_VoxelTileIterator implementation
Definition at line 3564 of file UT_VoxelArray.C.
| UT_VoxelTileIterator< T >::UT_VoxelTileIterator | ( | const UT_VoxelArrayIterator< T > & | vit | ) | [inline] |
Definition at line 3573 of file UT_VoxelArray.C.
| UT_VoxelTileIterator< T >::UT_VoxelTileIterator | ( | const UT_VoxelArrayIterator< S > & | vit, | |
| UT_VoxelArray< T > * | array | |||
| ) | [inline] |
Definition at line 3584 of file UT_VoxelArray.C.
| UT_VoxelTileIterator< T >::~UT_VoxelTileIterator | ( | ) | [inline, virtual] |
Definition at line 3594 of file UT_VoxelArray.C.
| void UT_VoxelTileIterator< T >::advance | ( | ) | [inline] |
| void UT_VoxelTileIterator< T >::advanceTile | ( | ) | [inline] |
Advances the iterator to point to the next tile. Since we are restricted to one tile, effectively just ends the iterator.
Definition at line 3627 of file UT_VoxelArray.C.
| bool UT_VoxelTileIterator< T >::atEnd | ( | ) | const [inline] |
Returns true if we have iterated over all of the voxels.
Definition at line 1228 of file UT_VoxelArray.h.
| UT_VoxelArray<T>* UT_VoxelTileIterator< T >::getArray | ( | ) | const [inline] |
Definition at line 1329 of file UT_VoxelArray.h.
| bool UT_VoxelTileIterator< T >::getCompressOnExit | ( | ) | const [inline] |
Sets a flag which causes the iterator to tryCompress() tiles when it is done with them.
Definition at line 1318 of file UT_VoxelArray.h.
| UT_VoxelTile<T>* UT_VoxelTileIterator< T >::getTile | ( | ) | const [inline] |
| T UT_VoxelTileIterator< T >::getValue | ( | ) | const [inline] |
Retrieves the value that we are currently pointing at. This is faster than an operator(x,y,z) as we already know our current tile and that bounds checking isn't needed.
Definition at line 1273 of file UT_VoxelArray.h.
| int UT_VoxelTileIterator< T >::idx | ( | int | idx | ) | const [inline] |
Definition at line 1268 of file UT_VoxelArray.h.
| bool UT_VoxelTileIterator< T >::isStartOfTile | ( | ) | const [inline] |
| bool UT_VoxelTileIterator< T >::isTileConstant | ( | ) | const [inline] |
Returns true if the tile we are currently in is a constant tile.
Definition at line 1293 of file UT_VoxelArray.h.
| bool UT_VoxelTileIterator< T >::reduceOperation | ( | OP & | op | ) | [inline] |
Reduction operators. op.reduce(T a) called for each voxel, *but*, op.reduceMany(T a, int n) called to reduce constant blocks. Early exits if op.reduce() returns false.
Definition at line 3643 of file UT_VoxelArray.C.
| void UT_VoxelTileIterator< T >::rewind | ( | ) | [inline] |
| void UT_VoxelTileIterator< T >::setCompressOnExit | ( | bool | shouldcompress | ) | [inline] |
Definition at line 1319 of file UT_VoxelArray.h.
| void UT_VoxelTileIterator< T >::setTile | ( | const UT_VoxelArrayIterator< T > & | vit | ) | [inline] |
Definition at line 1219 of file UT_VoxelArray.h.
| void UT_VoxelTileIterator< T >::setTile | ( | const UT_VoxelArrayIterator< S > & | vit, | |
| UT_VoxelArray< T > * | array | |||
| ) | [inline] |
Definition at line 1208 of file UT_VoxelArray.h.
| void UT_VoxelTileIterator< T >::setValue | ( | T | t | ) | const [inline] |
Sets the voxel we are currently pointing to the given value.
Definition at line 1283 of file UT_VoxelArray.h.
| int UT_VoxelTileIterator< T >::x | ( | void | ) | const [inline] |
Retrieve the current location of the iterator, in the containing voxel array, not in the tile.
Definition at line 1265 of file UT_VoxelArray.h.
| int UT_VoxelTileIterator< T >::y | ( | void | ) | const [inline] |
Definition at line 1266 of file UT_VoxelArray.h.
| int UT_VoxelTileIterator< T >::z | ( | void | ) | const [inline] |
Definition at line 1267 of file UT_VoxelArray.h.
UT_VoxelArray<T>* UT_VoxelTileIterator< T >::myArray [protected] |
Definition at line 1334 of file UT_VoxelArray.h.
bool UT_VoxelTileIterator< T >::myAtEnd [protected] |
Since we want to allow multiple passes, we can't clear out myCurTile when we hit the end.
Definition at line 1347 of file UT_VoxelArray.h.
UT_VoxelTile<T>* UT_VoxelTileIterator< T >::myCurTile [protected] |
int UT_VoxelTileIterator< T >::myPos[3] [protected] |
bool UT_VoxelTileIterator< T >::myShouldCompressOnExit [protected] |
Flag determining if we should compress tiles whenever we advance out of them.
Definition at line 1343 of file UT_VoxelArray.h.
| int UT_VoxelTileIterator< T >::myTileLocalPos[3] |
| int UT_VoxelTileIterator< T >::myTileSize[3] |
int UT_VoxelTileIterator< T >::myTileStart[3] [protected] |
1.5.9