OpenSceneGraph  3.5.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
osgDB::Registry Class Reference

Registry is a singleton factory which stores the reader/writers which are linked in at runtime for reading non-native file formats. More...

Inheritance diagram for osgDB::Registry:
Inheritance graph
[legend]

Classes

struct  ReadFunctor
 Functor used in internal implementations. More...
 

Public Types

enum  LoadStatus { NOT_LOADED = 0, PREVIOUSLY_LOADED, LOADED }
 
typedef std::map< std::string, std::string > MimeTypeExtensionMap
 
typedef std::vector< osg::ref_ptr< ReaderWriter > > ReaderWriterList
 
typedef std::vector< osg::ref_ptr< ImageProcessor > > ImageProcessorList
 
typedef class osgDB::FindFileCallback FindFileCallback
 
typedef class osgDB::ReadFileCallback ReadFileCallback
 
typedef class osgDB::WriteFileCallback WriteFileCallback
 
typedef class osgDB::FileLocationCallback FileLocationCallback
 
typedef std::vector< std::string > ArchiveExtensionList
 

Public Member Functions

void readCommandLine (osg::ArgumentParser &commandLine)
 read the command line arguments. More...
 
void addFileExtensionAlias (const std::string mapExt, const std::string toExt)
 register an .fileextension alias to mapExt toExt, the later should be the extension name of the readerwriter plugin library. More...
 
bool readPluginAliasConfigurationFile (const std::string &file)
 Reads a file that configures extension mappings. More...
 
void addMimeTypeExtensionMapping (const std::string fromMimeType, const std::string toExt)
 Registers a mapping of a mime-type to an extension. More...
 
MimeTypeExtensionMapgetMimeTypeExtensionMap ()
 
const MimeTypeExtensionMapgetMimeTypeExtensionMap () const
 
void addReaderWriter (ReaderWriter *rw)
 
void removeReaderWriter (ReaderWriter *rw)
 
void addImageProcessor (ImageProcessor *ip)
 
void removeImageProcessor (ImageProcessor *ip)
 
std::string createLibraryNameForFile (const std::string &fileName)
 create the platform specific library name associated with file. More...
 
std::string createLibraryNameForExtension (const std::string &ext)
 create the platform specific library name associated with file extension. More...
 
std::string createLibraryNameForNodeKit (const std::string &name)
 create the platform specific library name associated with nodekit library name. More...
 
LoadStatus loadLibrary (const std::string &fileName)
 find the library in the OSG_LIBRARY_PATH and load it. More...
 
bool closeLibrary (const std::string &fileName)
 close the attached library with specified name. More...
 
void closeAllLibraries ()
 close all libraries. More...
 
ReaderWritergetReaderWriterForExtension (const std::string &ext)
 get a reader writer which handles specified extension. More...
 
ReaderWritergetReaderWriterForMimeType (const std::string &mimeType)
 gets a reader/writer that handles the extension mapped to by one of the registered mime-types. More...
 
ReaderWriterListgetReaderWriterList ()
 get list of all registered ReaderWriters. More...
 
const ReaderWriterListgetReaderWriterList () const
 get const list of all registered ReaderWriters. More...
 
void getReaderWriterListForProtocol (const std::string &protocol, ReaderWriterList &results) const
 get a list of registered ReaderWriters which can handle given protocol More...
 
ReaderWritergetReaderWriterForProtocolAndExtension (const std::string &protocol, const std::string &extension)
 
ImageProcessorgetImageProcessor ()
 get a image processor if available. More...
 
ImageProcessorgetImageProcessorForExtension (const std::string &ext)
 get a image processor which is associated specified extension. More...
 
ImageProcessorListgetImageProcessorList ()
 get list of all registered ImageProcessors. More...
 
const ImageProcessorListgetImageProcessorList () const
 get const list of all registered ImageProcessors. More...
 
void setFindFileCallback (FindFileCallback *cb)
 Set the Registry callback to use in place of the default findFile calls. More...
 
FindFileCallbackgetFindFileCallback ()
 Get the findFile callback. More...
 
const FindFileCallbackgetFindFileCallback () const
 Get the const findFile callback. More...
 
std::string findDataFile (const std::string &fileName, const Options *options, CaseSensitivity caseSensitivity)
 
std::string findDataFileImplementation (const std::string &fileName, const Options *options, CaseSensitivity caseSensitivity)
 
std::string findLibraryFile (const std::string &fileName, const Options *options, CaseSensitivity caseSensitivity)
 
std::string findLibraryFileImplementation (const std::string &fileName, const Options *options, CaseSensitivity caseSensitivity)
 
void setReadFileCallback (ReadFileCallback *cb)
 Set the Registry callback to use in place of the default readFile calls. More...
 
ReadFileCallbackgetReadFileCallback ()
 Get the readFile callback. More...
 
const ReadFileCallbackgetReadFileCallback () const
 Get the const readFile callback. More...
 
