Google

class OSGDB_EXPORT osgDB::Registry

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

Inheritance:


Public Methods

[more]static Registry* instance()
[more]void readCommandLine(std::vector<std::string>& commandLine)
read the command line string list, removing any matched control sequences
[more]void addFileExtensionAlias(const std::string mapExt, const std::string toExt)
register an fileextension alias to mapExt toExt, the later should the the extension name of the readerwriter plugin library.
[more]void addDotOsgWrapper(DotOsgWrapper* wrapper)
[more]void removeDotOsgWrapper(DotOsgWrapper* wrapper)
[more]void addReaderWriter(ReaderWriter* rw)
[more]void removeReaderWriter(ReaderWriter* rw)
[more]std::string createLibraryNameForFile(const std::string& fileName)
create the platform specific library name associated with file
[more]std::string createLibraryNameForExt(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]bool loadLibrary(const std::string& fileName)
find the library in the SG_LIBRARY_PATH and load it
[more]bool closeLibrary(const std::string& fileName)
close the attached library with specified name
[more]osg::Object* readObjectOfType(const osg::Object& compObj, Input& fr)
[more]osg::Object* readObject(Input& fr)
[more]osg::Image* readImage(Input& fr)
[more]osg::Drawable* readDrawable(Input& fr)
[more]osg::StateAttribute* readStateAttribute(Input& fr)
[more]osg::Node* readNode(Input& fr)
[more]bool writeObject(const osg::Object& obj, Output& fw)
[more]ReaderWriter::ReadResult readObject(const std::string& fileName)
[more]ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName)
[more]ReaderWriter::ReadResult readImage(const std::string& fileName)
[more]ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName)
[more]ReaderWriter::ReadResult readNode(const std::string& fileName)
[more]ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName)
[more]void setCreateNodeFromImage(bool flag)
[more]bool getCreateNodeFromImage() const
[more]void setOptions(ReaderWriter::Options* opt)
[more]ReaderWriter::Options* getOptions()
[more]const ReaderWriter::Options* getOptions() const
[more]void initFilePathLists()
initilize 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()
initilize 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 deliminated either with ';' (Windows) or ':' (All other platforms), which is used when search for data files
[more]FilePathList& getDataFilePathList()
get the data file path which is used when search for data files
[more]const FilePathList& getDataFilePathList() const
get the const data file path which is used when search for data files
[more]void initLibraryFilePathList()
initilize 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 deliminated either with ';' (Windows) or ':' (All other platforms), which is used when search for data files
[more]FilePathList& getLibraryFilePathList()
get the library file path which is used when search for library (dso/dll's) files
[more]const FilePathList& getLibraryFilePathList() const
get the const library file path which is used when search for library (dso/dll's) files
[more]static void convertStringPathIntoFilePathList(const std::string& paths, FilePathList& filepath)
convert a string containing a list of paths deliminated either with ';' (Windows) or ':' (All other platforms) into FilePath represetation

Protected Fields

[more]bool _createNodeFromImage
[more]DotOsgWrapperMap _objectWrapperMap
[more]DotOsgWrapperMap _imageWrapperMap
[more]DotOsgWrapperMap _drawableWrapperMap
[more]DotOsgWrapperMap _stateAttrWrapperMap
[more]DotOsgWrapperMap _nodeWrapperMap
[more]DotOsgWrapperMap _classNameWrapperMap
[more]ReaderWriterList _rwList
[more]DynamicLibraryList _dlList
[more]bool _openingLibrary
[more]ExtensionAliasMap _extAliasMap
[more]osg::ref_ptr<ReaderWriter::Options> _options
[more]FilePathList _dataFilePath
[more]FilePathList _libraryFilePath

Protected Methods

[more]virtual ~Registry()
[more] 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]DynamicLibrary* getLibrary(const std::string& fileName)
[more]osg::Object* readObject(DotOsgWrapperMap& dowMap, Input& fr)
[more]void eraseWrapper(DotOsgWrapperMap& wrappermap, DotOsgWrapper* wrapper)

Protected Members

[more]typedef std::map<std::string,osg::ref_ptr<DotOsgWrapper> > DotOsgWrapperMap
[more]typedef std::vector<osg::ref_ptr<ReaderWriter> > ReaderWriterList
[more]typedef std::vector<osg::ref_ptr<DynamicLibrary> > DynamicLibraryList
[more]typedef std::map<std::string,std::string> ExtensionAliasMap


Documentation

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

The RegisterDotOsgWrapperProxy can be used to automatically register DotOsgWrappers, at runtime with the Registry. A DotOsgWrapper encapsulates the functions that can read and write to the .osg for each osg::Object.

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

ostatic Registry* instance()

ovoid readCommandLine(std::vector<std::string>& commandLine)
read the command line string list, removing any matched control sequences

ovoid addFileExtensionAlias(const std::string mapExt, const std::string toExt)
register an fileextension alias to mapExt toExt, the later should the 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.

ovoid addDotOsgWrapper(DotOsgWrapper* wrapper)

ovoid removeDotOsgWrapper(DotOsgWrapper* wrapper)

ovoid addReaderWriter(ReaderWriter* rw)

ovoid removeReaderWriter(ReaderWriter* rw)

ostd::string createLibraryNameForFile(const std::string& fileName)
create the platform specific library name associated with file

ostd::string createLibraryNameForExt(const std::string& ext)
create the platform specific library name associated with file extension

ostd::string createLibraryNameForNodeKit(const std::string& name)
create the platform specific library name associated with nodekit library name

obool loadLibrary(const std::string& fileName)
find the library in the SG_LIBRARY_PATH and load it

obool closeLibrary(const std::string& fileName)
close the attached library with specified name

oosg::Object* readObjectOfType(const osg::Object& compObj, Input& fr)

oosg::Object* readObject(Input& fr)

oosg::Image* readImage(Input& fr)

oosg::Drawable* readDrawable(Input& fr)

oosg::StateAttribute* readStateAttribute(Input& fr)

oosg::Node* readNode(Input& fr)

obool writeObject(const osg::Object& obj, Output& fw)

oReaderWriter::ReadResult readObject(const std::string& fileName)

oReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName)

