public class SoLDMTileManager extends SoLDMLargeDataManagement
<font color="#0000FF">NOTE:</font> This class does not exist in Open Inventor 10.0 and later.
The SoLDMTileManager
is responsible for managing the data in main memory, loading the most important tiles, unloading the less important ones, and delivering them (getTile
) to create textures for rendering.
The amount of memory, dedicated to storing the data in main memory, is up to the application and stored in the SoLDMResourceManager
. The SoLDMTileManager
works under constraint of the SoLDMResourceManager
. One can assign a weight to a tile and ask the SoLDMTileManager
for the existence of the tile in main memory by calling checkResidencyAndUpdateWeight
. Notice: The tile manager should keep track of weights passed through this function to remember priorities. Indeed, even though, weights between tile manager and node front manager are consistent (same weight in between 0 and 1), they are out of synchronisation: if the tile manager declares the tile as not loaded, then the tile's weight will be declared as null to the node front manager (checkResidencyAndUpdateWeight
returns false). So the tile manager must know the importance of the tile to know when to load it next, when the balance is reached, and not entirely rely on SoLDMNodeFrontManager.getWeight
method.
The tile manager should register the SoDataSet
node passed to the registerVolumeData function to access different information needed to page data from disk:
SoDataCompositor
(volData->getDataCompositor()) if in composition mode when handling several SoDataSet
.
SoDataSet
to know what piece of data to return when getTile
is called.
SoDataSet
(note there is one resource manager associated to each data set).
As described above, multiple SoDataSet
can be inserted in a scene graph and combined together to do render or data compositing (see SoDataSet
). In this case, only one SoLDMTileManager
handles them all and the registerVolumeData function is called for each data set. In the case of a render compositing, each time a tile needs to be stored in memory, the tile manager needs to load the piece of data corresponding to the tile for each data set registered so that when a tile is declared in memory, the associated data resides for each data set (at any time, the amount of data loaded for each data set must be synchronized). In the case of a data compositing (volData->getDataCompositor() is not NULL) then when a tile is loaded, it must be loaded for each data set, each piece of data must be combined together by the data compositor and the final composed data must be stored and managed by the tile manager.
See also:
SoLDMResourceManager
, SoLDMNodeFrontManager
, SoDataSet
, SoVolumeRendering
, LDMDefaultSliceAccessor
Modifier and Type | Class and Description |
---|---|
static class |
SoLDMTileManager.LDMSliceAccessor
Allows accessing a 2D buffer for slice and volumeSkin rendering.
|
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
boolean |
checkResidencyAndUpdateWeight(SoLDMTileID tileID,
float weight)
Returns whether the input tile resides in memory and update its weight.
|
void |
endNumDataNotify(boolean isAdded,
boolean sync)
Calls endNumDataNotify(isAdded, sync, (boolean)false).
|
void |
endNumDataNotify(boolean isAdded,
boolean sync,
boolean shouldInit)
Indicates that LDM has finish to modify/upload new data data.
|
void |
endTransaction()
Notify a transaction has ended.
|
void |
flushTilesOfRes(int resolution)
Flush tiles of a given resolution from memory pool.
|
int |
getMemoryUsed()
This function is only used if in multiple data mode.
|
double[] |
getMinMax(SoLDMTileID tile)
Gets the minimum and maximum values in a tile of data.
|
SoBufferObject |
getTile(SoLDMTileID tileID,
short dataSetId)
Gets the data buffer associated with a tile for a given data set.
|
int |
getTileData(java.util.Collection<SoLDMTileID> tileIDs,
short volumeDataId,
SoLDMDataAccess pDataAccess)
This function must ensure that all the data associated with the input set of tiles is loaded in main memory when returning.
|
SbVec3i32 |
getTileDimension(SoLDMTileID tileID)
Get Tile dimension.
|
SoBufferObject |
getTileExt(SoLDMTileID tileID,
short dataSetId)
This function must return the data associated with the given tileID and dataSetId but it must be stored as a stack of slices along the X Inventor axis.
|
void |
init(SoLDMTileID tilesToLoad)
Function of initialization.
|
boolean |
isDataInMemory(SoLDMTileID tileID)
Indicates whether the data attached to a tile is in main memory.
|
boolean |
isInMemory(SoLDMTileID tileID)
Indicates whether a tile is in main memory.
|
void |
lockTile(SoLDMTileID tileId)
Set the LOCKED state to true for the given
SoLDMTileID . |
void |
lockTiles()
Set the LOCKED state to true for all tile loaded in memory.
|
void |
prioritizeTiles(SoLDMTileID maxTileId)
Allows to let the user know what tiles are prioritary and should not be reset in the resetWeight functions.
|
void |
releaseTileData(SoLDMTileID tileID)
Calls releaseTileData(tileID, (short)-1).
|
void |
releaseTileData(SoLDMTileID tileID,
short dataSetId)
Releases previously requested data associated with a given tileID from memory.
|
boolean |
requestRefetch(SoLDMTileID tileID,
double weight)
Launch an asynchronous request for the data attached to the specified tile.
|
void |
resetWeights()
Reset weights to init the topology before evaluating it.
|
void |
resourceChangeNotify()
Notification of a memory resource change.
|
void |
setAllowLoading(boolean allowLoad)
This function is called when using the NO_USER_INTERACTION mode.
|
void |
shouldInit()
Indicates that the manager should be initialized.
|
void |
startNumDataNotify()
Calls startNumDataNotify((int)-1, (int)-1).
|
void |
startNumDataNotify(int id)
Calls startNumDataNotify(id, (int)-1).
|
void |
startNumDataNotify(int id,
int entry)
Indicates that LDM starts to modify/upload new data data.
|
void |
startTransaction()
Functions to keep memory state stable when querying state.
|
void |
unLockTile(SoLDMTileID tileId)
Calls unLockTile(tileId, (boolean)false).
|
void |
unLockTile(SoLDMTileID tileId,
boolean forceUnload)
Set the LOCKED state to false for the given
SoLDMTileID . |
void |
unLockTiles()
Set the LOCKED state to false for all tiles loaded in memory.
|
void |
updateRegions(SbBox3i32[] region,
int numRegions)
Update a region of data in memory.
|
reset
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public void startNumDataNotify(int id)
public void releaseTileData(SoLDMTileID tileID)
public void startNumDataNotify()
public void endNumDataNotify(boolean isAdded, boolean sync)
public void unLockTile(SoLDMTileID tileId)
public boolean isDataInMemory(SoLDMTileID tileID)
This allows to manage data that implements SoBufferAsyncInterface. If the specified tile does not implement SoBufferAsyncInterface then this method always returns true. So effectively it always returns true for non-LDM volumes.
public SoBufferObject getTile(SoLDMTileID tileID, short dataSetId)
isInMemory
function and the answer was true.public boolean isInMemory(SoLDMTileID tileID)
public void resetWeights()
public SoBufferObject getTileExt(SoLDMTileID tileID, short dataSetId)
SoDataSet
is true. Allows equalizing performance of axis aligned slices roaming through a data set.public boolean requestRefetch(SoLDMTileID tileID, double weight)
public boolean checkResidencyAndUpdateWeight(SoLDMTileID tileID, float weight)
public void endNumDataNotify(boolean isAdded, boolean sync, boolean shouldInit)
public void startNumDataNotify(int id, int entry)
public void init(SoLDMTileID tilesToLoad)
SoLDMNodeFrontManager
initialization (so the tile manager can query the number of data tiles to manage by calling getNodeFrontManager()->getNumFileIDs()). The input parameter indicates which tiles should be in memory after initialization. All tileIds between 0 and up to tilesToLoad must be in memory.public void endTransaction()
public void startTransaction()
endTransaction
is called. A transaction is defined as follow: startTransaction()
indicates the following set of functions will/might be called to analyze how texture front should evolve and what set of tiles to use to render a particular geometry. Note that the data front managed by the tile manager should evolve based on the weights passed by checkResidencyAndUpdateWeight
. For a given transaction, functions will be called in the following order: startTransaction
() { prioritizeTiles
(for topology evaluation). Only called once for all geometry. getMinMax
(for topology evaluation). Only called once for all geometry and if ignoring the fully transparent tiles. setAllowLoading
if NO_USER_INTERACTION mode is On. Only called once for all geometry. resetWeights
(for topology evaluation). Only called once for all geometry. checkResidencyAndUpdateWeight
(for octree evaluation). Only called once for all geometry. isInMemory
. Always called per geometry to calculate the texture front. Allows a tile manager user to know what tiles should be locked during a given transaction until getTile
is called. getTile
or getTileExt
. Called per geometry if there is a texture front change or if more texture can be loaded. } endTransaction()
public SbVec3i32 getTileDimension(SoLDMTileID tileID)
public void updateRegions(SbBox3i32[] region, int numRegions)
public void lockTiles()
public void prioritizeTiles(SoLDMTileID maxTileId)
public void unLockTiles()
public void flushTilesOfRes(int resolution)
public void shouldInit()
public int getMemoryUsed()
public void lockTile(SoLDMTileID tileId)
SoLDMTileID
.public int getTileData(java.util.Collection<SoLDMTileID> tileIDs, short volumeDataId, SoLDMDataAccess pDataAccess)
releaseTileData
is called. Called when using the data access functions (getData) from the SoLDMDataAccess
.public double[] getMinMax(SoLDMTileID tile)
SoVolumeRendering
).public void releaseTileData(SoLDMTileID tileID, short dataSetId)
public void unLockTile(SoLDMTileID tileId, boolean forceUnload)
SoLDMTileID
.public void setAllowLoading(boolean allowLoad)
public void resourceChangeNotify()
SoLDMResourceManager
, resourceChangeNotify is called to notify the SoLDMTileManager
that more tiles can be loaded or some must be unloaded.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com