![]() |
VR-Forces 4.0.4 Class Documentation
|
Handles the caching of files. More...

Classes | |
| struct | LoadFileOptions |
Public Types | |
| typedef boost::unordered_set < std::string > | ExcludedExtensions |
| A set of extensions excluded from the cache. | |
| typedef std::deque< std::string > | FilePathList |
Public Member Functions | |
| virtual | ~DtFileCache () |
| CTOR. | |
| LoadFileOptions | defaultOptions () |
| Get the current default options. | |
| virtual bool | getCachedNodeFile (const std::string &filePathIn, const FilePathList &paths, std::string &cachedFilePathOut, bool emitError) |
| Returns true if cachedFilePathOut contains the path to a cached version of filePathIn. | |
| virtual bool | getCachedImageFile (const std::string &filePathIn, const FilePathList &paths, std::string &cachedFilePathOut, bool emitError) |
| Returns true if cachedFilePathOut contains the path to a cached version of filePathIn. | |
| virtual void | setCachingEnabled (bool flag) |
| Toggle caching on or off. | |
| virtual bool | acceleratedCachingEnabled () const |
| Returns true if caching is enabled. | |
| virtual void | setCompressTextures (bool compress) |
| Set whether all textures will be compressed. | |
| virtual bool | compressTexturesEnabled () const |
| Should we compress textures. | |
| virtual void | releaseResources () |
| Release all rendering resources. | |
| virtual void | clearAccelerationCache () |
| Clears the cache. | |
| virtual void | setInstancingEnabled (bool enabled) |
| Sets whether model instancing is enabled. | |
| virtual bool | instancingEnabled () |
| Returns true if model instancing is enabled. | |
| bool | clearInstancesOnNewScene () const |
| Returns whether to clear instances on new scene. | |
| void | setClearInstancesOnNewScene (bool clearInstances) |
| Returns whether to clear instances on new scene. | |
| void | clearInstancingCache () |
| Clear the model instance cache. | |
| void | flushInstanceCache (bool multipass, bool flushNodes, bool flushTextures, bool flushImages) |
| Removes all instances that only have 1 reference. | |
| unsigned int | flushCycleCount () |
| Get the flush cycle count, this is incremented each time flush instance cache is called. | |
| virtual void | ts_clearInstancingCache () |
| Clear the model instance cache. | |
| virtual void | setFromRecord (const makArchives::DtCacheSettingsRecord &rec) |
| Set the DtFileCache state from a cache settings record. | |
| virtual void | getRecord (makArchives::DtCacheSettingsRecord &rec) |
| Fill out a cache settings record with the DtFileCache state. | |
| void | loadDefaults (bool loadOnlyFactorySettings=false) |
| Called from CTOR to load the default settings. | |
| void | saveAsDefaults () |
| Called to save the current settings as the default settings. | |
| void | exportSettings (const std::string &fileName) |
| Exports the current cache settings to a file. | |
| void | importSettings (const std::string &fileName) |
| Import the current cache settings from a file. | |
| virtual ExcludedExtensions & | excludedExtensions () |
| Accessor for excluded extensions. | |
| bool | isExcludedExtension (const std::string &ext) const |
| Check if the extension is in the list of excluded file types. | |
| const DtRecordSettingsBackupInterface * | settingsBackup () const |
| DtRecordSettingsBackupInterface * | settingsBackup () |
Public Attributes | |
| boost::signal< void()> | signal_clearInstanceCache |
| Signal emmitted when clearCache is called, used to allow other caches to be cleared. | |
Protected Member Functions | |
| virtual void | autoSaveDefaultsIfNeeded () |
| Save the default settings if necessary. | |
| virtual bool | ts_isExcludedExtension (const std::string &ext) const |
| Thread safe call. | |
| virtual void | ts_flushInstancingCache (bool multiPass, bool flushNodes, bool flushTextures, bool flushImages) |
| Thread safe call to flush the cache. | |
| virtual void | addExcludedExtension (const std::string &ext) |
| Add the extension to the list of excluded file types This function can only be called in the CTOR of the file cache. | |
| virtual void | removeExcludedExtension (const std::string &ext) |
| remove the extension from the list of excluded file types This function can only be called in the CTOR of the file cache. | |
| DtFileCache (DtDe &de) | |
| Protected CTOR. Must be called by creator. | |
| virtual bool | save (const std::string &origFilename, const std::string &cachedFilename) |
| Returns true if origFilename was successfully written out as cachedFilename. | |
Protected Attributes | |
| DtDe & | myDe |
| bool | myCachingEnabled |
| bool | myCompressTextureFlag |
| bool | myClearInstancesOnNewSceneFlag |
| bool | myInstancingEnabled |
| unsigned int | myFlushCycleCount |
| ExcludedExtensions | myExcludedExtensionMap |
| DtRecordSettingsBackupInterface * | mySettingsBackup |
Friends | |
| class | DtFileCacheCreator |
| This allows the protected constructor to be called by the DtFileCacheCreator. | |
| class | DtDeSharedState |
| This allows the de shared DtDeSharedState clear the cache. | |
Handles the caching of files.
Includes functions for excluding files with certain extensions from being cached, which must be set correctly for prop extraction to work.
| typedef boost::unordered_set<std::string> makVrv::DtFileCache::ExcludedExtensions |
A set of extensions excluded from the cache.
| typedef std::deque<std::string> makVrv::DtFileCache::FilePathList |
| virtual makVrv::DtFileCache::~DtFileCache | ( | ) | [virtual] |
CTOR.
| makVrv::DtFileCache::DtFileCache | ( | DtDe & | de | ) | [protected] |
Protected CTOR. Must be called by creator.
Get the current default options.
| virtual bool makVrv::DtFileCache::getCachedNodeFile | ( | const std::string & | filePathIn, |
| const FilePathList & | paths, | ||
| std::string & | cachedFilePathOut, | ||
| bool | emitError | ||
| ) | [virtual] |
Returns true if cachedFilePathOut contains the path to a cached version of filePathIn.
| virtual bool makVrv::DtFileCache::getCachedImageFile | ( | const std::string & | filePathIn, |
| const FilePathList & | paths, | ||
| std::string & | cachedFilePathOut, | ||
| bool | emitError | ||
| ) | [virtual] |
Returns true if cachedFilePathOut contains the path to a cached version of filePathIn.
| virtual void makVrv::DtFileCache::setCachingEnabled | ( | bool | flag | ) | [virtual] |
Toggle caching on or off.
| virtual bool makVrv::DtFileCache::acceleratedCachingEnabled | ( | ) | const [virtual] |
Returns true if caching is enabled.
| virtual void makVrv::DtFileCache::setCompressTextures | ( | bool | compress | ) | [virtual] |
Set whether all textures will be compressed.
This slows down texture loading unless the input file is already compressed. Only .DDS and .MEIF files support HW compressed. JPEG, PNG etc are NOT considered compressed formats.
| virtual bool makVrv::DtFileCache::compressTexturesEnabled | ( | ) | const [virtual] |
Should we compress textures.
| virtual void makVrv::DtFileCache::releaseResources | ( | ) | [virtual] |
Release all rendering resources.
Reimplemented in makVrv::DtOsgFileCache.
| virtual void makVrv::DtFileCache::clearAccelerationCache | ( | ) | [virtual] |
Clears the cache.
| virtual void makVrv::DtFileCache::setInstancingEnabled | ( | bool | enabled | ) | [virtual] |
Sets whether model instancing is enabled.
| virtual bool makVrv::DtFileCache::instancingEnabled | ( | ) | [virtual] |
Returns true if model instancing is enabled.
Returns whether to clear instances on new scene.
| void makVrv::DtFileCache::setClearInstancesOnNewScene | ( | bool | clearInstances | ) |
Returns whether to clear instances on new scene.
Clear the model instance cache.
| void makVrv::DtFileCache::flushInstanceCache | ( | bool | multipass, |
| bool | flushNodes, | ||
| bool | flushTextures, | ||
| bool | flushImages | ||
| ) |
Removes all instances that only have 1 reference.
When multipass = true, while a flush causes item[s] to be removed then another flush will be called. This allows instances that are referenced by other instances to be cleared.
| unsigned int makVrv::DtFileCache::flushCycleCount | ( | ) |
Get the flush cycle count, this is incremented each time flush instance cache is called.
| virtual void makVrv::DtFileCache::ts_clearInstancingCache | ( | ) | [virtual] |
Clear the model instance cache.
Reimplemented in makVrv::DtOsgFileCache.
| virtual void makVrv::DtFileCache::setFromRecord | ( | const makArchives::DtCacheSettingsRecord & | rec | ) | [virtual] |
Set the DtFileCache state from a cache settings record.
| virtual void makVrv::DtFileCache::getRecord | ( | makArchives::DtCacheSettingsRecord & | rec | ) | [virtual] |
Fill out a cache settings record with the DtFileCache state.
| void makVrv::DtFileCache::loadDefaults | ( | bool | loadOnlyFactorySettings = false | ) |
Called from CTOR to load the default settings.
| void makVrv::DtFileCache::saveAsDefaults | ( | ) |
Called to save the current settings as the default settings.
| void makVrv::DtFileCache::exportSettings | ( | const std::string & | fileName | ) |
Exports the current cache settings to a file.
| void makVrv::DtFileCache::importSettings | ( | const std::string & | fileName | ) |
Import the current cache settings from a file.
| virtual ExcludedExtensions& makVrv::DtFileCache::excludedExtensions | ( | ) | [virtual] |
Accessor for excluded extensions.
| bool makVrv::DtFileCache::isExcludedExtension | ( | const std::string & | ext | ) | const [inline] |
Check if the extension is in the list of excluded file types.
| const DtRecordSettingsBackupInterface* makVrv::DtFileCache::settingsBackup | ( | ) | const [inline] |
| virtual void makVrv::DtFileCache::autoSaveDefaultsIfNeeded | ( | ) | [protected, virtual] |
Save the default settings if necessary.
| virtual bool makVrv::DtFileCache::ts_isExcludedExtension | ( | const std::string & | ext | ) | const [protected, virtual] |
Thread safe call.
| virtual void makVrv::DtFileCache::ts_flushInstancingCache | ( | bool | multiPass, |
| bool | flushNodes, | ||
| bool | flushTextures, | ||
| bool | flushImages | ||
| ) | [protected, virtual] |
Thread safe call to flush the cache.
Reimplemented in makVrv::DtOsgFileCache.
| virtual void makVrv::DtFileCache::addExcludedExtension | ( | const std::string & | ext | ) | [protected, virtual] |
Add the extension to the list of excluded file types This function can only be called in the CTOR of the file cache.
| virtual void makVrv::DtFileCache::removeExcludedExtension | ( | const std::string & | ext | ) | [protected, virtual] |
remove the extension from the list of excluded file types This function can only be called in the CTOR of the file cache.
| virtual bool makVrv::DtFileCache::save | ( | const std::string & | origFilename, |
| const std::string & | cachedFilename | ||
| ) | [protected, virtual] |
Returns true if origFilename was successfully written out as cachedFilename.
friend class DtFileCacheCreator [friend] |
This allows the protected constructor to be called by the DtFileCacheCreator.
friend class DtDeSharedState [friend] |
This allows the de shared DtDeSharedState clear the cache.
| boost::signal<void ()> makVrv::DtFileCache::signal_clearInstanceCache |
Signal emmitted when clearCache is called, used to allow other caches to be cleared.
DtDe& makVrv::DtFileCache::myDe [protected] |
bool makVrv::DtFileCache::myCachingEnabled [protected] |
bool makVrv::DtFileCache::myCompressTextureFlag [protected] |
bool makVrv::DtFileCache::myInstancingEnabled [protected] |
unsigned int makVrv::DtFileCache::myFlushCycleCount [protected] |