|
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-
static Registry* instance()
-
void readCommandLine(std::vector<std::string>& commandLine)
- read the command line string list, removing any matched control sequences
-
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.
-
void addDotOsgWrapper(DotOsgWrapper* wrapper)
-
void removeDotOsgWrapper(DotOsgWrapper* wrapper)
-
void addReaderWriter(ReaderWriter* rw)
-
void removeReaderWriter(ReaderWriter* rw)
-
std::string createLibraryNameForFile(const std::string& fileName)
- create the platform specific library name associated with file
-
std::string createLibraryNameForExt(const std::string& ext)
- create the platform specific library name associated with file extension
-
std::string createLibraryNameForNodeKit(const std::string& name)
- create the platform specific library name associated with nodekit library name
-
bool loadLibrary(const std::string& fileName)
- find the library in the SG_LIBRARY_PATH and load it
-
bool closeLibrary(const std::string& fileName)
- close the attached library with specified name
-
osg::Object* readObjectOfType(const osg::Object& compObj, Input& fr)
-
osg::Object* readObject(Input& fr)
-
osg::Image* readImage(Input& fr)
-
osg::Drawable* readDrawable(Input& fr)
-
osg::StateAttribute* readStateAttribute(Input& fr)
-
osg::Node* readNode(Input& fr)
-
bool writeObject(const osg::Object& obj, Output& fw)
-
ReaderWriter::ReadResult readObject(const std::string& fileName)
-
ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName)
-
ReaderWriter::ReadResult readImage(const std::string& fileName)
-
ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName)
-
ReaderWriter::ReadResult readNode(const std::string& fileName)
-
ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName)
-
void setCreateNodeFromImage(bool flag)
-
bool getCreateNodeFromImage() const
-
void setOptions(ReaderWriter::Options* opt)
-
ReaderWriter::Options* getOptions()
-
const ReaderWriter::Options* getOptions() const
-
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
-
void initDataFilePathList()
- initilize the Data FilePath by reading the OSG_FILE_PATH environmental variable
-
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
-
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
-
FilePathList& getDataFilePathList()
- get the data file path which is used when search for data files
-
const FilePathList& getDataFilePathList() const
- get the const data file path which is used when search for data files
-
void initLibraryFilePathList()
- initilize the Library FilePath by reading the OSG_LIBRARY_PATH and the appropriate system environmental variables
-
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
-
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
-
FilePathList& getLibraryFilePathList()
- get the library file path which is used when search for library (dso/dll's) files
-
const FilePathList& getLibraryFilePathList() const
- get the const library file path which is used when search for library (dso/dll's) files
-
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-
bool _createNodeFromImage
-
DotOsgWrapperMap _objectWrapperMap
-
DotOsgWrapperMap _imageWrapperMap
-
DotOsgWrapperMap _drawableWrapperMap
-
DotOsgWrapperMap _stateAttrWrapperMap
-
DotOsgWrapperMap _nodeWrapperMap
-
DotOsgWrapperMap _classNameWrapperMap
-
ReaderWriterList _rwList
-
DynamicLibraryList _dlList
-
bool _openingLibrary
-
ExtensionAliasMap _extAliasMap
-
osg::ref_ptr<ReaderWriter::Options> _options
-
FilePathList _dataFilePath
-
FilePathList _libraryFilePath
Protected Methods-
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
-
DynamicLibraryList::iterator getLibraryItr(const std::string& fileName)
- get the attached library with specified name
-
DynamicLibrary* getLibrary(const std::string& fileName)
-
osg::Object* readObject(DotOsgWrapperMap& dowMap, Input& fr)
-
void eraseWrapper(DotOsgWrapperMap& wrappermap, DotOsgWrapper* wrapper)
Protected Members-
typedef std::map<std::string,osg::ref_ptr<DotOsgWrapper> > DotOsgWrapperMap
-
typedef std::vector<osg::ref_ptr<ReaderWriter> > ReaderWriterList
-
typedef std::vector<osg::ref_ptr<DynamicLibrary> > DynamicLibraryList
-
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.
- static Registry* instance()
- void readCommandLine(std::vector<std::string>& commandLine)
- read the command line string list, removing any matched control sequences
- 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.
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 addDotOsgWrapper(DotOsgWrapper* wrapper)
- void removeDotOsgWrapper(DotOsgWrapper* wrapper)
- void addReaderWriter(ReaderWriter* rw)
- void removeReaderWriter(ReaderWriter* rw)
- std::string createLibraryNameForFile(const std::string& fileName)
- create the platform specific library name associated with file
- std::string createLibraryNameForExt(const std::string& ext)
- create the platform specific library name associated with file extension
- std::string createLibraryNameForNodeKit(const std::string& name)
- create the platform specific library name associated with nodekit library name
- bool loadLibrary(const std::string& fileName)
- find the library in the SG_LIBRARY_PATH and load it
- bool closeLibrary(const std::string& fileName)
- close the attached library with specified name
- osg::Object* readObjectOfType(const osg::Object& compObj, Input& fr)
- osg::Object* readObject(Input& fr)
- osg::Image* readImage(Input& fr)
- osg::Drawable* readDrawable(Input& fr)
- osg::StateAttribute* readStateAttribute(Input& fr)
- osg::Node* readNode(Input& fr)
- bool writeObject(const osg::Object& obj, Output& fw)
- ReaderWriter::ReadResult readObject(const std::string& fileName)
- ReaderWriter::WriteResult writeObject(const osg::Object& obj, const std::string& fileName)
- ReaderWriter::ReadResult readImage(const std::string& fileName)
- ReaderWriter::WriteResult writeImage(const osg::Image& obj, const std::string& fileName)
- ReaderWriter::ReadResult readNode(const std::string& fileName)
- ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& fileName)
- void setCreateNodeFromImage(bool flag)
- bool getCreateNodeFromImage() const
- void setOptions(ReaderWriter::Options* opt)
- ReaderWriter::Options* getOptions()
- const ReaderWriter::Options* getOptions() const
- 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
- void initDataFilePathList()
- initilize the Data FilePath by reading the OSG_FILE_PATH environmental variable
- 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
- 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
- FilePathList& getDataFilePathList()
- get the data file path which is used when search for data files
- const FilePathList& getDataFilePathList() const
- get the const data file path which is used when search for data files
- void initLibraryFilePathList()
- initilize the Library FilePath by reading the OSG_LIBRARY_PATH
and the appropriate system environmental variables
- 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
- 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
- FilePathList& getLibraryFilePathList()
- get the library file path which is used when search for library (dso/dll's) files
- const FilePathList& getLibraryFilePathList() const
- get the const library file path which is used when search for library (dso/dll's) files
- 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
- virtual ~Registry()
- typedef std::map<std::string,osg::ref_ptr<DotOsgWrapper> > DotOsgWrapperMap
- typedef std::vector<osg::ref_ptr<ReaderWriter> > ReaderWriterList
- typedef std::vector<osg::ref_ptr<DynamicLibrary> > DynamicLibraryList
- typedef std::map<std::string,std::string> ExtensionAliasMap
- 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
- DynamicLibraryList::iterator getLibraryItr(const std::string& fileName)
- get the attached library with specified name
- DynamicLibrary* getLibrary(const std::string& fileName)
- bool _createNodeFromImage
- osg::Object* readObject(DotOsgWrapperMap& dowMap, Input& fr)
- void eraseWrapper(DotOsgWrapperMap& wrappermap, DotOsgWrapper* wrapper)
- DotOsgWrapperMap _objectWrapperMap
- DotOsgWrapperMap _imageWrapperMap
- DotOsgWrapperMap _drawableWrapperMap
- DotOsgWrapperMap _stateAttrWrapperMap
- DotOsgWrapperMap _nodeWrapperMap
- DotOsgWrapperMap _classNameWrapperMap
- ReaderWriterList _rwList
- DynamicLibraryList _dlList
- bool _openingLibrary
- ExtensionAliasMap _extAliasMap
- osg::ref_ptr<ReaderWriter::Options> _options
- FilePathList _dataFilePath
- FilePathList _libraryFilePath
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.
|