SoLDMDataAccessGetData Method (Int32, SbVec3i32) |
Returns a reference to the block of data (LDM tile) which contains the voxel at dataPosition.
Namespace: OIV.LDM
The resolution is the power of 2 of the desired subsampling level (0:1/1, 1:1/2, 2:1/4, ...). In most cases you will pass 0 to request full resolution data.
The data is not copied. The reference is valid until releaseData() is called with the corresponding tile id or until the associated volumeData node is destroyed.
The LDM tile is locked in CPU memory until releaseData() is called. The application may lock multiple tiles in memory using this method. However these locked tiles count against the maximum CPU memory allowed for the volume. Locking too many tiles may reduce the rendered image quality because LDM does not have enough memory to load other tiles. A released tile will remain in memory (allowing quick re-access) for some period of time, depending on whether it is needed for rendering and (if not) on the value of SoLDMResourceParameters.tileHalfLife.
This method is a good solution when the application needs to get the values of multiple voxels that are not part of a line, plane or box. After locking a tile, for each subsequent voxel, check if the voxel position is contained in the currently locked tile. You can use the intersect() method on the SbBox3i32 tilePosition member of the DataInfo struct for this test. If the voxel is in the current tile, compute the offset into the data buffer and get its value. If not, release the current tile (using releaseData) and get the appropriate tile by calling getData() again.