![]() |
VR-Forces Developer's Guide
|
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.

Classes | |
| struct | LoadFileOptions |
Public Types | |
| typedef boost::unordered_set < std::string > | ExcludedExtensions |
| typedef std::deque< std::string > | FilePathList |
Public Member Functions | |
| virtual | ~DtFileCache () |
| virtual void | init () |
| virtual void | initSingletonDependencies () |
| LoadFileOptions | defaultOptions () const |
| virtual bool | getCachedNodeFile (const std::string &filePathIn, const FilePathList &paths, std::string &cachedFilePathOut, bool emitError) |
| virtual bool | getCachedImageFile (const std::string &filePathIn, const FilePathList &paths, std::string &cachedFilePathOut, bool emitError) |
| virtual void | setCachingEnabled (bool flag) |
| virtual bool | acceleratedCachingEnabled () const |
| virtual void | setCompressTextures (bool compress) |
| virtual bool | compressTexturesEnabled () const |
| virtual void | releaseResources () |
| virtual void | clearAccelerationCache () |
| virtual void | setInstancingEnabled (bool enabled) |
| virtual bool | instancingEnabled () const |
| bool | clearInstancesOnNewScene () const |
| void | setClearInstancesOnNewScene (bool clearInstances) |
| void | clearInstancingCache () |
| void | flushInstanceCache (bool multipass, bool flushNodes, bool flushTextures, bool flushImages) |
| unsigned int | flushCycleCount () |
| virtual void | ts_clearInstancingCache () |
| virtual void | setFromRecord (const makArchives::DtCacheSettingsRecord &rec) |
| virtual void | getRecord (makArchives::DtCacheSettingsRecord &rec) const |
| void | loadDefaults (bool loadOnlyFactorySettings=false) |
| void | saveAsDefaults () |
| void | exportSettings (const std::string &fileName) |
| void | importSettings (const std::string &fileName) |
| virtual ExcludedExtensions & | excludedExtensions () |
| bool | isExcludedExtension (const std::string &ext) const |
| const DtRecordSettingsBackupInterface * | settingsBackup () const |
| DtRecordSettingsBackupInterface * | settingsBackup () |
| DtDe & | getDe () |
| virtual void | ts_flushInstancingCache (bool multiPass, bool flushNodes, bool flushTextures, bool flushImages) |
| virtual bool | getOrLoadTexture (DtTextureInterface *textureWrapper, const std::string &filename, const DtFileCache::LoadFileOptions &loadFileOptions) |
Public Attributes | |
| boost::signalslib::signal< void()> | signal_clearInstanceCache |
Protected Member Functions | |
| virtual void | autoSaveDefaultsIfNeeded () |
| virtual bool | ts_isExcludedExtension (const std::string &ext) const |
| virtual void | addExcludedExtension (const std::string &ext) |
| virtual void | removeExcludedExtension (const std::string &ext) |
| DtFileCache (DtDe &de) | |
| virtual bool | save (const std::string &origFilename, const std::string &cachedFilename, bool optimize) |
Friends | |
| class | DtFileCacheCreator |
| class | DtDeSharedState |
| 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 |
Protected CTOR. Must be called by creator.
Must call init() after constructing before use
|
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.
| 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.
|
virtual |
Get or load a texture to cache no-op, osg overrides param DtTextureInterface* textureWrapper the interface the texture is set on param filename file to load param loadFileOptions, options.
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::signalslib::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 |