VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends
makVrv::DtOsgFileCache Class Reference

The OSG implementation of makVrv::DtOsgFileCache. More...

Inheritance diagram for makVrv::DtOsgFileCache:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtOsgFileCache ()
 CTOR. More...
 
virtual void initSingletonDependencies ()
 Called during initialization after the object is created and registered with de. More...
 
virtual void releaseResources ()
 Release all rendering resources. More...
 
virtual void releaseResources (osg::State *state)
 Release all rendering resources. More...
 
virtual void setFromRecord (const makArchives::DtCacheSettingsRecord &rec)
 Push loader options to global registry whenever they're loaded from a record. More...
 
osg::Node * 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. More...
 
osg::ref_ptr< osg::Node > findNodeFile (const std::string &inputFilename)
 Find a node file. More...
 
osg::Image * 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. More...
 
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)
 Returns a cached texture instance, or a new copy of a texture if instancing is disabled; returns 0 if file failed to load. More...
 
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)
 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. More...
 
virtual void runMergeDuplicateTextureVisitor (osg::Node &node)
 runs the duplicate textures visitor on this node More...
 
virtual void encodeOptionsString (const LoadFileOptions &loadFileOptions, osgDB::ReaderWriter::Options &options) const
 Encode load file options into reader write options. More...
 
virtual void decodeOptions (const osgDB::ReaderWriter::Options &options, LoadFileOptions &loadFileOptions) const
 Decode reader write options into load file options. More...
 
DtMetaFileManagermetaFileManager ()
 Retrieve the Metafile manager (load, parse .meta files) More...
 
void cleanDataFilePathList (FilePathList &fileList)
 Clean and remove duplicate paths from the input database path list (i.e. More...
 
virtual const
DtOsgShaderFilesCache
shaderFilesCache (void) const
 access shader files cache More...
 
virtual const std::string & loadShaderSource (const std::string &shaderFile) const
 load shader source via the shader manger, shader cache shader file is the file name of the shader (without path). More...
 
virtual std::string ts_getTextureFilePathAndSetNameIfNotSet (const osg::Texture *baseTexture) const
 find the file path for an effect texture. More...
 
virtual void ts_setEffectTextureName (osg::ref_ptr< osg::Texture > &effectTexture, const std::string &validFile) const
 thread safe More...
 
virtual void ts_setEffectTextureFilterAndHardwareMipMapGen (osg::Texture *effectTexture, osg::Texture::FilterMode minFilter, osg::Texture::FilterMode magFilter, bool hardwareMipMapGen) const
 thread safe More...
 
virtual void ts_compareAndSwapIgnoreHint (osg::Texture *effectTexture, bool oldVal, bool newVal) const
 thread safe. CAS operation. Compares current with old val, swaps current with new val if current val == old val More...
 
virtual bool ts_checkAndSetIgnoreHint (osg::Object *obj, bool val, const char *hint) const
 thread safe. More...
 
virtual bool ts_ignore (osg::Object *obj, const char *hint) const
 thread safe. More...
 
virtual const
DtEffectControllerShaderCache
effectControllerShaderCache (void) const
 access the controller shader cache More...
 
virtual void setNumActivePagerThreads (int active)
 called by osg renderer once a frame to let the file cache know how many pagers are running More...
 
virtual int numActivePagerThreads ()
 how many pagers are actively running, set by osg renderer. More...
 
virtual int numImageProcessingTasks () const
 how many active squish mipmapping tasks that are going on More...
 
virtual void setNumDiguyWorkerThreads (int num)
 how many active diguy threads are going on, added to imageProcessing tasks More...
 
virtual void incrementNumSleepingPagerThreads ()
 called by background threads to let filecache know that the thread has suspended typically while textures are paged in by main thread job More...
 
virtual void decrementNumSleepingPagerThreads ()
 called by background threads to let filecache know thread has resumed More...
 
virtual DtOsgShaderManagershaderManager (void)
 access shader manager More...
 
virtual const DtOsgShaderManagershaderManager (void) const
 access shader manager More...
 
virtual void ts_flushInstancingCache (bool multipass, bool flushNodes, bool flushTextures, bool flushImages)
 Flush the instancing cache. More...
 
- Public Member Functions inherited from makVrv::DtFileCache
virtual ~DtFileCache ()
 DTOR. More...
 
virtual void init ()
 Initialize the cache. Must be called before using. 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 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 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 ExcludedExtensionsexcludedExtensions ()
 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
 
DtRecordSettingsBackupInterfacesettingsBackup ()
 
DtDegetDe ()
 

Static Public Member Functions

static void optimizeNodeGeometry (osg::Node *node)
 Run extra optimization passes on node. More...
 

Public Attributes

boost::signalslib::signal
< void(osg::Node *, const
std::string &origFileName,
const std::string
&actualFileName)> 
signal_nodeFileLoaded
 Signal emitted whenever a Node file is loaded from disk. More...
 
boost::signalslib::signal
< void(osg::Image *, const
std::string &origFileName,
const std::string
&actualFileName)> 
signal_imageFileLoaded
 Signal emitted whenever an image file is loaded from disk. More...
 
boost::signalslib::signal
< void(osg::Object *, const
std::string &origFileName,
const std::string
&actualFileName)> 
signal_objectFileLoaded
 Signal emitted whenever an object file is loaded from disk. More...
 
boost::signalslib::signal
< void(const std::string
&filename,
osgDB::ReaderWriter::ReadResult
&, const
osgDB::ReaderWriter::Options *)> 
signal_readNodeCallback
 Signaled emitted when osg calls readNodeFile. More...
 
boost::signalslib::signal
< void(const std::string
&filename,
osgDB::ReaderWriter::ReadResult
&, const
osgDB::ReaderWriter::Options *)> 
signal_readImageCallback
 Signaled emitted when osg calls readImageFile. More...
 
boost::signalslib::signal
< void(const std::string
&filename,
osgDB::ReaderWriter::ReadResult
&, const
osgDB::ReaderWriter::Options *)> 
signal_readObjectCallback
 Signaled emitted when osg calls readObject. More...
 
- Public Attributes inherited from makVrv::DtFileCache
boost::signalslib::signal< void()> signal_clearInstanceCache
 Signal emmitted when clearCache is called, used to allow other caches to be cleared. More...
 

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)
 Thread safe Implementation of readNodeFile. More...
 