oReaderWriter::ReadResult readImage(const std::string& fileName)

oReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName)

oReaderWriter::ReadResult readNode(const std::string& fileName)

oReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName)

ovoid setCreateNodeFromImage(bool flag)

obool getCreateNodeFromImage() const

ovoid setOptions(ReaderWriter::Options* opt)

oReaderWriter::Options* getOptions()

oconst ReaderWriter::Options* getOptions() const

ovoid initFilePathLists()
initilize 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

ovoid initDataFilePathList()
initilize the Data FilePath by reading the OSG_FILE_PATH environmental variable

ovoid 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

ovoid setDataFilePathList(const std::string& paths)
Set the data file path using a single string deliminated either with ';' (Windows) or ':' (All other platforms), which is used when search for data files

oFilePathList& getDataFilePathList()
get the data file path which is used when search for data files

oconst FilePathList& getDataFilePathList() const
get the const data file path which is used when search for data files

ovoid initLibraryFilePathList()
initilize the Library FilePath by reading the OSG_LIBRARY_PATH and the appropriate system environmental variables

ovoid 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

ovoid setLibraryFilePathList(const std::string& paths)
Set the library file path using a single string deliminated either with ';' (Windows) or ':' (All other platforms), which is used when search for data files

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

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

ostatic void convertStringPathIntoFilePathList(const std::string& paths, FilePathList& filepath)
convert a string containing a list of paths deliminated either with ';' (Windows) or ':' (All other platforms) into FilePath represetation

ovirtual ~Registry()

otypedef std::map<std::string,osg::ref_ptr<DotOsgWrapper> > DotOsgWrapperMap

otypedef std::vector<osg::ref_ptr<ReaderWriter> > ReaderWriterList

otypedef std::vector<osg::ref_ptr<DynamicLibrary> > DynamicLibraryList

otypedef std::map<std::string,std::string> ExtensionAliasMap

o 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

oDynamicLibraryList::iterator getLibraryItr(const std::string& fileName)
get the attached library with specified name

oDynamicLibrary* getLibrary(const std::string& fileName)

obool _createNodeFromImage

oosg::Object* readObject(DotOsgWrapperMap& dowMap, Input& fr)

ovoid eraseWrapper(DotOsgWrapperMap& wrappermap, DotOsgWrapper* wrapper)

oDotOsgWrapperMap _objectWrapperMap

oDotOsgWrapperMap _imageWrapperMap

oDotOsgWrapperMap _drawableWrapperMap

oDotOsgWrapperMap _stateAttrWrapperMap

oDotOsgWrapperMap _nodeWrapperMap

oDotOsgWrapperMap _classNameWrapperMap

oReaderWriterList _rwList

oDynamicLibraryList _dlList

obool _openingLibrary

oExtensionAliasMap _extAliasMap

oosg::ref_ptr<ReaderWriter::Options> _options

oFilePathList _dataFilePath

oFilePathList _libraryFilePath


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.