OSG
3.4.0
|
#include <Registry.h>
Classes | |
struct | ReadFunctor |
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 |
Static Public Member Functions | |
static Registry * | instance (bool erase=false) |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
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 () | |
DynamicLibraryList::iterator | getLibraryItr (const std::string &fileName) |
void | destruct () |
ReaderWriter::ReadResult | read (const ReadFunctor &readFunctor) |
ReaderWriter::ReadResult | readImplementation (const ReadFunctor &readFunctor, Options::CacheHintOptions cacheHint) |
![]() | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Static Protected Member Functions | |
static std::string | trim (const std::string &str) |
Friends | |
struct | ReadFunctor |
struct | ReadObjectFunctor |
struct | ReadImageFunctor |
struct | ReadHeightFieldFunctor |
struct | ReadNodeFunctor |
struct | ReadArchiveFunctor |
struct | ReadShaderFunctor |
struct | ReadScriptFunctor |
class | AvailableReaderWriterIterator |
class | AvailableArchiveIterator |
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.
Definition at line 53 of file Registry.h.
|
protected |
Definition at line 525 of file Registry.h.
typedef std::vector< std::string> osgDB::Registry::ArchiveExtensionList |
Definition at line 515 of file Registry.h.
|
protected |
Definition at line 522 of file Registry.h.
|
protected |
Definition at line 523 of file Registry.h.
Definition at line 157 of file Registry.h.
typedef class osgDB::FindFileCallback osgDB::Registry::FindFileCallback |
Definition at line 154 of file Registry.h.
typedef std::vector< osg::ref_ptr<ImageProcessor> > osgDB::Registry::ImageProcessorList |
Definition at line 139 of file Registry.h.
typedef std::map< std::string, std::string> osgDB::Registry::MimeTypeExtensionMap |
Definition at line 77 of file Registry.h.
typedef std::vector< osg::ref_ptr<ReaderWriter> > osgDB::Registry::ReaderWriterList |
Definition at line 118 of file Registry.h.
typedef class osgDB::ReadFileCallback osgDB::Registry::ReadFileCallback |
Definition at line 155 of file Registry.h.
|
protected |
Definition at line 527 of file Registry.h.
typedef class osgDB::WriteFileCallback osgDB::Registry::WriteFileCallback |
Definition at line 156 of file Registry.h.
Enumerator | |
---|---|
NOT_LOADED | |
PREVIOUSLY_LOADED | |
LOADED |
Definition at line 103 of file Registry.h.
|
protectedvirtual |
|
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
|
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.
|
protected |
|
inline |
std::string osgDB::Registry::findDataFileImplementation | ( | const std::string & | fileName, |
const Options * | options, | ||
CaseSensitivity | caseSensitivity | ||
) |
|
inline |
std::string osgDB::Registry::findLibraryFileImplementation | ( | const std::string & | fileName, |
const Options * | options, | ||
CaseSensitivity | caseSensitivity | ||
) |
|
inline |
Definition at line 516 of file Registry.h.
|
inline |
Get the password map to be used by plugins when access files from secure locations.
Definition at line 370 of file Registry.h.
|
inline |
Get the password map to be used by plugins when access files from secure locations.
Definition at line 373 of file Registry.h.
|
inline |
Get whether the KdTrees should be built for geometry in the loader model.
Definition at line 347 of file Registry.h.
|
inline |
Definition at line 377 of file Registry.h.
|
inline |
get the data file path which is used when search for data files.
Definition at line 400 of file Registry.h.
|
inline |
get the const data file path which is used when search for data files.
Definition at line 403 of file Registry.h.
|
inline |
Get the ObjectWrapperManager that is used to store all the ObjectWrappers.
Definition at line 513 of file Registry.h.
|
inline |
Definition at line 435 of file Registry.h.
|
inline |
Get the FileCache that is used to manage local storage of files downloaded from the internet.
Definition at line 360 of file Registry.h.
|
inline |
Get the const FileCache that is used to manage local storage of files downloaded from the internet.
Definition at line 363 of file Registry.h.
|
inline |
Get the callback to use inform to the DatabasePager whether a file is located on local or remote file system.
Definition at line 339 of file Registry.h.
|
inline |
Get the findFile callback.
Definition at line 163 of file Registry.h.
|
inline |
Get the const findFile callback.
Definition at line 166 of file Registry.h.
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.
|
inline |
get list of all registered ImageProcessors.
Definition at line 148 of file Registry.h.
|
inline |
get const list of all registered ImageProcessors.
Definition at line 151 of file Registry.h.
|
inline |
Get the KdTreeBuilder visitor that is used to build KdTree on loaded models.
Definition at line 353 of file Registry.h.
DynamicLibrary* osgDB::Registry::getLibrary | ( | const std::string & | fileName | ) |
get the attached library with specified name.
|
inline |
get the library file path which is used when search for library (dso/dll's) files.
Definition at line 416 of file Registry.h.
|
inline |
get the const library file path which is used when search for library (dso/dll's) files.
Definition at line 419 of file Registry.h.
|
protected |
get the attached library with specified name.
|
inline |
Definition at line 84 of file Registry.h.
|
inline |
Definition at line 85 of file Registry.h.
|
inline |
Get the ObjectCache that is used to manage local storage of files downloaded from the internet.
Definition at line 427 of file Registry.h.
|
inline |
Get the const ObjectCache that is used to manage local storage of files downloaded from the internet.
Definition at line 430 of file Registry.h.
|
inline |
Get the ObjectWrapperManager that is used to store all the ObjectWrappers.
Definition at line 510 of file Registry.h.
|
inline |
|
inline |
Definition at line 382 of file Registry.h.
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 | ||
) |
|
inline |
get list of all registered ReaderWriters.
Definition at line 128 of file Registry.h.
|
inline |
get const list of all registered ReaderWriters.
Definition at line 131 of file Registry.h.
void osgDB::Registry::getReaderWriterListForProtocol | ( | const std::string & | protocol, |
ReaderWriterList & | results | ||
) | const |
get a list of registered ReaderWriters which can handle given protocol
|
inline |
Get the readFile callback.
Definition at line 191 of file Registry.h.
|
inline |
Get the const readFile callback.
Definition at line 194 of file Registry.h.
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
|
inline |
Get the SharedStateManager. Return 0 if no SharedStateManager has been assigned.
Definition at line 498 of file Registry.h.
|
inline |
Get the writeFile callback.
Definition at line 268 of file Registry.h.
|
inline |
Get the const writeFile callback.
Definition at line 271 of file Registry.h.
void osgDB::Registry::initDataFilePathList | ( | ) |
initialize the Data FilePath by reading the OSG_FILE_PATH environmental variable.
|
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.
Definition at line 388 of file Registry.h.
void osgDB::Registry::initLibraryFilePathList | ( | ) |
initialize the Library FilePath by reading the OSG_LIBRARY_PATH and the appropriate system environmental variables
|
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.
|
inline |
ReaderWriter::ReadResult osgDB::Registry::openArchiveImplementation | ( | const std::string & | fileName, |
ReaderWriter::ArchiveStatus | status, | ||
unsigned int | indexBlockSizeHint, | ||
const Options * | options | ||
) |
|
protected |
void osgDB::Registry::readCommandLine | ( | osg::ArgumentParser & | commandLine | ) |
read the command line arguments.
|
inline |
ReaderWriter::ReadResult osgDB::Registry::readHeightFieldImplementation | ( | const std::string & | fileName, |
const Options * | options | ||
) |
|
inline |
ReaderWriter::ReadResult osgDB::Registry::readImageImplementation | ( | const std::string & | fileName, |
const Options * | options | ||
) |
|
protected |
|
inline |
ReaderWriter::ReadResult osgDB::Registry::readNodeImplementation | ( | const std::string & | fileName, |
const Options * | options | ||
) |
|
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.
|
inline |
ReaderWriter::ReadResult osgDB::Registry::readScriptImplementation | ( | 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 | ) |
|
inline |
Set the password map to be used by plugins when access files from secure locations.
Definition at line 367 of file Registry.h.
|
inline |
Set whether the KdTrees should be built for geometry in the loader model.
Definition at line 344 of file Registry.h.
|
inline |
Definition at line 376 of file Registry.h.
|
inline |
Set the data file path using a list of paths stored in a FilePath, which is used when search for data files.
Definition at line 394 of file Registry.h.
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.
|
inline |
set hint to viewer code calling removeExpiredObjectsInCache to specify how long it should give before expiring objects in Registry cache,
Definition at line 433 of file Registry.h.
|
inline |
Set the FileCache that is used to manage local storage of files downloaded from the internet.
Definition at line 357 of file Registry.h.
|
inline |
Set the callback to use inform to the DatabasePager whether a file is located on local or remote file system.
Definition at line 336 of file Registry.h.
|
inline |
Set the Registry callback to use in place of the default findFile calls.
Definition at line 160 of file Registry.h.
|
inline |
Set the KdTreeBuilder visitor that is used to build KdTree on loaded models.
Definition at line 350 of file Registry.h.
|
inline |
Set the library file path using a list of paths stored in a FilePath, which is used when search for data files.
Definition at line 410 of file Registry.h.
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.
|
inline |
Set the ObjectCache that is used to manage local storage of files downloaded from the internet.
Definition at line 424 of file Registry.h.
|
inline |
Definition at line 380 of file Registry.h.
|
inline |
Set the Registry callback to use in place of the default readFile calls.
Definition at line 188 of file Registry.h.
|
inline |
Set the SharedStateManager.
Definition at line 492 of file Registry.h.
|
inline |
Set the Registry callback to use in place of the default writeFile calls.
Definition at line 265 of file Registry.h.
|
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().
|
inline |
ReaderWriter::WriteResult osgDB::Registry::writeHeightFieldImplementation | ( | const osg::HeightField & | 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 | ||
) |
|
inline |
ReaderWriter::WriteResult osgDB::Registry::writeNodeImplementation | ( | const osg::Node & | node, |
const std::string & | fileName, | ||
const Options * | options | ||
) |
|
inline |
ReaderWriter::WriteResult osgDB::Registry::writeObjectImplementation | ( | const osg::Object & | 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 | ||
) |
|
inline |
ReaderWriter::WriteResult osgDB::Registry::writeShaderImplementation | ( | const osg::Shader & | obj, |
const std::string & | fileName, | ||
const Options * | options | ||
) |
|
friend |
Definition at line 597 of file Registry.h.
|
friend |
Definition at line 595 of file Registry.h.
|
friend |
Definition at line 586 of file Registry.h.
|
friend |
Definition at line 578 of file Registry.h.
|
friend |
Definition at line 584 of file Registry.h.
|
friend |
Definition at line 583 of file Registry.h.
|
friend |
Definition at line 585 of file Registry.h.
|
friend |
Definition at line 582 of file Registry.h.
|
friend |
Definition at line 588 of file Registry.h.
|
friend |
Definition at line 587 of file Registry.h.
|
protected |
Definition at line 612 of file Registry.h.
|
protected |
Definition at line 611 of file Registry.h.
|
protected |
Definition at line 636 of file Registry.h.
|
protected |
Definition at line 542 of file Registry.h.
|
protected |
Definition at line 537 of file Registry.h.
|
protected |
Definition at line 544 of file Registry.h.
|
protected |
Definition at line 628 of file Registry.h.
|
protected |
Definition at line 641 of file Registry.h.
|
protected |
Definition at line 609 of file Registry.h.
|
protected |
Definition at line 633 of file Registry.h.
|
protected |
Definition at line 617 of file Registry.h.
|
protected |
Definition at line 540 of file Registry.h.
|
protected |
Definition at line 604 of file Registry.h.
|
protected |
Definition at line 601 of file Registry.h.
|
protected |
Definition at line 608 of file Registry.h.
|
protected |
Definition at line 538 of file Registry.h.
|
protected |
Definition at line 629 of file Registry.h.
|
protected |
Definition at line 620 of file Registry.h.
|
protected |
Definition at line 631 of file Registry.h.
|
protected |
Definition at line 640 of file Registry.h.
|
protected |
Definition at line 614 of file Registry.h.
|
protected |
Definition at line 626 of file Registry.h.
|
protected |
Definition at line 606 of file Registry.h.
|
protected |
Definition at line 602 of file Registry.h.
|
protected |
Definition at line 546 of file Registry.h.
|
protected |
Definition at line 607 of file Registry.h.
|
protected |
Definition at line 638 of file Registry.h.
|
protected |
Definition at line 603 of file Registry.h.