virtual osg::ref_ptr< osg::Node > ts_readCdbNodeFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData)
 Thread safe Implementation of readNodeFile for CDB (gets called by ts_readNodeFile for CDB files). More...
 
virtual osg::ref_ptr< osg::Node > ts_findNodeFile (const std::string &inputFilename)
 Thread safe Implementation of findNodeFile. More...
 
virtual osg::ref_ptr< osg::Image > ts_readImageFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData=0L)
 Thread safe Implementation of readImageFile. More...
 
virtual osg::ref_ptr< osg::Image > ts_readCdbImageFile (const std::string &inputFilename, const LoadFileOptions &loadFileOptions, const osg::UserDataContainer *optionsUserData=0L)
 Thread safe Implementation of readImageFile for CDB (gets called by ts_readImageFile for CDB files). More...
 
virtual osg::ref_ptr< osg::Object > ts_readObject (const std::string &filename, const osgDB::ReaderWriter::Options *options)
 Thread safe Implementation of readObject. More...
 
void ts_encryptImage (const std::string &inputFileName, const std::string &outputFilename, const osgDB::ReaderWriter::Options *options, bool printToConsole)
 Thread safe implementation of encrypting an image. More...
 
bool ts_resolveRelativeFilename (const LoadFileOptions &loadFileOptions, std::string &absoluteInputFilename)
 Attempt to resolve the absolute input filename. More...
 
virtual void ts_clearInstancingCache ()
 Clear the model instance cache. More...
 
virtual void applyEffectTexture (osg::Node *node, const std::string &extension, bool isCdb, osgDB::ReaderWriter::Options *option)
 Apply the effect texture according to different file extensions. More...
 
 DtOsgFileCache (DtDe &de)
 Protected CTOR. Must be called by creator. 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...
 
bool saveToAcceleratedFile (const std::string &origFileName, osg::Node *nodeRef, const std::string &cachedFilename, bool writeExternalReferences)
 Save the node to an accelerated file. More...
 
virtual void addMetaFlightOptions (std::string &optionsString)
 Add meta flight options to the option string. More...
 
virtual bool needsShaderGeneration (const std::string &extension, const LoadFileOptions &options) const
 Returns TRUE if we should run the shader generator on the node. More...
 
