Class SoLDMTopoOctree


  • public class SoLDMTopoOctree
    extends Inventor
    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
    • Constructor Summary

      Constructors 
      Constructor Description
      SoLDMTopoOctree()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFileID​(SoLDMTileID tileID)
      Given a tileID, returns the corresponding fileID.
      int getLevelMax()
      Returns the maximum level of the octree tile hierarchy.
      int getNumFileIDs()
      Returns the number of fileIDs in the volume.
      long getNumTileIDs()
      Returns the number of tileIDs in the complete (conceptual) octree.
      SoLDMTileID getTileID​(int fileID)
      Given a fileID, returns the corresponding tileID.
      SoLDMTileID getTileID​(SbVec3i32 cellPos, int resolutionLevel)
      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.
      SbBox3i32 getTilePos​(SoLDMTileID tileID)
      Returns the bounding box, in voxel/cell coordinates, of the specified tile.
      SbVec3i32 getTileSize()
      Return the tilesize used to setup this octree.
      void init​(SbVec3i32 dimension, int tileDim)
      Calls init(dimension, tileDim, (int)0).
      void init​(SbVec3i32 dimension, int tileDim, int border)
      Initialize with the properties of the data set.
      void init​(SbVec3i32 dimension, SbVec3i32 tileDim)
      Calls init(dimension, tileDim, (int)0).
      void init​(SbVec3i32 dimension, SbVec3i32 tileDim, int border)
      Initialize with the properties of the data set.
      boolean isEmpty()
      Returns false if the octree is empty.
      int level​(long index)
      Returns the tile level of the given tile Id.
      int level​(SoLDMTileID id)
      Returns the tile level of the given tile Id.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SoLDMTopoOctree

        public SoLDMTopoOctree()
        Constructor.
    • Method Detail

      • init

        public void init​(SbVec3i32 dimension,
                         int tileDim)
        Calls init(dimension, tileDim, (int)0).
      • init

        public void init​(SbVec3i32 dimension,
                         SbVec3i32 tileDim)
        Calls init(dimension, tileDim, (int)0).
      • isEmpty

        public boolean isEmpty()
        Returns false if the octree is empty. Note: Octree must be initialized.
      • init

        public void init​(SbVec3i32 dimension,
                         SbVec3i32 tileDim,
                         int border)
        Initialize with the properties of the data set. Note: Since OIV 9.0, the border parameter is no longer used.
      • getTileSize

        public SbVec3i32 getTileSize()
        Return the tilesize used to setup this octree.
      • getTileID

        public SoLDMTileID getTileID​(int fileID)
        Given a fileID, returns the corresponding tileID.
      • init

        public void init​(SbVec3i32 dimension,
                         int tileDim,
                         int border)
        Initialize with the properties of the data set. Note: Since OIV 9.0, the border parameter is no longer used.
      • getTilePos

        public SbBox3i32 getTilePos​(SoLDMTileID tileID)
        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.
      • getNumFileIDs

        public int getNumFileIDs()
        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().
      • getTileID

        public SoLDMTileID getTileID​(SbVec3i32 cellPos,
                                     int resolutionLevel)
        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
      • level

        public int level​(long index)
        Returns the tile level of the given tile Id. Conversion: resolutionLevel = getLevelMax() - tileLevel. Note: Octree must be initialized.
      • level

        public int level​(SoLDMTileID id)
        Returns the tile level of the given tile Id. Conversion: resolutionLevel = getLevelMax() - tileLevel. Note: Octree must be initialized.
      • getFileID

        public int getFileID​(SoLDMTileID tileID)
        Given a tileID, returns the corresponding fileID.
      • getLevelMax

        public int getLevelMax()
        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.
      • getNumTileIDs

        public long getNumTileIDs()
        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().