![]() |
VR-Forces Developer's Guide
|
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< Record > | read (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 |
|
protected |
|
explicit |
Constructor.
| filename | Path to cache file. Will be created if it doesn't exist. |
| profile | osgearth profile for the terrain. |
| erasePrevious | if true then previous cache file will be erased if it exists. |
|
virtual |
Virtual destructor.
|
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 |
Write data to the cache and add it to the map. Data added here will be returned by future calls to read.
|
virtual |
clear the cache (on rewind for example)
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
offset in the file where we store the offset where the record will be written.
|
protected |
offset in the file where the next record will be written.
|
protected |
|
mutableprotected |
|
protected |