SoLDMTileManager Class Reference
[Kernel]

Large Data Management LDM Tile Manager More...

#include <LDM/SoLDMTileManager.h>

Inheritance diagram for SoLDMTileManager:
SoLDMLargeDataManagement

List of all members.

Classes

class  LDMSliceAccessor
 Allows accessing a 2D buffer for slice and volumeSkin rendering. More...

Public Member Functions

 SoLDMTileManager ()
virtual ~SoLDMTileManager ()
virtual void init (SoLDMTileID tilesToLoad)=0
virtual void startNumDataNotify (int id=-1, int entry=-1)=0
virtual void endNumDataNotify (bool isAdded, bool sync, bool shouldInit=false)=0
virtual SbVec3i32 getTileDimension (SoLDMTileID tileID) const =0
virtual void startTransaction ()=0
virtual void endTransaction ()=0
virtual bool checkResidencyAndUpdateWeight (SoLDMTileID tileID, float weight)=0
virtual bool isInMemory (SoLDMTileID tileID) const =0
virtual bool isDataInMemory (const SoLDMTileID &tileID) const =0
virtual bool requestRefetch (const SoLDMTileID &tileID, const double weight) const =0
virtual const SoBufferObjectgetTile (SoLDMTileID tileID, unsigned short dataSetId)=0
virtual const SoBufferObjectgetTileExt (SoLDMTileID tileID, unsigned short dataSetId)=0
virtual LDMSliceAccessorgetLdmSliceAccessor (const SoLDM::DataSetIdPair &p)=0
virtual bool getMinMax (SoLDMTileID tile, double &min, double &max) const =0
virtual void getTileData (const std::vector< SoLDMTileID > &tileIDs, int &errorIndicator, unsigned short volumeDataId, SoLDMDataAccess *pDataAccess)=0
virtual bool requestTileData (int requestId, int &memError, SoLDMDataAccess &dataAccess)
virtual void releaseTileData (SoLDMTileID tileID, unsigned short dataSetId=-1)=0
virtual void resourceChangeNotify ()=0
virtual void setAllowLoading (bool allowLoad)=0
virtual void resetWeights ()=0
virtual void prioritizeTiles (SoLDMTileID maxTileId)=0
virtual void updateRegions (const SbBox3i32 *region, int numRegions)=0
virtual int getMemoryUsed () const =0
virtual void flushTilesOfRes (int resolution)=0
virtual void getTileIDInMemory (std::vector< LDM_TILE_ID_TYPE > &tilesInMemory) const
virtual void shouldInit ()
virtual void unLockTiles ()=0
virtual void lockTiles ()=0
virtual void lockTile (const SoLDMTileID &tileId)=0
virtual void unLockTile (const SoLDMTileID &tileId, bool forceUnload=false)=0

Deprecated



virtual SoDEPRECATED void getTileData (const std::vector< SoLDMTileID > &tileIDs, int &errorIndicator, unsigned short volumeDataId)

Detailed Description

Large Data Management LDM Tile Manager

This class is only needed for advanced users who intend to extend or replace internal LDM algorithms.

NOTE: 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:

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


Constructor & Destructor Documentation

SoLDMTileManager::SoLDMTileManager (  )  [inline]

Constructor.

