SoVolumeReaderGetTileMinMax Method |
Returns the minimum and maximum data values for the given tile.
Namespace: OIV.LDM.Readers
This information benefits optimizations such as OIV.LDM.SoLDMGlobalResourceParameters.SetIgnoreFullyTransparentTiles(System.Boolean) and custom OIV.LDM.Readers.SoVolumeReader able to return OIV.LDM.Tiles.SoCpuBufferUniform.
VolumeViz will only call this method if the data is organized in tiles like the LDM file format. In other words, if () returned true. The LDM Converter program automatically computes this information and stores it in the LDM header file. Custom volume readers that implement tiled data, i.e. return true when () is called, should consider implement this method when the min max values are available from their backend API.
NOTES:
Automatic computation of tile min/max values works fine for actual volume data. But we strongly recommend implementing this method for height field data (see OIV.VolumeViz.Nodes.SoHeightFieldGeometry etc). Because of the way the height field algorithm works, if tile min/max info is not available, VolumeViz must load all height field tiles before the first render. This can cause a long delay before the first rendering appears.
When all the voxels in the requested tile (fileId) have the same value, we recommend that the volume reader implement two optimizations. First, the OIV.LDM.Readers.SoVolumeReader.ReadTile(System.Int32, OIV.Inventor.SbBox3i32) method should return an OIV.LDM.Tiles.SoCpuBufferUniform object (instead of OIV.Inventor.Devices.SoCpuBufferObject). This reduces the amount of CPU and GPU memory needed to store the tile, allowing more tiles to be loaded in the same amount of memory. Second, the OIV.LDM.Readers.SoVolumeReader.GetTileMinMax(System.Int32) method should return an empty range (min = max) for this tile. This allows VolumeViz to optimize sending tiles to the GPU. However, note that the OIV.LDM.Readers.SoVolumeReader.GetTileMinMax(System.Int32) method is called before the OIV.LDM.Readers.SoVolumeReader.ReadTile(System.Int32, OIV.Inventor.SbBox3i32) method. So ideally the volume reader should be able to return the tile min/max without actually loading the tile data, for example by using metadata stored with the tiles.
Default implementation returns new OIV.Inventor.SbVec2d(System.Double.MaxValue, -System.Double.MaxValue))