virtual void updateGlobalOptions ()
 updates the osgDB::Registry::instance() options with the defaults based on the shared state. More...
 
virtual void slot_onDdsFlipChanged (bool flip)
 slot for the onDdsFlipChanged signal so we can update the global options to match the shared state More...
 
virtual void slot_instancingChanged (bool enabled)
 slot for the instancingChanged signal so we can update the global options to match the shared state More...
 
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)
 Write cache file to disk. More...
 
virtual void shadersGeneration (osg::ref_ptr< osg::Node > node, const std::string &fileToLoad)
 runs the shader generator and optimizing state sharing on a node. More...
 
virtual void squishImage (const std::string &fileToLoad, const std::string &acceleratedFilename, DtCVMarkerSeries &objectCreation, osg::ref_ptr< osg::Image > image, bool writeAcceleratedFile, bool isCDB)
 compress (generates dds and mipmaps) for image, potentially saves to disk or spawns off async compression task More...
 
virtual void saveImageFilename (const std::string &absoluteInputFilename, osg::Image *image)
 store the original file name in the image object even though we may have loaded from the cache. More...
 
virtual osg::ref_ptr< osg::Image > isImageAlreadyInCache (const std::string &cacheKey, const std::string &inputExtension, const LoadFileOptions &loadFileOptions)
 Check if the texture is already loaded and return it if found. More...
 
- Protected Member Functions inherited from makVrv::DtFileCache
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...
 

Protected Attributes

DtOsgReferencedCollection
< osg::Node > 
myNodeCollection
 
DtOsgReferencedCollection
< DtTextureCollection
myTextureCollection
 
DtOsgReferencedCollection
< osg::Image > 
myImageCollection
 
AttrCacheMap myAttrCacheMap
 
unsigned int myMaxFlushTextureCount
 
unsigned int myMaxFlushNodeCount
 
unsigned int myMaxFlushImageCount
 
tbb::spin_rw_mutex myRelativePathMutex
 
RelativePathCache myRelativePathCache
 
DtMeifConvertermyImageCompressor
 
DtMetaFileManagermyMetaFileManager
 
DtOsgShaderManagermyShaderManager
 
DtOsgShaderFilesCachemyShaderFilesCache
 
DtEffectControllerFactorymyEffectControllerFactory
 
DtEffectControllerShaderCache myEffectControllerShaderCache
 
osg::ref_ptr< DtReadFileCallbackmyReadFileCallback
 
int myNumActivePagerThreads
 
tbb::atomic< intmyNumSleepingPagerThreads
 
tbb::atomic< intmyNumDiguyWorkerThreads
 
- Protected Attributes inherited from makVrv::DtFileCache
DtDemyDe
 
bool myCachingEnabled
 
bool myCompressTextureFlag
 
bool myClearInstancesOnNewSceneFlag
 
bool myInstancingEnabled
 
unsigned int myFlushCycleCount
 
DtSignalConnectionManager myConnectionManager
 
ExcludedExtensions myExcludedExtensionMap
 
DtRecordSettingsBackupInterfacemySettingsBackup
 

Friends

class DtOsgFileCacheCreator
 This allows the protected constructor to be called by the DtOsgFileCacheCreator. More...
 
class DtReadFileCallback
 

Additional Inherited Members

- Public Types inherited from makVrv::DtFileCache
typedef boost::unordered_set
< std::string > 
ExcludedExtensions
 A set of extensions excluded from the cache. More...
 
typedef std::deque< std::string > FilePathList
 

Detailed Description

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.

Member Typedef Documentation

typedef boost::unordered_map<std::string,std::string> makVrv::DtOsgFileCache::RelativePathCache
protected
typedef std::map< std::string, osg::ref_ptr<osg::Object> > makVrv::DtOsgFileCache::AttrCacheMap
protected

Constructor & Destructor Documentation

virtual makVrv::DtOsgFileCache::~DtOsgFileCache ( )
virtual

CTOR.

makVrv::DtOsgFileCache::DtOsgFileCache ( DtDe de)
protected

Protected CTOR. Must be called by creator.

Member Function Documentation

virtual void makVrv::DtOsgFileCache::initSingletonDependencies ( )
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.

virtual void makVrv::DtOsgFileCache::releaseResources ( )
inlinevirtual

