Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoLDMTopoOctree Class Reference

Large Data Management 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 SbVec3i32getTileSize () const
 Return the tilesize used to setup this octree.
 

Detailed Description

Large Data Management Octree topology queries

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.

  • Resolution level is counted up from the bottom.
    So resolution level 0 is the full resolution tiles. The getTileID() method takes resolution level as a parameter.
  • Tile level is counted down from the top.
    So tile level 0 is the lowest resolution tile (tile 0) at the top of the hierarchy. The level() method returns the tile level, not the resolution level.
  • Conversion: tileLevel = getLevelMax() - resolutionLevel.

SEE ALSO

SoLDMTileID

Definition at line 85 of file SoLDMTopoOctree.h.

Constructor & Destructor Documentation

◆ SoLDMTopoOctree()

SoLDMTopoOctree::SoLDMTopoOctree ( )

Constructor.

Member Function Documentation

◆ getFileID()

int SoLDMTopoOctree::getFileID ( const SoLDMTileID tileID) const
inline

Given a tileID, returns the corresponding fileID.

Definition at line 437 of file SoLDMTopoOctree.h.

◆ getLevelMax()

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.

◆ getNumFileIDs()

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().

◆ getNumTileIDs()

size_t SoLDMTopoOctree::getNumTileIDs ( ) const
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.

◆ getTileID() [1/2]

SoLDMTileID SoLDMTopoOctree::getTileID ( const int  fileID) const

Given a fileID, returns the corresponding tileID.

◆ getTileID() [2/2]

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

  • There are 3 levels of tiles.
  • Level 0 / Res 2 : first tile is tileId 0, pos = 0,0,0 x 255,255,255
  • Level 1 / Res 1 : first tile is tileId 1, pos = 0,0,0 x 127,127,127
  • Level 2 / Res 0 : first tile is tileId 9, pos = 0,0,0 x 63,63,63

◆ getTilePos()

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.

◆ getTileSize()

const SbVec3i32 & SoLDMTopoOctree::getTileSize ( ) const
inline

Return the tilesize used to setup this octree.

Definition at line 193 of file SoLDMTopoOctree.h.

◆ init() [1/2]

void SoLDMTopoOctree::init ( const SbVec3i32 dimension,
const int  tileDim,
const int  border = 0 
)
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.

◆ init() [2/2]

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.

◆ isEmpty()

bool SoLDMTopoOctree::isEmpty ( ) const
inline

Returns false if the octree is empty.

Note: Octree must be initialized.

Definition at line 168 of file SoLDMTopoOctree.h.

◆ level() [1/2]

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.

◆ level() [2/2]

int SoLDMTopoOctree::level ( const SoLDMTileID id) const
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.


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