virtual SoLDMTileManager::~SoLDMTileManager (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual bool SoLDMTileManager::checkResidencyAndUpdateWeight ( SoLDMTileID  tileID,
float  weight 
) [pure virtual]

Returns whether the input tile resides in memory and update its weight.

The input weight is an indication of how LDM prioritize data for the current scene state. Tiles of higher weight should arrive in memory first. Note that the root tile must always resides in memory.

virtual void SoLDMTileManager::endNumDataNotify ( bool  isAdded,
bool  sync,
bool  shouldInit = false 
) [pure virtual]

Indicates that LDM has finish to modify/upload new data data.

virtual void SoLDMTileManager::endTransaction (  )  [pure virtual]

Notify a transaction has ended.

virtual void SoLDMTileManager::flushTilesOfRes ( int  resolution  )  [pure virtual]

Flush tiles of a given resolution from memory pool.

Called only if the fixedResolution LDM mode is ON or if the maximum resolution threshold changes (See LDMResourceParameter).

virtual LDMSliceAccessor* SoLDMTileManager::getLdmSliceAccessor ( const SoLDM::DataSetIdPair p  )  [pure virtual]

Return an instance of slice accessor handling the data corresponding to the given data set/id pair.

Called when rendering an SoOrthoSlice. When subclassing from the tile manager there is no immediate need to redefine the functions of the slice accessor. LDM already handles the extraction of the buffer from the 3D tile. One can simply use the LDMDefaultSliceAccessor.

virtual int SoLDMTileManager::getMemoryUsed (  )  const [pure virtual]

This function is only used if in multiple data mode.

There was a scene graph change in multiple data mode and only one tile manager must remain for all data sets involved. LDM will keep the one that has loaded the more data.

virtual bool SoLDMTileManager::getMinMax ( SoLDMTileID  tile,
double &  min,
double &  max 
) const [pure virtual]

Gets the minimum and maximum values in a tile of data.


The returned value indicates whether it has been calculated yet or in other words, if the tile was ever loaded. Only called if ignoring fully transparent tiles (see SoVolumeRendering).

virtual const SoBufferObject* SoLDMTileManager::getTile ( SoLDMTileID  tileID,
unsigned short  dataSetId 
) [pure virtual]

Gets the data buffer associated with a tile for a given data set.

LDM expects the data to be stored as a stack of slices along the Z Inventor axis. Called after texture front evaluation. Only called on tiles that the tile manager declared as resident in memory. The input tileID has been called previously by the isInMemory function and the answer was true.

virtual SoDEPRECATED void SoLDMTileManager::getTileData ( const std::vector< SoLDMTileID > &  tileIDs,
int &  errorIndicator,
unsigned short  volumeDataId 
) [inline, virtual]

This function must ensure that all the data associated with the input set of tiles is loaded in main memory when returning.

The data associated to a given tileID must be locked in memory until releaseTileData is called. Called when using the data access functions (getData) from the SoLDMDataAccess.

Deprecated:

Deprecated since Open Inventor 7000
Use getTileData( const std::vector<SoLDMTileID>& tileIDs, int& errorIndicator, unsigned short volumeDataId) instead.
virtual void SoLDMTileManager::getTileData ( const std::vector< SoLDMTileID > &  tileIDs,
int &  errorIndicator,
unsigned short  volumeDataId,
SoLDMDataAccess pDataAccess 
) [pure virtual]

This function must ensure that all the data associated with the input set of tiles is loaded in main memory when returning.

The data associated to a given tileID must be locked in memory until releaseTileData is called. Called when using the data access functions (getData) from the SoLDMDataAccess.

virtual SbVec3i32 SoLDMTileManager::getTileDimension ( SoLDMTileID  tileID  )  const [pure virtual]

Get Tile dimension.

For the default topology (octree) this function should always return the same size.

virtual const SoBufferObject* SoLDMTileManager::getTileExt ( SoLDMTileID  tileID,
unsigned short  dataSetId 
) [pure virtual]

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.

Only called if the useExtendedData flag from SoDataSet is TRUE. Allows equalizing performance of axis aligned slices roaming through a data set.

void SoLDMTileManager::getTileIDInMemory ( std::vector< LDM_TILE_ID_TYPE > &  tilesInMemory  )  const [inline, virtual]

Debug purpose only.

Used for visual feedback to highlight tiles in main memory. Only called if the SoVolumeRendering::DRAW_TOPOLOGY flag is true.

virtual void SoLDMTileManager::init ( SoLDMTileID  tilesToLoad  )  [pure virtual]

Function of initialization.

This function is called only once after the 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.

virtual bool SoLDMTileManager::isDataInMemory ( const SoLDMTileID tileID  )  const [pure virtual]

Indicates whether the data attached to a tile is in main memory.

Called when the node front manager evaluates the texture front.

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.

virtual bool SoLDMTileManager::isInMemory ( SoLDMTileID  tileID  )  const [pure virtual]

Indicates whether a tile is in main memory.

Called when the node front manager evaluates the texture front.

virtual void SoLDMTileManager::lockTile ( const SoLDMTileID tileId  )  [pure virtual]

Set the LOCKED state to true for the given SoLDMTileID.

virtual void SoLDMTileManager::lockTiles (  )  [pure virtual]

Set the LOCKED state to true for all tile loaded in memory.

virtual void SoLDMTileManager::prioritizeTiles ( SoLDMTileID  maxTileId  )  [pure virtual]

Allows to let the user know what tiles are prioritary and should not be reset in the resetWeight functions.

All tileIds between 0 and up to maxTileId are prioritary. This function is called right before the resetWeight function.

virtual void SoLDMTileManager::releaseTileData ( SoLDMTileID  tileID,
unsigned short  dataSetId = -1 
) [pure virtual]

Releases previously requested data associated with a given tileID from memory.

If supported, dataSetId allows you to specify which data set should be released. -1 means all data sets in the MultiDataVolumeGroup.

virtual bool SoLDMTileManager::requestRefetch ( const SoLDMTileID tileID,
const double  weight 
) const [pure virtual]

Launch an asynchronous request for the data attached to the specified tile.

This allows to manage data that implements SoBufferAsyncInterface.

bool SoLDMTileManager::requestTileData ( int  requestId,
int &  memError,
SoLDMDataAccess dataAccess 
) [inline, virtual]

Initiates an asynchronous request and returns immediately.

It must use dataAccess->getRequestedTile() to get the requested tile list. Returns true if the request is in fact synchronous (all tiles were already loaded).

virtual void SoLDMTileManager::resetWeights (  )  [pure virtual]

Reset weights to init the topology before evaluating it.

This function is called before a topology evaluation starting with checkResidencyAndUpdateWeight(0, weight).

virtual void SoLDMTileManager::resourceChangeNotify (  )  [pure virtual]

Notification of a memory resource change.

If the application changes the main memory resource using the SoLDMResourceManager, resourceChangeNotify is called to notify the SoLDMTileManager that more tiles can be loaded or some must be unloaded.

virtual void SoLDMTileManager::setAllowLoading ( bool  allowLoad  )  [pure virtual]

This function is called when using the NO_USER_INTERACTION mode.

This mode should essentially allow loading only when the user does not interact with the scene.

virtual void SoLDMTileManager::shouldInit (  )  [inline, virtual]

Indicates that the manager should be initialized.

virtual void SoLDMTileManager::startNumDataNotify ( int  id = -1,
int  entry = -1 
) [pure virtual]

Indicates that LDM starts to modify/upload new data data.

virtual void SoLDMTileManager::startTransaction (  )  [pure virtual]

Functions to keep memory state stable when querying state.

Indicates a memory transaction is starting. Memory state should not change until 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()

virtual void SoLDMTileManager::unLockTile ( const SoLDMTileID tileId,
bool  forceUnload = false 
) [pure virtual]

Set the LOCKED state to false for the given SoLDMTileID.

virtual void SoLDMTileManager::unLockTiles (  )  [pure virtual]

Set the LOCKED state to FALSE for all tiles loaded in memory.

virtual void SoLDMTileManager::updateRegions ( const SbBox3i32 region,
int  numRegions 
) [pure virtual]

Update a region of data in memory.

All the tiles intersecting the regions must be refetched. Called if the application uses the SoDataSet::updateRegion function.


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

Open Inventor by FEI reference manual, generated on 19 Aug 2019
Copyright © FEI S.A.S. All rights reserved.
http://www.openinventor.com/