Release all rendering resources.

Reimplemented from makVrv::DtFileCache.

virtual void makVrv::DtOsgFileCache::releaseResources ( osg::State *  state)
virtual

Release all rendering resources.

virtual void makVrv::DtOsgFileCache::setFromRecord ( const makArchives::DtCacheSettingsRecord rec)
virtual

Push loader options to global registry whenever they're loaded from a record.

Reimplemented from makVrv::DtFileCache.

static void makVrv::DtOsgFileCache::optimizeNodeGeometry ( osg::Node *  node)
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.

osg::ref_ptr<osg::Node> makVrv::DtOsgFileCache::findNodeFile ( const std::string &  inputFilename)
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 osg::Texture* makVrv::DtOsgFileCache::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

Returns a cached texture instance, or a new copy of a texture if instancing is disabled; returns 0 if file failed to load.

virtual void makVrv::DtOsgFileCache::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

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 void makVrv::DtOsgFileCache::runMergeDuplicateTextureVisitor ( osg::Node &  node)
virtual

runs the duplicate textures visitor on this node

virtual void makVrv::DtOsgFileCache::encodeOptionsString ( const LoadFileOptions loadFileOptions,
osgDB::ReaderWriter::Options &  options 
) const
virtual

Encode load file options into reader write options.

Reimplemented in DtVrfSingletonFileCache, and DtVrfOsgFileCache.

virtual void makVrv::DtOsgFileCache::decodeOptions ( const osgDB::ReaderWriter::Options &  options,
LoadFileOptions loadFileOptions 
) const
virtual

Decode reader write options into load file options.

Reimplemented in DtVrfSingletonFileCache, and DtVrfOsgFileCache.

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 const DtOsgShaderFilesCache& makVrv::DtOsgFileCache::shaderFilesCache ( void  ) const
virtual

access shader files cache

virtual const std::string& makVrv::DtOsgFileCache::loadShaderSource ( const std::string &  shaderFile) const
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 std::string makVrv::DtOsgFileCache::ts_getTextureFilePathAndSetNameIfNotSet ( const osg::Texture *  baseTexture) const
virtual

find the file path for an effect texture.

set the name if its empty thread safe

virtual void makVrv::DtOsgFileCache::ts_setEffectTextureName ( osg::ref_ptr< osg::Texture > &  effectTexture,
const std::string &  validFile 
) const
virtual

thread safe

virtual void makVrv::DtOsgFileCache::ts_setEffectTextureFilterAndHardwareMipMapGen ( osg::Texture *  effectTexture,
osg::Texture::FilterMode  minFilter,
osg::Texture::FilterMode  magFilter,
bool  hardwareMipMapGen 
) const
virtual

thread safe

virtual void makVrv::DtOsgFileCache::ts_compareAndSwapIgnoreHint ( osg::Texture *  effectTexture,
bool  oldVal,
bool  newVal 
) const
virtual

thread safe. CAS operation. Compares current with old val, swaps current with new val if current val == old val

virtual bool makVrv::DtOsgFileCache::ts_checkAndSetIgnoreHint ( osg::Object *  obj,
bool  val,
const char hint 
) const
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 bool makVrv::DtOsgFileCache::ts_ignore ( osg::Object *  obj,
const char hint 
) const
virtual

thread safe.

Check whether an object should be ignored during traversal

virtual const DtEffectControllerShaderCache& makVrv::DtOsgFileCache::effectControllerShaderCache ( void  ) const
virtual

access the controller shader cache

virtual void makVrv::DtOsgFileCache::setNumActivePagerThreads ( int  active)
virtual

called by osg renderer once a frame to let the file cache know how many pagers are running

virtual int makVrv::DtOsgFileCache::numActivePagerThreads ( )
virtual

how many pagers are actively running, set by osg renderer.

virtual int makVrv::DtOsgFileCache::numImageProcessingTasks ( ) const
virtual

how many active squish mipmapping tasks that are going on

virtual void makVrv::DtOsgFileCache::setNumDiguyWorkerThreads ( int  num)
virtual

how many active diguy threads are going on, added to imageProcessing tasks

virtual void makVrv::DtOsgFileCache::incrementNumSleepingPagerThreads ( )
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 void makVrv::DtOsgFileCache::decrementNumSleepingPagerThreads ( )
virtual