ReaderWriter::ReadResult openArchive (const std::string &fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options *options)
 
ReaderWriter::ReadResult openArchiveImplementation (const std::string &fileName, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const Options *options)
 
ReaderWriter::ReadResult readObject (const std::string &fileName, const Options *options, bool buildKdTreeIfRequired=true)
 
ReaderWriter::ReadResult readObjectImplementation (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readImage (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readImageImplementation (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readHeightField (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readHeightFieldImplementation (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readNode (const std::string &fileName, const Options *options, bool buildKdTreeIfRequired=true)
 
ReaderWriter::ReadResult readNodeImplementation (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readShader (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readShaderImplementation (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readScript (const std::string &fileName, const Options *options)
 
ReaderWriter::ReadResult readScriptImplementation (const std::string &fileName, const Options *options)
 
void setWriteFileCallback (WriteFileCallback *cb)
 Set the Registry callback to use in place of the default writeFile calls. More...
 
WriteFileCallbackgetWriteFileCallback ()
 Get the writeFile callback. More...
 
const WriteFileCallbackgetWriteFileCallback () const
 Get the const writeFile callback. More...
 
ReaderWriter::WriteResult writeObject (const osg::Object &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeObjectImplementation (const osg::Object &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeImage (const osg::Image &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeImageImplementation (const osg::Image &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeHeightField (const osg::HeightField &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeHeightFieldImplementation (const osg::HeightField &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeNode (const osg::Node &node, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeNodeImplementation (const osg::Node &node, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeShader (const osg::Shader &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeShaderImplementation (const osg::Shader &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeScript (const osg::Script &obj, const std::string &fileName, const Options *options)
 
ReaderWriter::WriteResult writeScriptImplementation (const osg::Script &obj, const std::string &fileName, const Options *options)
 
void _buildKdTreeIfRequired (ReaderWriter::ReadResult &result, const Options *options)
 
void setFileLocationCallback (FileLocationCallback *cb)
 Set the callback to use inform to the DatabasePager whether a file is located on local or remote file system. More...
 
FileLocationCallbackgetFileLocationCallback () const
 Get the callback to use inform to the DatabasePager whether a file is located on local or remote file system. More...
 
void setBuildKdTreesHint (Options::BuildKdTreesHint hint)
 Set whether the KdTrees should be built for geometry in the loader model. More...
 
Options::BuildKdTreesHint getBuildKdTreesHint () const
 Get whether the KdTrees should be built for geometry in the loader model. More...
 
void setKdTreeBuilder (osg::KdTreeBuilder *builder)
 Set the KdTreeBuilder visitor that is used to build KdTree on loaded models. More...
 
osg::KdTreeBuildergetKdTreeBuilder ()
 Get the KdTreeBuilder visitor that is used to build KdTree on loaded models. More...
 
void setFileCache (FileCache *fileCache)
 Set the FileCache that is used to manage local storage of files downloaded from the internet. More...
 
FileCachegetFileCache ()
 Get the FileCache that is used to manage local storage of files downloaded from the internet. More...
 
const FileCachegetFileCache () const
 Get the const FileCache that is used to manage local storage of files downloaded from the internet. More...
 
void setAuthenticationMap (AuthenticationMap *authenticationMap)
 Set the password map to be used by plugins when access files from secure locations. More...
 
AuthenticationMapgetAuthenticationMap ()
 Get the password map to be used by plugins when access files from secure locations. More...
 
const AuthenticationMapgetAuthenticationMap () const
 Get the password map to be used by plugins when access files from secure locations. More...
 
void setCreateNodeFromImage (bool flag)
 
bool getCreateNodeFromImage () const
 
void setOptions (Options *opt)
 
OptionsgetOptions ()
 
const OptionsgetOptions () const
 
void initFilePathLists ()
 initialize both the Data and Library FilePaths, by default called by the constructor, so it should only be required if you want to force the re-reading of environmental variables. More...
 
void initDataFilePathList ()
 initialize the Data FilePath by reading the OSG_FILE_PATH environmental variable. More...
 
void setDataFilePathList (const FilePathList &filepath)
 Set the data file path using a list of paths stored in a FilePath, which is used when search for data files. More...
 
void setDataFilePathList (const std::string &paths)
 Set the data file path using a single string delimited either with ';' (Windows) or ':' (All other platforms), which is used when search for data files. More...
 
FilePathListgetDataFilePathList ()
 get the data file path which is used when search for data files. More...
 
const FilePathListgetDataFilePathList () const
 get the const data file path which is used when search for data files. More...
 
void initLibraryFilePathList ()
 initialize the Library FilePath by reading the OSG_LIBRARY_PATH and the appropriate system environmental variables More...
 
void setLibraryFilePathList (const FilePathList &filepath)
 Set the library file path using a list of paths stored in a FilePath, which is used when search for data files. More...
 
void setLibraryFilePathList (const std::string &paths)
 Set the library file path using a single string delimited either with ';' (Windows) or ':' (All other platforms), which is used when search for data files. More...
 
FilePathListgetLibraryFilePathList ()
 get the library file path which is used when search for library (dso/dll's) files. More...
 
const FilePathListgetLibraryFilePathList () const
 get the const library file path which is used when search for library (dso/dll's) files. More...
 
void setObjectCache (ObjectCache *objectCache)
 Set the ObjectCache that is used to manage local storage of files downloaded from the internet. More...
 
ObjectCachegetObjectCache ()
 Get the ObjectCache that is used to manage local storage of files downloaded from the internet. More...
 
const ObjectCachegetObjectCache () const
 Get the const ObjectCache that is used to manage local storage of files downloaded from the internet. More...
 
void setExpiryDelay (double expiryDelay)
 set hint to viewer code calling removeExpiredObjectsInCache to specify how long it should give before expiring objects in Registry cache, More...
 
double getExpiryDelay () const
 
void updateTimeStampOfObjectsInCacheWithExternalReferences (const osg::FrameStamp &frameStamp)
 For each object in the cache which has an reference count greater than 1 (and therefore referenced by elsewhere in the application) set the time stamp for that object in the cache to specified time. More...
 
void removeExpiredObjectsInCache (const osg::FrameStamp &frameStamp)
 Removed object in the cache which have a time stamp at or before the specified expiry time. More...
 
void clearObjectCache ()
 Remove all objects in the cache regardless of having external references or expiry times. More...
 
void addEntryToObjectCache (const std::string &filename, osg::Object *object, double timestamp=0.0)
 Add a filename,object,timestamp triple to the Registry::ObjectCache. More...
 
void removeFromObjectCache (const std::string &fileName)
 Remove Object from cache. More...
 
osg::ObjectgetFromObjectCache (const std::string &fileName)
 Get an Object from the object cache. More...
 
osg::ref_ptr< osg::ObjectgetRefFromObjectCache (const std::string &fileName)
 Get an ref_ptr<Object> from the object cache. More...
 
void addToArchiveCache (const std::string &fileName, osgDB::Archive *archive)
 Add archive to archive cache so that future calls reference this archive. More...
 
void removeFromArchiveCache (const std::string &fileName)
 Remove Archive from cache. More...
 
osgDB::ArchivegetFromArchiveCache (const std::string &fileName)
 Get an Archive from the archive cache. More...
 
osg::ref_ptr< osgDB::ArchivegetRefFromArchiveCache (const std::string &fileName)
 Get an ref_ptr<Archive> from the archive cache. More...
 
void clearArchiveCache ()
 Remove all archives from the archive cache. More...
 
void releaseGLObjects (osg::State *state=0)
 If State is non-zero, this function releases OpenGL objects for the specified graphics context. More...
 
DynamicLibrarygetLibrary (const std::string &fileName)
 get the attached library with specified name. More...
 
void setSharedStateManager (SharedStateManager *SharedStateManager)
 Set the SharedStateManager. More...
 
SharedStateManagergetOrCreateSharedStateManager ()
 Get the SharedStateManager, creating one if one is not already created. More...
 
SharedStateManagergetSharedStateManager ()
 Get the SharedStateManager. More...
 
void addArchiveExtension (const std::string ext)
 Add an Archive extension. More...
 
void registerProtocol (const std::string &protocol)
 registers a protocol More...
 
bool isProtocolRegistered (const std::string &protocol)
 returns true, if named protocol is registered More...
 
ObjectWrapperManagergetObjectWrapperManager ()
 Get the ObjectWrapperManager that is used to store all the ObjectWrappers. More...
 
DeprecatedDotOsgWrapperManagergetDeprecatedDotOsgObjectWrapperManager ()
 Get the ObjectWrapperManager that is used to store all the ObjectWrappers. More...
 
const ArchiveExtensionListgetArchiveExtensions () const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 Set whether to use a mutex to ensure ref() and unref() are thread safe. More...
 
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
 
OpenThreads::Mutex * getRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref(). More...
 
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int referenceCount () const
 Return the number of pointers currently referencing this object. More...
 
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL. More...
 
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
 
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
 
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object. More...
 

Static Public Member Functions

static Registryinstance (bool erase=false)
 
- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * getGlobalReferencedMutex ()
 Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More...
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 Set whether reference counting should use a mutex for thread safe reference counting. More...
 
static bool getThreadSafeReferenceCounting ()
 Get whether reference counting is active. More...
 
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More...
 
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler. More...
 

Protected Types

typedef std::vector< osg::ref_ptr< DynamicLibrary > > DynamicLibraryList
 
typedef std::map< std::string, std::string > ExtensionAliasMap
 
typedef std::map< std::string, osg::ref_ptr< osgDB::Archive > > ArchiveCache
 
typedef std::set< std::string > RegisteredProtocolsSet
 

Protected Member Functions

virtual ~Registry ()
 
 Registry ()
 constructor is private, as its a singleton, preventing construction other than via the instance() method and therefore ensuring only one copy is ever constructed More...
 
DynamicLibraryList::iterator getLibraryItr (const std::string &fileName)
 get the attached library with specified name. More...
 
void destruct ()
 
ReaderWriter::ReadResult read (const ReadFunctor &readFunctor)
 
ReaderWriter::ReadResult readImplementation (const ReadFunctor &readFunctor, Options::CacheHintOptions cacheHint)
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

Static Protected Member Functions

static std::string trim (const std::string &str)
 

Protected Attributes

Options::BuildKdTreesHint _buildKdTreesHint
 
osg::ref_ptr< osg::KdTreeBuilder_kdTreeBuilder
 
osg::ref_ptr< FileCache_fileCache
 
osg::ref_ptr< AuthenticationMap_authenticationMap
 
bool _createNodeFromImage
 
RegisteredProtocolsSet _registeredProtocols
 
osg::ref_ptr< FindFileCallback_findFileCallback
 
osg::ref_ptr< ReadFileCallback_readFileCallback
 
osg::ref_ptr< WriteFileCallback_writeFileCallback
 
osg::ref_ptr< FileLocationCallback_fileLocationCallback
 
OpenThreads::ReentrantMutex _pluginMutex
 
ReaderWriterList _rwList
 
ImageProcessorList _ipList
 
DynamicLibraryList _dlList
 
OpenThreads::ReentrantMutex _archiveCacheMutex
 
ArchiveCache _archiveCache
 
bool _openingLibrary
 
ExtensionAliasMap _extAliasMap
 
MimeTypeExtensionMap _mimeTypeExtMap
 
osg::ref_ptr< Options_options
 
FilePathList _dataFilePath
 
FilePathList _libraryFilePath
 
osg::ref_ptr< ObjectCache_objectCache
 
double _expiryDelay
 
ArchiveExtensionList _archiveExtList
 
osg::ref_ptr< SharedStateManager_sharedStateManager
 
osg::ref_ptr< ObjectWrapperManager_objectWrapperManager
 
osg::ref_ptr< DeprecatedDotOsgWrapperManager_deprecatedDotOsgWrapperManager
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Friends

struct ReadFunctor
 
struct ReadObjectFunctor
 
struct ReadImageFunctor
 
struct ReadHeightFieldFunctor
 
struct ReadNodeFunctor
 
struct ReadArchiveFunctor
 
struct ReadShaderFunctor
 
struct ReadScriptFunctor
 
class AvailableReaderWriterIterator
 
class AvailableArchiveIterator
 

Detailed Description

Registry is a singleton factory which stores the reader/writers which are linked in at runtime for reading non-native file formats.

The RegisterReaderWriterProxy can be used to automatically register at runtime a reader/writer with the Registry.

Member Typedef Documentation

typedef std::map<std::string, osg::ref_ptr<osgDB::Archive> > osgDB::Registry::ArchiveCache
protected
typedef std::vector< std::string> osgDB::Registry::ArchiveExtensionList
typedef std::map< std::string, std::string> osgDB::Registry::ExtensionAliasMap
protected
typedef std::map< std::string, std::string> osgDB::Registry::MimeTypeExtensionMap
typedef std::set<std::string> osgDB::Registry::RegisteredProtocolsSet
protected

Member Enumeration Documentation

Enumerator
NOT_LOADED 
PREVIOUSLY_LOADED 
LOADED 

Constructor & Destructor Documentation

virtual osgDB::Registry::~Registry ( )
protectedvirtual
osgDB::Registry::Registry ( )
protected

constructor is private, as its a singleton, preventing construction other than via the instance() method and therefore ensuring only one copy is ever constructed

Member Function Documentation

void osgDB::Registry::_buildKdTreeIfRequired ( ReaderWriter::ReadResult result,
const Options options 
)
inline
void osgDB::Registry::addArchiveExtension ( const std::string  ext)

Add an Archive extension.

void osgDB::Registry::addEntryToObjectCache ( const std::string &  filename,
osg::Object object,
double  timestamp = 0.0 
)

Add a filename,object,timestamp triple to the Registry::ObjectCache.

void osgDB::Registry::addFileExtensionAlias ( const std::string  mapExt,
const std::string  toExt 
)

register an .fileextension alias to mapExt toExt, the later should be the extension name of the readerwriter plugin library.

For example to map .tif files to the tiff loader, use addExtAlias("tif","tiff") which will enable .tif to be read by the libdb_tiff readerwriter plugin.

void osgDB::Registry::addImageProcessor ( ImageProcessor ip)
void osgDB::Registry::addMimeTypeExtensionMapping ( const std::string  fromMimeType,
const std::string  toExt 
)

Registers a mapping of a mime-type to an extension.

A process fetching data over HTTP can use this facility to determine the proper ReaderWriter to use when there is no filename extension to rely upon.

void osgDB::Registry::addReaderWriter ( ReaderWriter rw)
void osgDB::Registry::addToArchiveCache ( const std::string &  fileName,
osgDB::Archive archive 
)

Add archive to archive cache so that future calls reference this archive.

void osgDB::Registry::clearArchiveCache ( )

Remove all archives from the archive cache.

void osgDB::Registry::clearObjectCache ( )

Remove all objects in the cache regardless of having external references or expiry times.

void osgDB::Registry::closeAllLibraries ( )

close all libraries.

bool osgDB::Registry::closeLibrary ( const std::string &  fileName)

close the attached library with specified name.

std::string osgDB::Registry::createLibraryNameForExtension ( const std::string &  ext)

create the platform specific library name associated with file extension.

std::string osgDB::Registry::createLibraryNameForFile ( const std::string &  fileName)

create the platform specific library name associated with file.

std::string osgDB::Registry::createLibraryNameForNodeKit ( const std::string &  name)

create the platform specific library name associated with nodekit library name.

void osgDB::Registry::destruct ( )
protected
std::string osgDB::Registry::findDataFile ( const std::string &  fileName,
const Options options,
CaseSensitivity  caseSensitivity 
)
inline
std::string osgDB::Registry::findDataFileImplementation ( const std::string &  fileName,
const Options options,
CaseSensitivity  caseSensitivity 
)
std::string osgDB::Registry::findLibraryFile ( const std::string &  fileName,
const Options options,
CaseSensitivity  caseSensitivity 
)
inline
std::string osgDB::Registry::findLibraryFileImplementation ( const std::string &  fileName,
const Options options,
CaseSensitivity  caseSensitivity 
)
const ArchiveExtensionList& osgDB::Registry::getArchiveExtensions ( ) const
inline
AuthenticationMap* osgDB::Registry::getAuthenticationMap ( )
inline

Get the password map to be used by plugins when access files from secure locations.

const AuthenticationMap* osgDB::Registry::getAuthenticationMap ( ) const
inline

Get the password map to be used by plugins when access files from secure locations.

Options::BuildKdTreesHint osgDB::Registry::getBuildKdTreesHint ( ) const
inline

Get whether the KdTrees should be built for geometry in the loader model.

bool osgDB::Registry::getCreateNodeFromImage ( ) const
inline
FilePathList& osgDB::Registry::getDataFilePathList ( )
inline

get the data file path which is used when search for data files.

const FilePathList& osgDB::Registry::getDataFilePathList ( ) const
inline

get the const data file path which is used when search for data files.

DeprecatedDotOsgWrapperManager* osgDB::Registry::getDeprecatedDotOsgObjectWrapperManager ( )
inline

Get the ObjectWrapperManager that is used to store all the ObjectWrappers.

double osgDB::Registry::getExpiryDelay ( ) const
inline
FileCache* osgDB::Registry::getFileCache ( )
inline

Get the FileCache that is used to manage local storage of files downloaded from the internet.

const FileCache* osgDB::Registry::getFileCache ( ) const
inline

Get the const FileCache that is used to manage local storage of files downloaded from the internet.

FileLocationCallback* osgDB::Registry::getFileLocationCallback ( ) const
inline

Get the callback to use inform to the DatabasePager whether a file is located on local or remote file system.

FindFileCallback* osgDB::Registry::getFindFileCallback ( )
inline

Get the findFile callback.

const FindFileCallback* osgDB::Registry::getFindFileCallback ( ) const
inline

Get the const findFile callback.

osgDB::Archive* osgDB::Registry::getFromArchiveCache ( const std::string &  fileName)

Get an Archive from the archive cache.

osg::Object* osgDB::Registry::getFromObjectCache ( const std::string &  fileName)

Get an Object from the object cache.

ImageProcessor* osgDB::Registry::getImageProcessor ( )

get a image processor if available.

ImageProcessor* osgDB::Registry::getImageProcessorForExtension ( const std::string &  ext)

get a image processor which is associated specified extension.

ImageProcessorList& osgDB::Registry::getImageProcessorList ( )
inline

get list of all registered ImageProcessors.

const ImageProcessorList& osgDB::Registry::getImageProcessorList ( ) const
inline

get const list of all registered ImageProcessors.

osg::KdTreeBuilder* osgDB::Registry::getKdTreeBuilder ( )
inline

Get the KdTreeBuilder visitor that is used to build KdTree on loaded models.

DynamicLibrary* osgDB::Registry::getLibrary ( const std::string &  fileName)

get the attached library with specified name.

FilePathList& osgDB::Registry::getLibraryFilePathList ( )
inline

get the library file path which is used when search for library (dso/dll's) files.

const FilePathList& osgDB::Registry::getLibraryFilePathList ( ) const
inline

get the const library file path which is used when search for library (dso/dll's) files.

DynamicLibraryList::iterator osgDB::Registry::getLibraryItr ( const std::string &  fileName)
protected

get the attached library with specified name.

MimeTypeExtensionMap& osgDB::Registry::getMimeTypeExtensionMap ( )
inline
const MimeTypeExtensionMap& osgDB::Registry::getMimeTypeExtensionMap ( ) const
inline
ObjectCache* osgDB::Registry::getObjectCache ( )
inline

Get the ObjectCache that is used to manage local storage of files downloaded from the internet.

const ObjectCache* osgDB::Registry::getObjectCache ( ) const
inline

Get the const ObjectCache that is used to manage local storage of files downloaded from the internet.

ObjectWrapperManager* osgDB::Registry::getObjectWrapperManager ( )
inline

Get the ObjectWrapperManager that is used to store all the ObjectWrappers.

Options* osgDB::Registry::getOptions ( )
inline
const Options* osgDB::Registry::getOptions ( ) const
inline
SharedStateManager* osgDB::Registry::getOrCreateSharedStateManager ( )

Get the SharedStateManager, creating one if one is not already created.

ReaderWriter* osgDB::Registry::getReaderWriterForExtension ( const std::string &  ext)

get a reader writer which handles specified extension.

ReaderWriter* osgDB::Registry::getReaderWriterForMimeType ( const std::string &  mimeType)

gets a reader/writer that handles the extension mapped to by one of the registered mime-types.

ReaderWriter* osgDB::Registry::getReaderWriterForProtocolAndExtension ( const std::string &  protocol,
const std::string &  extension 
)
ReaderWriterList& osgDB::Registry::getReaderWriterList ( )
inline

get list of all registered ReaderWriters.

const ReaderWriterList& osgDB::Registry::getReaderWriterList ( ) const
inline

get const list of all registered ReaderWriters.

void osgDB::Registry::getReaderWriterListForProtocol ( const std::string &  protocol,
ReaderWriterList results 
) const

get a list of registered ReaderWriters which can handle given protocol

ReadFileCallback* osgDB::Registry::getReadFileCallback ( )
inline

Get the readFile callback.

const ReadFileCallback* osgDB::Registry::getReadFileCallback ( ) const
inline

Get the const readFile callback.

osg::ref_ptr<osgDB::Archive> osgDB::Registry::getRefFromArchiveCache ( const std::string &  fileName)

Get an ref_ptr<Archive> from the archive cache.

osg::ref_ptr<osg::Object> osgDB::Registry::getRefFromObjectCache ( const std::string &  fileName)

Get an ref_ptr<Object> from the object cache.

SharedStateManager* osgDB::Registry::getSharedStateManager ( )
inline

Get the SharedStateManager.

Return 0 if no SharedStateManager has been assigned.

WriteFileCallback* osgDB::Registry::getWriteFileCallback ( )
inline

Get the writeFile callback.

const WriteFileCallback* osgDB::Registry::getWriteFileCallback ( ) const
inline

Get the const writeFile callback.

void osgDB::Registry::initDataFilePathList ( )

initialize the Data FilePath by reading the OSG_FILE_PATH environmental variable.

void osgDB::Registry::initFilePathLists ( )
inline

initialize both the Data and Library FilePaths, by default called by the constructor, so it should only be required if you want to force the re-reading of environmental variables.

void osgDB::Registry::initLibraryFilePathList ( )

initialize the Library FilePath by reading the OSG_LIBRARY_PATH and the appropriate system environmental variables

static Registry* osgDB::Registry::instance ( bool  erase = false)
static
bool osgDB::Registry::isProtocolRegistered ( const std::string &  protocol)

returns true, if named protocol is registered

LoadStatus osgDB::Registry::loadLibrary ( const std::string &  fileName)

find the library in the OSG_LIBRARY_PATH and load it.

ReaderWriter::ReadResult osgDB::Registry::openArchive ( const std::string &  fileName,
ReaderWriter::ArchiveStatus  status,
unsigned int  indexBlockSizeHint,
const Options options 
)
inline
ReaderWriter::ReadResult osgDB::Registry::openArchiveImplementation ( const std::string &  fileName,
ReaderWriter::ArchiveStatus  status,
unsigned int  indexBlockSizeHint,
const Options options 
)
ReaderWriter::ReadResult osgDB::Registry::read ( const ReadFunctor readFunctor)
protected
void osgDB::Registry::readCommandLine ( osg::ArgumentParser commandLine)

read the command line arguments.

ReaderWriter::ReadResult osgDB::Registry::readHeightField ( const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::ReadResult osgDB::Registry::readHeightFieldImplementation ( const std::string &  fileName,
const Options options 
)
ReaderWriter::ReadResult osgDB::Registry::readImage ( const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::ReadResult osgDB::Registry::readImageImplementation ( const std::string &  fileName,
const Options options 
)
ReaderWriter::ReadResult osgDB::Registry::readImplementation ( const ReadFunctor readFunctor,
Options::CacheHintOptions  cacheHint 
)
protected
ReaderWriter::ReadResult osgDB::Registry::readNode ( const std::string &  fileName,
const Options options,
bool  buildKdTreeIfRequired = true 
)
inline
ReaderWriter::ReadResult osgDB::Registry::readNodeImplementation ( const std::string &  fileName,
const Options options 
)
ReaderWriter::ReadResult osgDB::Registry::readObject ( const std::string &  fileName,
const Options options,
bool  buildKdTreeIfRequired = true 
)
inline
ReaderWriter::ReadResult osgDB::Registry::readObjectImplementation ( const std::string &  fileName,
const Options options 
)
bool osgDB::Registry::readPluginAliasConfigurationFile ( const std::string &  file)

Reads a file that configures extension mappings.

File is ASCII text and each line contains the parameters to the addFileExtensionAlias method. Lines can be commented out with an initial '#' character.

ReaderWriter::ReadResult osgDB::Registry::readScript ( const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::ReadResult osgDB::Registry::readScriptImplementation ( const std::string &  fileName,
const Options options 
)
ReaderWriter::ReadResult osgDB::Registry::readShader ( const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::ReadResult osgDB::Registry::readShaderImplementation ( const std::string &  fileName,
const Options options 
)
void osgDB::Registry::registerProtocol ( const std::string &  protocol)

registers a protocol

void osgDB::Registry::releaseGLObjects ( osg::State state = 0)

If State is non-zero, this function releases OpenGL objects for the specified graphics context.

Otherwise, releases OpenGL objexts for all graphics contexts.

void osgDB::Registry::removeExpiredObjectsInCache ( const osg::FrameStamp frameStamp)

Removed object in the cache which have a time stamp at or before the specified expiry time.

This would typically be called once per frame by applications which are doing database paging, and need to prune objects that are no longer required, and called after the a called after the call to updateTimeStampOfObjectsInCacheWithExternalReferences(frameStamp).

void osgDB::Registry::removeFromArchiveCache ( const std::string &  fileName)

Remove Archive from cache.

void osgDB::Registry::removeFromObjectCache ( const std::string &  fileName)

Remove Object from cache.

void osgDB::Registry::removeImageProcessor ( ImageProcessor ip)
void osgDB::Registry::removeReaderWriter ( ReaderWriter rw)
void osgDB::Registry::setAuthenticationMap ( AuthenticationMap authenticationMap)
inline

Set the password map to be used by plugins when access files from secure locations.

void osgDB::Registry::setBuildKdTreesHint ( Options::BuildKdTreesHint  hint)
inline

Set whether the KdTrees should be built for geometry in the loader model.

void osgDB::Registry::setCreateNodeFromImage ( bool  flag)
inline
void osgDB::Registry::setDataFilePathList ( const FilePathList filepath)
inline

Set the data file path using a list of paths stored in a FilePath, which is used when search for data files.

void osgDB::Registry::setDataFilePathList ( const std::string &  paths)

Set the data file path using a single string delimited either with ';' (Windows) or ':' (All other platforms), which is used when search for data files.

void osgDB::Registry::setExpiryDelay ( double  expiryDelay)
inline

set hint to viewer code calling removeExpiredObjectsInCache to specify how long it should give before expiring objects in Registry cache,

void osgDB::Registry::setFileCache ( FileCache fileCache)
inline

Set the FileCache that is used to manage local storage of files downloaded from the internet.

void osgDB::Registry::setFileLocationCallback ( FileLocationCallback cb)
inline

Set the callback to use inform to the DatabasePager whether a file is located on local or remote file system.

void osgDB::Registry::setFindFileCallback ( FindFileCallback cb)
inline

Set the Registry callback to use in place of the default findFile calls.

void osgDB::Registry::setKdTreeBuilder ( osg::KdTreeBuilder builder)
inline

Set the KdTreeBuilder visitor that is used to build KdTree on loaded models.

void osgDB::Registry::setLibraryFilePathList ( const FilePathList filepath)
inline

Set the library file path using a list of paths stored in a FilePath, which is used when search for data files.

void osgDB::Registry::setLibraryFilePathList ( const std::string &  paths)

Set the library file path using a single string delimited either with ';' (Windows) or ':' (All other platforms), which is used when search for data files.

void osgDB::Registry::setObjectCache ( ObjectCache objectCache)
inline

Set the ObjectCache that is used to manage local storage of files downloaded from the internet.

void osgDB::Registry::setOptions ( Options opt)
inline
void osgDB::Registry::setReadFileCallback ( ReadFileCallback cb)
inline

Set the Registry callback to use in place of the default readFile calls.

void osgDB::Registry::setSharedStateManager ( SharedStateManager SharedStateManager)
inline
void osgDB::Registry::setWriteFileCallback ( WriteFileCallback cb)
inline

Set the Registry callback to use in place of the default writeFile calls.

static std::string osgDB::Registry::trim ( const std::string &  str)
staticprotected
void osgDB::Registry::updateTimeStampOfObjectsInCacheWithExternalReferences ( const osg::FrameStamp frameStamp)

For each object in the cache which has an reference count greater than 1 (and therefore referenced by elsewhere in the application) set the time stamp for that object in the cache to specified time.

This would typically be called once per frame by applications which are doing database paging, and need to prune objects that are no longer required. The time used is taken from the FrameStamp::getReferenceTime().

ReaderWriter::WriteResult osgDB::Registry::writeHeightField ( const osg::HeightField obj,
const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::WriteResult osgDB::Registry::writeHeightFieldImplementation ( const osg::HeightField obj,
const std::string &  fileName,
const Options options 
)
ReaderWriter::WriteResult osgDB::Registry::writeImage ( const osg::Image obj,
const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::WriteResult osgDB::Registry::writeImageImplementation ( const osg::Image obj,
const std::string &  fileName,
const Options options 
)
ReaderWriter::WriteResult osgDB::Registry::writeNode ( const osg::Node node,
const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::WriteResult osgDB::Registry::writeNodeImplementation ( const osg::Node node,
const std::string &  fileName,
const Options options 
)
ReaderWriter::WriteResult osgDB::Registry::writeObject ( const osg::Object obj,
const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::WriteResult osgDB::Registry::writeObjectImplementation ( const osg::Object obj,
const std::string &  fileName,
const Options options 
)
ReaderWriter::WriteResult osgDB::Registry::writeScript ( const osg::Script obj,
const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::WriteResult osgDB::Registry::writeScriptImplementation ( const osg::Script obj,
const std::string &  fileName,
const Options options 
)
ReaderWriter::WriteResult osgDB::Registry::writeShader ( const osg::Shader obj,
const std::string &  fileName,
const Options options 
)
inline
ReaderWriter::WriteResult osgDB::Registry::writeShaderImplementation ( const osg::Shader obj,
const std::string &  fileName,
const Options options 
)

Friends And Related Function Documentation

friend class AvailableArchiveIterator
friend
friend class AvailableReaderWriterIterator
friend
friend struct ReadArchiveFunctor
friend
friend struct ReadFunctor
friend
friend struct ReadHeightFieldFunctor
friend
friend struct ReadImageFunctor
friend
friend struct ReadNodeFunctor
friend
friend struct ReadObjectFunctor
friend
friend struct ReadScriptFunctor
friend
friend struct ReadShaderFunctor
friend

Member Data Documentation

ArchiveCache osgDB::Registry::_archiveCache
protected
OpenThreads::ReentrantMutex osgDB::Registry::_archiveCacheMutex
protected
ArchiveExtensionList osgDB::Registry::_archiveExtList
protected
osg::ref_ptr<AuthenticationMap> osgDB::Registry::_authenticationMap
protected
Options::BuildKdTreesHint osgDB::Registry::_buildKdTreesHint
protected
bool osgDB::Registry::_createNodeFromImage
protected
FilePathList osgDB::Registry::_dataFilePath
protected
osg::ref_ptr<DeprecatedDotOsgWrapperManager> osgDB::Registry::_deprecatedDotOsgWrapperManager
protected
DynamicLibraryList osgDB::Registry::_dlList
protected
double osgDB::Registry::_expiryDelay
protected
ExtensionAliasMap osgDB::Registry::_extAliasMap
protected
osg::ref_ptr<FileCache> osgDB::Registry::_fileCache
protected
osg::ref_ptr<FileLocationCallback> osgDB::Registry::_fileLocationCallback
protected
osg::ref_ptr<FindFileCallback> osgDB::Registry::_findFileCallback
protected
ImageProcessorList osgDB::Registry::_ipList
protected
osg::ref_ptr<osg::KdTreeBuilder> osgDB::Registry::_kdTreeBuilder
protected
FilePathList osgDB::Registry::_libraryFilePath
protected
MimeTypeExtensionMap osgDB::Registry::_mimeTypeExtMap
protected
osg::ref_ptr<ObjectCache> osgDB::Registry::_objectCache
protected
osg::ref_ptr<ObjectWrapperManager> osgDB::Registry::_objectWrapperManager
protected
bool osgDB::Registry::_openingLibrary
protected
osg::ref_ptr<Options> osgDB::Registry::_options
protected
OpenThreads::ReentrantMutex osgDB::Registry::_pluginMutex
protected
osg::ref_ptr<ReadFileCallback> osgDB::Registry::_readFileCallback
protected
RegisteredProtocolsSet osgDB::Registry::_registeredProtocols
protected
ReaderWriterList osgDB::Registry::_rwList
protected
osg::ref_ptr<SharedStateManager> osgDB::Registry::_sharedStateManager
protected
osg::ref_ptr<WriteFileCallback> osgDB::Registry::_writeFileCallback
protected

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

osg logo
Generated at Wed Nov 11 2015 22:14:55 for the OpenSceneGraph by doxygen 1.8.10.