VR-Forces 4.7 Class Documentation
 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. More...

Classes

struct  Record
 Data for masks in a given tilekey. More...

Public Member Functions

 DtCutoutCache (const DtFilename &filename, const osgEarth::Profile *profile, bool erasePrevious=false)
 Constructor.
virtual ~DtCutoutCache ()
 Virtual destructor.
virtual boost::shared_ptr< Recordread (const osgEarth::TileKey &key)
 Return cutout data for a given tilekey.
virtual void write (const osgEarth::TileKey &key, const DtCollisionObjectList &objects, const DtTileData::Extent::Vector &maskExtents)
 Write data to the cache and add it to the map.

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
 offset in the file where we store the offset where the record will be written.
DtObjectDB::Offset myNextWriteLocation
 offset in the file where the next record will be written.
CacheMap myCacheMap

Detailed Description

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.

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.

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

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)