Octree topology queries More...
#include <LDM/SoLDMTopoOctree.h>
Public Member Functions | |
SoLDMTopoOctree () | |
Constructor. | |
void | init (const SbVec3i32 &dimension, const SbVec3i32 &tileDim, const int border=0) |
Initialize with the properties of the data set. | |
void | init (const SbVec3i32 &dimension, const int tileDim, const int border=0) |
Initialize with the properties of the data set. | |
SbBox3i32 | getTilePos (const SoLDMTileID &tileID) const |
Returns the bounding box, in voxel/cell coordinates, of the specified tile. | |
SoLDMTileID | getTileID (const SbVec3i32 &cellPos, const int resolutionLevel) const |
Given the position of a voxel in full resolution voxel coordinates (i,j,k) and a resolution level, returns the tile ID of the corresponding tile. | |
int | getNumFileIDs () const |
Returns the number of fileIDs in the volume. | |
size_t | getNumTileIDs () const |
Returns the number of tileIDs in the complete (conceptual) octree. | |
int | getFileID (const SoLDMTileID &tileID) const |
Given a tileID, returns the corresponding fileID. | |
SoLDMTileID | getTileID (const int fileID) const |
Given a fileID, returns the corresponding tileID. | |
bool | isEmpty () const |
Returns false if the octree is empty. | |
int | getLevelMax () const |
Returns the maximum level of the octree tile hierarchy. | |
int | level (const SoLDMTileID &id) const |
Returns the tile level of the given tile Id. | |
int | level (const LDM_TILE_ID_TYPE index) const |
Returns the tile level of the given tile Id. | |
const SbVec3i32 & | getTileSize () const |
Return the tilesize used to setup this octree. | |
The SoLDMTopoOctree class provides information about the hierarchy of LDM tiles used for a given dataset, which depends only on the dataset dimensions and the tile dimensions.
For example, an application can query the total number of LDM tiles in a data set, the number of resolution levels in the LDM tile hierarchy, the id of the tile that contains a specified voxel position, the position and extent of a specified tile id, and more. An application can conveniently query the SoLDMTopoOctree for an actual data set using the SoDataSet::getLDMTopoOctree() method or create an LDMTopoOctree object with any specified dimensions. In the latter case, the LDMTopoOctree must be initialized using the init() method.
In VolumeViz LDM every tile has both a tileID and a fileID. The tileID is the unique identifier of a tile in the (conceptual) complete, symmetrical hierarchy. The fileID is the index of a tile in a sequential numbering of all the tiles that actually contain data. The tileID is normally used to identify tiles in an application, but the fileID is used, for example, when calling the readTile method in an SoVolumeReader class. In a cubical volume (all three dimensions the same), there are equal numbers of tileIDs and fileIDs, but in most volumes there are many fewer fileIDs than tileIDs.
The terms 'resolution' and 'level' are both used in this class to identify a specific level in the LDM tile hierarchy.
Definition at line 85 of file SoLDMTopoOctree.h.
SoLDMTopoOctree::SoLDMTopoOctree | ( | ) |
Constructor.
|
inline |
Given a tileID, returns the corresponding fileID.
Definition at line 437 of file SoLDMTopoOctree.h.
int SoLDMTopoOctree::getLevelMax | ( | ) | const |
Returns the maximum level of the octree tile hierarchy.
Example: If there are 3 levels in the octree, returns 2. Note: Octree must be initialized.
int SoLDMTopoOctree::getNumFileIDs | ( | ) | const |
Returns the number of fileIDs in the volume.
Effectively this is the total number of actual tiles, including both full resolution and low resolution, required to store the data set. This value is <= getNumTileIDs().
|
inline |
Returns the number of tileIDs in the complete (conceptual) octree.
The complete octree is based on the power-of-2 greater than or equal to the actual volume dimensions. This value is >= getNumFileIDs().
Definition at line 383 of file SoLDMTopoOctree.h.
SoLDMTileID SoLDMTopoOctree::getTileID | ( | const int | fileID | ) | const |
Given a fileID, returns the corresponding tileID.
SoLDMTileID SoLDMTopoOctree::getTileID | ( | const SbVec3i32 & | cellPos, |
const int | resolutionLevel | ||
) | const |
Given the position of a voxel in full resolution voxel coordinates (i,j,k) and a resolution level, returns the tile ID of the corresponding tile.
Resolution level is counted up from the bottom of the tile hierarchy, so resolution level 0 is the full resolution tiles.
Regardless of the tile's resolution level in the LDM tile hierarchy, the returned bounding box is always in full-resolution voxel coordinates. In other words, the box is the region of the full-resolution volume that the tile "spans" and the extent of this box is not the same as the tile size unless the specified tile is at resolution level 0 (full resolution).
Example: If the volume is 256 x 256 x 256 with tile size 64
SbBox3i32 SoLDMTopoOctree::getTilePos | ( | const SoLDMTileID & | tileID | ) | const |
Returns the bounding box, in voxel/cell coordinates, of the specified tile.
Regardless the tile's resolution level in the LDM tile hierarchy, the returned bounding box is always in full-resolution voxel coordinates.
|
inline |
Return the tilesize used to setup this octree.
Definition at line 193 of file SoLDMTopoOctree.h.
|
inline |
Initialize with the properties of the data set.
Note: Since OIV 9.0, the border parameter is no longer used.
Definition at line 107 of file SoLDMTopoOctree.h.
void SoLDMTopoOctree::init | ( | const SbVec3i32 & | dimension, |
const SbVec3i32 & | tileDim, | ||
const int | border = 0 |
||
) |
Initialize with the properties of the data set.
Note: Since OIV 9.0, the border parameter is no longer used.
|
inline |
Returns false if the octree is empty.
Note: Octree must be initialized.
Definition at line 168 of file SoLDMTopoOctree.h.
int SoLDMTopoOctree::level | ( | const LDM_TILE_ID_TYPE | index | ) | const |
Returns the tile level of the given tile Id.
Conversion: resolutionLevel = getLevelMax() - tileLevel. Note: Octree must be initialized.
|
inline |
Returns the tile level of the given tile Id.
Conversion: resolutionLevel = getLevelMax() - tileLevel. Note: Octree must be initialized.
Definition at line 397 of file SoLDMTopoOctree.h.