called by background threads to let filecache know thread has resumed

virtual DtOsgShaderManager& makVrv::DtOsgFileCache::shaderManager ( void  )
virtual

access shader manager

virtual const DtOsgShaderManager& makVrv::DtOsgFileCache::shaderManager ( void  ) const
virtual

access shader manager

virtual void makVrv::DtOsgFileCache::ts_flushInstancingCache ( bool  multipass,
bool  flushNodes,
bool  flushTextures,
bool  flushImages 
)
virtual

Flush the instancing cache.

Reimplemented from makVrv::DtFileCache.

virtual osg::ref_ptr<osg::Node> makVrv::DtOsgFileCache::ts_readNodeFile ( const std::string &  inputFilename,
const LoadFileOptions loadFileOptions,
const osg::UserDataContainer *  optionsUserData 
)
protectedvirtual

Thread safe Implementation of readNodeFile.

virtual osg::ref_ptr<osg::Node> makVrv::DtOsgFileCache::ts_readCdbNodeFile ( const std::string &  inputFilename,
const LoadFileOptions loadFileOptions,
const osg::UserDataContainer *  optionsUserData 
)
protectedvirtual

Thread safe Implementation of readNodeFile for CDB (gets called by ts_readNodeFile for CDB files).

virtual osg::ref_ptr<osg::Node> makVrv::DtOsgFileCache::ts_findNodeFile ( const std::string &  inputFilename)
protectedvirtual

Thread safe Implementation of findNodeFile.

virtual osg::ref_ptr<osg::Image> makVrv::DtOsgFileCache::ts_readImageFile ( const std::string &  inputFilename,
const LoadFileOptions loadFileOptions,
const osg::UserDataContainer *  optionsUserData = 0L 
)
protectedvirtual

Thread safe Implementation of readImageFile.

virtual osg::ref_ptr<osg::Image> makVrv::DtOsgFileCache::ts_readCdbImageFile ( const std::string &  inputFilename,
const LoadFileOptions loadFileOptions,
const osg::UserDataContainer *  optionsUserData = 0L 
)
protectedvirtual

Thread safe Implementation of readImageFile for CDB (gets called by ts_readImageFile for CDB files).

virtual osg::ref_ptr<osg::Object> makVrv::DtOsgFileCache::ts_readObject ( const std::string &  filename,
const osgDB::ReaderWriter::Options *  options 
)
protectedvirtual

Thread safe Implementation of readObject.

void makVrv::DtOsgFileCache::ts_encryptImage ( const std::string &  inputFileName,
const std::string &  outputFilename,
const osgDB::ReaderWriter::Options *  options,
bool  printToConsole 
)
protected

Thread safe implementation of encrypting an image.

bool makVrv::DtOsgFileCache::ts_resolveRelativeFilename ( const LoadFileOptions loadFileOptions,
std::string &  absoluteInputFilename 
)
protected

Attempt to resolve the absolute input filename.

virtual void makVrv::DtOsgFileCache::ts_clearInstancingCache ( )
protectedvirtual

Clear the model instance cache.

Reimplemented from makVrv::DtFileCache.

virtual void makVrv::DtOsgFileCache::applyEffectTexture ( osg::Node *  node,
const std::string &  extension,
bool  isCdb,
osgDB::ReaderWriter::Options *  option 
)
protectedvirtual

Apply the effect texture according to different file extensions.

virtual bool makVrv::DtOsgFileCache::save ( const std::string &  origFilename,
const std::string &  cachedFilename,
bool  optimize 
)
protectedvirtual

Returns true if origFilename was successfully written out as cachedFilename.

Reimplemented from makVrv::DtFileCache.

bool makVrv::DtOsgFileCache::saveToAcceleratedFile ( const std::string &  origFileName,
osg::Node *  nodeRef,
const std::string &  cachedFilename,
bool  writeExternalReferences 
)
protected

Save the node to an accelerated file.

virtual void makVrv::DtOsgFileCache::addMetaFlightOptions ( std::string &  optionsString)
protectedvirtual

Add meta flight options to the option string.

virtual bool makVrv::DtOsgFileCache::needsShaderGeneration ( const std::string &  extension,
const LoadFileOptions options 
) const
protectedvirtual

Returns TRUE if we should run the shader generator on the node.

