![]() |
VR-Forces 4.8 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. More... | |
| typedef std::deque< std::string > | FilePathList |
Public Member Functions | |
| virtual | ~DtFileCache () |
| DTOR. More... | |
| virtual void | init () |
| Initialize the cache. Must be called before using. More... | |
| virtual void | initSingletonDependencies () |
| Called during initialization after the object is created and registered with de. More... | |
| LoadFileOptions | defaultOptions () const |
| Get the current default options. More... | |
| 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. More... | |
| 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. More... | |
| virtual void | setCachingEnabled (bool flag) |
| Toggle caching on or off. More... | |
| virtual bool | acceleratedCachingEnabled () const |
| Returns true if caching is enabled. More... | |
| virtual void | setCompressTextures (bool compress) |
| Set whether all textures will be compressed. More... | |
| virtual bool | compressTexturesEnabled () const |
| Should we compress textures. More... | |
| virtual void | releaseResources () |
| Release all rendering resources. More... | |
| virtual void | clearAccelerationCache () |
| Clears the cache. More... | |
| virtual void | setInstancingEnabled (bool enabled) |
| Sets whether model instancing is enabled. More... | |
| virtual bool | instancingEnabled () const |
| Returns true if model instancing is enabled. More... | |
| bool | clearInstancesOnNewScene () const |
| Returns whether to clear instances on new scene. More... | |
| void | setClearInstancesOnNewScene (bool clearInstances) |
| Returns whether to clear instances on new scene. More... | |
| void | clearInstancingCache () |
| Clear the model instance cache. More... | |
| void | flushInstanceCache (bool multipass, bool flushNodes, bool flushTextures, bool flushImages) |
| Removes all instances that only have 1 reference. More... | |
| unsigned int | flushCycleCount () |
| Get the flush cycle count, this is incremented each time flush instance cache is called. More... | |
| virtual void | ts_clearInstancingCache () |
| Clear the model instance cache. More... | |
| virtual void | setFromRecord (const makArchives::DtCacheSettingsRecord &rec) |
| Set the DtFileCache state from a cache settings record. More... | |
| virtual void | getRecord (makArchives::DtCacheSettingsRecord &rec) |
| Fill out a cache settings record with the DtFileCache state. More... | |
| virtual void | getSplitRecord (std::vector< makArchives::DtCacheSettingsRecord > &rec, std::vector< std::string > &fileNames) |
| To support writing element definitions in folders as multiple files not implemented for DtFileCache. More... | |
| virtual void | addRecords (makArchives::DtCacheSettingsRecord &recs, makArchives::DtCacheSettingsRecord &combinedRec) |
| To support writing element definitions in folders as multiple files not implemented for DtFileCache. More... | |
| void | loadDefaults (bool loadOnlyFactorySettings=false) |
| Called from CTOR to load the default settings. More... | |
| void | saveAsDefaults () |
| Called to save the current settings as the default settings. More... | |
| void | exportSettings (const std::string &fileName) |
| Exports the current cache settings to a file. More... | |
| void | importSettings (const std::string &fileName) |
| Import the current cache settings from a file. More... | |
| virtual ExcludedExtensions & | excludedExtensions () |
| Accessor for excluded extensions. More... | |
| bool | isExcludedExtension (const std::string &ext) const |
| Check if the extension is in the list of excluded file types. More... | |
| const DtRecordSettingsBackupInterface * | settingsBackup () const |
| DtRecordSettingsBackupInterface * | settingsBackup () |
| DtDe & | getDe () |
| virtual void | ts_flushInstancingCache (bool multiPass, bool flushNodes, bool flushTextures, bool flushImages) |
| Thread safe call to flush the cache. More... | |
Public Attributes | |
| boost::signal< void()> | signal_clearInstanceCache |
| Signal emmitted when clearCache is called, used to allow other caches to be cleared. More... | |
Protected Member Functions | |
| virtual void | autoSaveDefaultsIfNeeded () |
| Save the default settings if necessary. More... | |
| virtual bool | ts_isExcludedExtension (const std::string &ext) const |
| Thread safe call. More... | |
| 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. More... | |
| 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. More... | |
| DtFileCache (DtDe &de) | |
| Protected CTOR. More... | |
| virtual bool | save (const std::string &origFilename, const std::string &cachedFilename, bool optimize) |
| Returns true if origFilename was successfully written out as cachedFilename. More... | |
Friends | |
| class | DtFileCacheCreator |
| This allows the protected constructor to be called by the DtFileCacheCreator. More... | |
| class | DtDeSharedState |
| This allows the de shared DtDeSharedState clear the cache. More... | |
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 |
DTOR.
|
protected |
|
virtual |
Initialize the cache. Must be called before using.
|
virtual |
Called during initialization after the object is created and registered with de.
Any singleton dependencies need to be created here to prepare for multi-threaded code.
Reimplemented in makVrv::DtOsgFileCache.
| LoadFileOptions makVrv::DtFileCache::defaultOptions | ( | ) | const |
Get the current default options.
|
virtual |
Returns true if cachedFilePathOut contains the path to a cached version of filePathIn.
|
virtual |
Returns true if cachedFilePathOut contains the path to a cached version of filePathIn.
|
virtual |
Toggle caching on or off.
|
virtual |
Returns true if caching is enabled.
|
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 |
Should we compress textures.
|
virtual |
Release all rendering resources.
Reimplemented in makVrv::DtOsgFileCache.
|
virtual |
Clears the cache.
|
virtual |
Sets whether model instancing is enabled.
|
virtual |
Returns true if model instancing is enabled.
| bool makVrv::DtFileCache::clearInstancesOnNewScene | ( | ) | const |
Returns whether to clear instances on new scene.
| void makVrv::DtFileCache::setClearInstancesOnNewScene | ( | bool | clearInstances | ) |
Returns whether to clear instances on new scene.
| void makVrv::DtFileCache::clearInstancingCache | ( | ) |
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. Async has been removed for now since it flushing this cache is not thread safe yet.
Get the flush cycle count, this is incremented each time flush instance cache is called.
|
virtual |
Clear the model instance cache.
Reimplemented in makVrv::DtOsgFileCache.
|
virtual |
Set the DtFileCache state from a cache settings record.
Reimplemented in makVrv::DtOsgFileCache.
|
virtual |
Fill out a cache settings record with the DtFileCache state.
|
inlinevirtual |
To support writing element definitions in folders as multiple files not implemented for DtFileCache.
|
inlinevirtual |
To support writing element definitions in folders as multiple files not implemented for DtFileCache.
| 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 |
Accessor for excluded extensions.
|
inline |
Check if the extension is in the list of excluded file types.
|
inline |
|
inline |
|
inline |
|
virtual |
Thread safe call to flush the cache.
Reimplemented in makVrv::DtOsgFileCache.
|
protectedvirtual |
Save the default settings if necessary.
|
protectedvirtual |
Thread safe call.
|
protectedvirtual |
Add the extension to the list of excluded file types This function can only be called in the CTOR of the file cache.
|
protectedvirtual |
remove the extension from the list of excluded file types This function can only be called in the CTOR of the file cache.
|
protectedvirtual |
Returns true if origFilename was successfully written out as cachedFilename.
Reimplemented in makVrv::DtOsgFileCache.
|
friend |
This allows the protected constructor to be called by the DtFileCacheCreator.
|
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.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |