VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DtCutoutCache Class Reference

Contains DtCutoutCache. Binary db for storing cached osgearth cutouts.

Cache for mask extents and skirt geometry generated by osgearth for cutouts. Generating this data is slow so caching it greatly increasing terrain loading in areas that intersect the cutouts. Existing data is read from the cache file in the constructor. New data is appended in the write function.

Classes

struct  Record
 

Public Member Functions

 DtCutoutCache (const DtFilename &filename, const osgEarth::Profile *profile, bool erasePrevious=false)
 
virtual ~DtCutoutCache ()
 
virtual boost::shared_ptr< Recordread (const osgEarth::TileKey &key)
 
virtual void write (const osgEarth::TileKey &key, const DtCollisionObjectList &objects, const DtTileData::Extent::Vector &maskExtents)
 
virtual void clear ()
 

Protected Types

typedef std::map
< osgEarth::TileKey,
boost::shared_ptr< Record > > 
CacheMap
 

Protected Member Functions

void fillCache ()
 

Protected Attributes

DtObjectDB::Ptr myObjectDB
 
boost::scoped_ptr
< DtObjectDB::Cursor
myCursor
 
osg::ref_ptr< const
osgEarth::Profile > 
myProfile
 
DtObjectDB::Offset myNextWriteLocationOffset
 
DtObjectDB::Offset myNextWriteLocation
 
CacheMap myCacheMap
 
tbb::spin_rw_mutex myCacheMutex
 
const std::string myCacheFilename
 

Member Typedef Documentation

typedef std::map<osgEarth::TileKey, boost::shared_ptr<Record> > DtCutoutCache::CacheMap
protected

Constructor & Destructor Documentation

DtCutoutCache::DtCutoutCache ( const DtFilename &  filename,
const osgEarth::Profile *  profile,
bool  erasePrevious = false 
)
explicit

Constructor.

Parameters
filenamePath to cache file. Will be created if it doesn't exist.
profileosgearth profile for the terrain.
erasePreviousif true then previous cache file will be erased if it exists.
virtual DtCutoutCache::~DtCutoutCache ( )
virtual

Virtual destructor.

Member Function Documentation

virtual boost::shared_ptr<Record> DtCutoutCache::read ( const osgEarth::TileKey &  key)
virtual

Return cutout data for a given tilekey. This function does not access the disk. Returns null if the data for the key is not in the cache. The caller must then generate the data and then add it by calling write.

virtual void DtCutoutCache::write ( const osgEarth::TileKey &  key,
const DtCollisionObjectList objects,
const DtTileData::Extent::Vector maskExtents 
)
virtual

Write data to the cache and add it to the map. Data added here will be returned by future calls to read.

virtual void DtCutoutCache::clear ( )
virtual

clear the cache (on rewind for example)

void DtCutoutCache::fillCache ( )
protected

Member Data Documentation

DtObjectDB::Ptr DtCutoutCache::myObjectDB
protected
boost::scoped_ptr<DtObjectDB::Cursor> DtCutoutCache::myCursor
protected
osg::ref_ptr<const osgEarth::Profile> DtCutoutCache::myProfile
protected
DtObjectDB::Offset DtCutoutCache::myNextWriteLocationOffset
protected

offset in the file where we store the offset where the record will be written.

DtObjectDB::Offset DtCutoutCache::myNextWriteLocation
protected

offset in the file where the next record will be written.

CacheMap DtCutoutCache::myCacheMap
protected
tbb::spin_rw_mutex DtCutoutCache::myCacheMutex
mutableprotected
const std::string DtCutoutCache::myCacheFilename
protected

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)