Reimplemented in DtVrfSingletonFileCache, and DtVrfOsgFileCache.

virtual void makVrv::DtOsgFileCache::updateGlobalOptions ( )
protectedvirtual

updates the osgDB::Registry::instance() options with the defaults based on the shared state.

virtual void makVrv::DtOsgFileCache::slot_onDdsFlipChanged ( bool  flip)
protectedvirtual

slot for the onDdsFlipChanged signal so we can update the global options to match the shared state

virtual void makVrv::DtOsgFileCache::slot_instancingChanged ( bool  enabled)
protectedvirtual

slot for the instancingChanged signal so we can update the global options to match the shared state

virtual bool makVrv::DtOsgFileCache::getAttrFromLocalCache ( const std::string &  filename,
osg::Object **  attrData 
)
protectedvirtual
virtual void makVrv::DtOsgFileCache::writeCacheFile ( osg::ref_ptr< osg::Node >  node,
const std::string &  acceleratedFileLocation,
DtCVMarkerSeries series 
)
protectedvirtual

Write cache file to disk.

virtual void makVrv::DtOsgFileCache::shadersGeneration ( osg::ref_ptr< osg::Node >  node,
const std::string &  fileToLoad 
)
protectedvirtual

runs the shader generator and optimizing state sharing on a node.

virtual void makVrv::DtOsgFileCache::squishImage ( const std::string &  fileToLoad,
const std::string &  acceleratedFilename,
DtCVMarkerSeries objectCreation,
osg::ref_ptr< osg::Image >  image,
bool  writeAcceleratedFile,
bool  isCDB 
)
protectedvirtual

compress (generates dds and mipmaps) for image, potentially saves to disk or spawns off async compression task

virtual void makVrv::DtOsgFileCache::saveImageFilename ( const std::string &  absoluteInputFilename,
osg::Image *  image 
)
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.

virtual osg::ref_ptr<osg::Image> makVrv::DtOsgFileCache::isImageAlreadyInCache ( const std::string &  cacheKey,
const std::string &  inputExtension,
const LoadFileOptions loadFileOptions 
)
protectedvirtual

Check if the texture is already loaded and return it if found.

Friends And Related Function Documentation

friend class DtOsgFileCacheCreator
friend

This allows the protected constructor to be called by the DtOsgFileCacheCreator.

friend class DtReadFileCallback
friend

Member Data Documentation

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.

DtOsgReferencedCollection<osg::Node> makVrv::DtOsgFileCache::myNodeCollection
protected
DtOsgReferencedCollection<DtTextureCollection> makVrv::DtOsgFileCache::myTextureCollection
protected
DtOsgReferencedCollection<osg::Image> makVrv::DtOsgFileCache::myImageCollection
protected
AttrCacheMap makVrv::DtOsgFileCache::myAttrCacheMap
protected
unsigned int makVrv::DtOsgFileCache::myMaxFlushTextureCount
protected
unsigned int makVrv::DtOsgFileCache::myMaxFlushNodeCount
protected
unsigned int makVrv::DtOsgFileCache::myMaxFlushImageCount
protected
tbb::spin_rw_mutex makVrv::DtOsgFileCache::myRelativePathMutex
protected
RelativePathCache makVrv::DtOsgFileCache::myRelativePathCache
protected
DtMeifConverter* makVrv::DtOsgFileCache::myImageCompressor
protected
DtMetaFileManager* makVrv::DtOsgFileCache::myMetaFileManager
protected
DtOsgShaderManager& makVrv::DtOsgFileCache::myShaderManager
protected
DtOsgShaderFilesCache& makVrv::DtOsgFileCache::myShaderFilesCache
protected
DtEffectControllerFactory& makVrv::DtOsgFileCache::myEffectControllerFactory
protected
DtEffectControllerShaderCache makVrv::DtOsgFileCache::myEffectControllerShaderCache
protected
osg::ref_ptr<DtReadFileCallback> makVrv::DtOsgFileCache::myReadFileCallback
protected
int makVrv::DtOsgFileCache::myNumActivePagerThreads
protected
tbb::atomic<int> makVrv::DtOsgFileCache::myNumSleepingPagerThreads
protected
tbb::atomic<int> makVrv::DtOsgFileCache::myNumDiguyWorkerThreads
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)