![]() |
VR-Forces 5.0.1 Developer's Guide
|
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive's for quicker load times, except for files with an extension in the excluded extensions list.

Public Member Functions | |
| virtual | ~DtOsgFileCache () |
| virtual void | initSingletonDependencies () |
| virtual void | releaseResources () |
| virtual void | releaseResources (osg::State *state) |
| virtual void | setFromRecord (const makArchives::DtCacheSettingsRecord &rec) |
| osg::Node * | readNodeFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions) |
| osg::ref_ptr< osg::Node > | findNodeFile (const std::string &inputFilename) |
| osg::Image * | readImageFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions) |
| virtual osg::Texture * | getTextureInstance (const std::string &filePath, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, osg::Texture::WrapMode s, osg::Texture::WrapMode t, const LoadFileOptions &loadFileOptions) |
| virtual void | ts_getTextureInstance (const std::string &filePath, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, osg::Texture::WrapMode s, osg::Texture::WrapMode t, const LoadFileOptions &loadFileOptions, osg::ref_ptr< osg::Texture > &texture) |
| virtual void | runMergeDuplicateTextureVisitor (osg::Node &node) |
| virtual void | encodeOptionsString (const LoadFileOptions &loadFileOptions, osgDB::ReaderWriter::Options &options) const |
| virtual void | decodeOptions (const osgDB::ReaderWriter::Options &options, LoadFileOptions &loadFileOptions) const |
| DtMetaFileManager * | metaFileManager () |
| void | cleanDataFilePathList (FilePathList &fileList) |
| virtual const DtOsgShaderFilesCache & | shaderFilesCache (void) const |
| virtual const std::string & | loadShaderSource (const std::string &shaderFile) const |
| virtual std::string | ts_getTextureFilePathAndSetNameIfNotSet (const osg::Texture *baseTexture) const |
| virtual void | ts_setEffectTextureName (osg::ref_ptr< osg::Texture > &effectTexture, const std::string &validFile) const |
| virtual void | ts_setEffectTextureFilterAndHardwareMipMapGen (osg::Texture *effectTexture, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, bool hardwareMipMapGen) const |
| virtual void | ts_compareAndSwapIgnoreHint (osg::Texture *effectTexture, bool oldVal, bool newVal) const |
| virtual bool | ts_checkAndSetIgnoreHint (osg::Object *obj, bool val, const char *hint) const |
| virtual bool | ts_ignore (osg::Object *obj, const char *hint) const |
| virtual const DtEffectControllerShaderCache & | effectControllerShaderCache (void) const |
| virtual void | setNumActivePagerThreads (int active) |
| virtual int | numActivePagerThreads () |
| virtual int | numImageProcessingTasks () const |
| virtual void | setNumDiguyWorkerThreads (int num) |
| virtual void | incrementNumSleepingPagerThreads () |
| virtual void | decrementNumSleepingPagerThreads () |
| virtual DtOsgShaderManager & | shaderManager (void) |
| virtual const DtOsgShaderManager & | shaderManager (void) const |
| virtual void | ts_flushInstancingCache (bool multipass, bool flushNodes, bool flushTextures, bool flushImages) |
| virtual int | numNodes () const |
| virtual int | numTextures () const |
| virtual int | numImages () const |
| virtual void | addImguiTextureUI (unsigned int contextID) |
| virtual void | connectImguiSignal () |
Public Member Functions inherited from makVrv::DtFileCache | |
| virtual | ~DtFileCache () |
| virtual void | init () |
| 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 | 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 | getRecord (makArchives::DtCacheSettingsRecord &rec) |
| virtual void | getSplitRecord (std::vector< makArchives::DtCacheSettingsRecord > &rec, std::vector< std::string > &fileNames) |
| virtual void | addRecords (makArchives::DtCacheSettingsRecord &recs, makArchives::DtCacheSettingsRecord &combinedRec) |
| 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 () |
Static Public Member Functions | |
| static void | optimizeNodeGeometry (osg::Node *node) |
Public Attributes | |
| boost::signalslib::signal < void(osg::Node *, const std::string &origFileName, const std::string &actualFileName)> | signal_nodeFileLoaded |
| boost::signalslib::signal < void(osg::Image *, const std::string &origFileName, const std::string &actualFileName)> | signal_imageFileLoaded |
| boost::signalslib::signal < void(osg::Object *, const std::string &origFileName, const std::string &actualFileName)> | signal_objectFileLoaded |
| boost::signalslib::signal < void(const std::string &filename, osgDB::ReaderWriter::ReadResult &, const osgDB::ReaderWriter::Options *)> | signal_readNodeCallback |
| boost::signalslib::signal < void(const std::string &filename, osgDB::ReaderWriter::ReadResult &, const osgDB::ReaderWriter::Options *)> | signal_readImageCallback |
| boost::signalslib::signal < void(const std::string &filename, osgDB::ReaderWriter::ReadResult &, const osgDB::ReaderWriter::Options *)> | signal_readObjectCallback |
Public Attributes inherited from makVrv::DtFileCache | |
| boost::signalslib::signal< void()> | signal_clearInstanceCache |
Protected Types | |
| typedef boost::unordered_map < std::string, std::string > | RelativePathCache |
| typedef std::map< std::string, osg::ref_ptr< osg::Object > > | AttrCacheMap |
Protected Member Functions | |
| virtual osg::ref_ptr< osg::Node > | ts_readNodeFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData) |
| virtual osg::ref_ptr< osg::Node > | ts_readCdbNodeFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData) |
| virtual osg::ref_ptr< osg::Node > | ts_findNodeFile (const std::string &inputFilename) |
| virtual osg::ref_ptr< osg::Image > | ts_readImageFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData=0L) |
| virtual osg::ref_ptr< osg::Image > | ts_readCdbImageFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData=0L) |
| virtual osg::ref_ptr< osg::Object > | ts_readObject (const std::string &filename, const osgDB::ReaderWriter::Options *options) |
| void | ts_encryptImage (const std::string &inputFileName, const std::string &outputFilename, const osgDB::ReaderWriter::Options *options, bool printToConsole) |
| bool | ts_resolveRelativeFilename (const LoadFileOptions &loadFileOptions, std::string &absoluteInputFilename) |
| virtual void | ts_clearInstancingCache () |
| virtual void | applyEffectTexture (osg::Node *node, const std::string &extension, bool isCdb, osgDB::ReaderWriter::Options *option) |
| DtOsgFileCache (DtDe &de) | |
| virtual bool | save (const std::string &origFilename, const std::string &cachedFilename, bool optimize) |
| bool | saveToAcceleratedFile (const std::string &origFileName, osg::Node *nodeRef, const std::string &cachedFilename, bool writeExternalReferences) |
| virtual void | addMetaFlightOptions (std::string &optionsString) |
| virtual bool | needsShaderGeneration (const std::string &extension, const LoadFileOptions &options) const |
| virtual void | updateGlobalOptions () |
| virtual void | slot_onDdsFlipChanged (bool flip) |
| virtual void | slot_instancingChanged (bool enabled) |
| virtual bool | getAttrFromLocalCache (const std::string &filename, osg::Object **attrData) |
| virtual void | writeCacheFile (osg::ref_ptr< osg::Node > node, const std::string &acceleratedFileLocation, DtCVMarkerSeries &series) |
| virtual void | shadersGeneration (osg::ref_ptr< osg::Node > node, const std::string &fileToLoad) |
| virtual void | squishImage (const std::string &fileToLoad, const std::string &acceleratedFilename, DtCVMarkerSeries &objectCreation, osg::ref_ptr< osg::Image > image, bool writeAcceleratedFile, bool isCDB) |
| virtual void | saveImageFilename (const std::string &absoluteInputFilename, osg::Image *image) |
| virtual osg::ref_ptr< osg::Image > | getCachedImage (const std::string &cacheKey, const std::string &inputExtension, const LoadFileOptions &loadFileOptions) |
Protected Member Functions inherited from makVrv::DtFileCache | |
| 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) | |
Friends | |
| class | DtOsgFileCacheCreator |
| class | DtReadFileCallback |
Additional Inherited Members | |
Public Types inherited from makVrv::DtFileCache | |
| typedef boost::unordered_set < std::string > | ExcludedExtensions |
| typedef std::deque< std::string > | FilePathList |
|
protected |
|
protected |
|
virtual |
CTOR.
|
protected |
Protected CTOR. Must be called by creator.
|
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 from makVrv::DtFileCache.
|
inlinevirtual |
Release all rendering resources.
Reimplemented from makVrv::DtFileCache.
|
virtual |
Release all rendering resources.
|
virtual |
Push loader options to global registry whenever they're loaded from a record.
Reimplemented from makVrv::DtFileCache.
|
static |
Run extra optimization passes on node.
Merges geometry and geodes skipped by regular OSG optimizer
| osg::Node* makVrv::DtOsgFileCache::readNodeFile | ( | const std::string & | inputFilename, |
| const LoadFileOptions & | loadFileOptions | ||
| ) |
Read a node file, provides options for controlling This is call is equivalent to osg::readNodeFile function with the options encoded in a options string.
|
inline |
Find a node file. If the file was already cached then a copy will be returned.
| osg::Image* makVrv::DtOsgFileCache::readImageFile | ( | const std::string & | inputFilename, |
| const LoadFileOptions & | loadFileOptions | ||
| ) |
Read a node file, provides options for controlling This is call is equivalent to osg::readImageFile function with the options encoded in a options string.
|
virtual |
Returns a cached texture instance, or a new copy of a texture if instancing is disabled; returns 0 if file failed to load.
|
virtual |
Passes back a cached texture instance, or a new copy of a texture if instancing is disabled; returns 0 if file failed to load use this instead of getTextureInstance if it is called outside the main thread.
|
virtual |
runs the duplicate textures visitor on this node
|
virtual |
Encode load file options into reader write options.
Reimplemented in DtVrfOsgFileCache, and DtVrfSingletonFileCache.
|
virtual |
Decode reader write options into load file options.
Reimplemented in DtVrfOsgFileCache, and DtVrfSingletonFileCache.
| DtMetaFileManager* makVrv::DtOsgFileCache::metaFileManager | ( | ) |
Retrieve the Metafile manager (load, parse .meta files)
| void makVrv::DtOsgFileCache::cleanDataFilePathList | ( | FilePathList & | fileList | ) |
Clean and remove duplicate paths from the input database path list (i.e. (../path/file/, ../path/file, ../aDir, ../aDir) becomes (../path/file, ../aDir) )
|
virtual |
access shader files cache
|
virtual |
load shader source via the shader manger, shader cache shader file is the file name of the shader (without path). The path is implicitly the path of the shader manager
|
virtual |
find the file path for an effect texture. set the name if its empty thread safe
|
virtual |
thread safe
|
virtual |
thread safe
|
virtual |
thread safe. CAS operation. Compares current with old val, swaps current with new val if current val == old val
|
virtual |
thread safe. Set the state of the ignore hint for a node It returns the previous value of the ignore flag and changes it to be val. Use this to mark nodes as ignored for future texture finding traversals
|
virtual |
thread safe. Check whether an object should be ignored during traversal
|
virtual |
access the controller shader cache
|
virtual |
called by osg renderer once a frame to let the file cache know how many pagers are running
|
virtual |
how many pagers are actively running, set by osg renderer.
|
virtual |
how many active squish mipmapping tasks that are going on
|
virtual |
how many active diguy threads are going on, added to imageProcessing tasks
|
virtual |
called by background threads to let filecache know that the thread has suspended typically while textures are paged in by main thread job
|
virtual |
called by background threads to let filecache know thread has resumed
|
virtual |
access shader manager
|
virtual |
access shader manager
|
virtual |
Flush the instancing cache.
Reimplemented from makVrv::DtFileCache.
|
virtual |
access to num nodes
|
virtual |
access to num textures
|
virtual |
access to num images
adds imgui to current stat UI
|
virtual |
needed to hook up to texture UI signal when profiler is created
|
protectedvirtual |
Thread safe Implementation of readNodeFile.
|
protectedvirtual |
Thread safe Implementation of readNodeFile for CDB (gets called by ts_readNodeFile for CDB files).
|
protectedvirtual |
Thread safe Implementation of findNodeFile.
|
protectedvirtual |
Thread safe Implementation of readImageFile.
|
protectedvirtual |
Thread safe Implementation of readImageFile for CDB (gets called by ts_readImageFile for CDB files).
|
protectedvirtual |
Thread safe Implementation of readObject.
|
protected |
Thread safe implementation of encrypting an image.
|
protected |
Attempt to resolve the absolute input filename.
|
protectedvirtual |
Clear the model instance cache.
Reimplemented from makVrv::DtFileCache.
|
protectedvirtual |
Apply the effect texture according to different file extensions.
|
protectedvirtual |
Returns true if origFilename was successfully written out as cachedFilename.
Reimplemented from makVrv::DtFileCache.
|
protected |
Save the node to an accelerated file.
|
protectedvirtual |
Add meta flight options to the option string.
|
protectedvirtual |
Returns TRUE if we should run the shader generator on the node.
Reimplemented in DtVrfOsgFileCache, and DtVrfSingletonFileCache.
|
protectedvirtual |
updates the osgDB::Registry::instance() options with the defaults based on the shared state.
|
protectedvirtual |
slot for the onDdsFlipChanged signal so we can update the global options to match the shared state
|
protectedvirtual |
slot for the instancingChanged signal so we can update the global options to match the shared state
|
protectedvirtual |
|
protectedvirtual |
Write cache file to disk.
|
protectedvirtual |
runs the shader generator and optimizing state sharing on a node.
|
protectedvirtual |
compress (generates dds and mipmaps) for image, potentially saves to disk or spawns off async compression task
|
protectedvirtual |
store the original file name in the image object even though we may have loaded from the cache. This allows downstream code to think we're working with original data; helpful if generating names for normal maps, specular maps, reflective maps, etc.
|
protectedvirtual |
get cached imaged if, it is in fact cached. null otherwise
|
friend |
This allows the protected constructor to be called by the DtOsgFileCacheCreator.
|
friend |
| boost::signalslib::signal<void (osg::Node*, const std::string& origFileName, const std::string& actualFileName)> makVrv::DtOsgFileCache::signal_nodeFileLoaded |
Signal emitted whenever a Node file is loaded from disk. When instancing is enabled then each file will only ever be loaded from disk once. Passes the node loaded, the original filename requested, and the actual filename loaded.
| boost::signalslib::signal<void (osg::Image*, const std::string& origFileName, const std::string& actualFileName)> makVrv::DtOsgFileCache::signal_imageFileLoaded |
Signal emitted whenever an image file is loaded from disk. When instancing is enabled then each file will only ever be loaded from disk once. Passes the node loaded, the original filename requested, and the actual filename loaded.
| boost::signalslib::signal<void(osg::Object*, const std::string& origFileName, const std::string& actualFileName)> makVrv::DtOsgFileCache::signal_objectFileLoaded |
Signal emitted whenever an object file is loaded from disk. When instancing is enabled then each file will only ever be loaded from disk once. Passes the node loaded, the original filename requested, and the actual filename loaded.
| boost::signalslib::signal<void (const std::string& filename, osgDB::ReaderWriter::ReadResult&,const osgDB::ReaderWriter::Options*)> makVrv::DtOsgFileCache::signal_readNodeCallback |
Signaled emitted when osg calls readNodeFile. This signal is emitted every time read image is called regardless of if the image was actually loaded or found in a cache.
| boost::signalslib::signal<void (const std::string& filename, osgDB::ReaderWriter::ReadResult&,const osgDB::ReaderWriter::Options*)> makVrv::DtOsgFileCache::signal_readImageCallback |
Signaled emitted when osg calls readImageFile. This signal is emitted every time read image is called regardless of if the image was actually loaded or found in a cache.
| boost::signalslib::signal<void(const std::string& filename, osgDB::ReaderWriter::ReadResult&, const osgDB::ReaderWriter::Options*)> makVrv::DtOsgFileCache::signal_readObjectCallback |
Signaled emitted when osg calls readObject. This signal is emitted every time read object is called regardless of if the object was actually loaded or found in a cache.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |