Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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...

List of all members.

Public Methods

 ~Registry ()
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 Public Methods

Registry * instance ()
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.


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 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.


Constructor & Destructor Documentation

osgDB::Registry::~Registry (    ) 
 


Member Function Documentation

void osgDB::Registry::addDotOsgWrapper (  DotOsgWrapper *    wrapper ) 
 

void osgDB::Registry::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 osgDB::Registry::addReaderWriter (  ReaderWriter *    rw ) 
 

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

close the attached library with specified name.

void osgDB::Registry::convertStringPathIntoFilePathList (  const std::string &    paths,
FilePathList &    filepath
)  [static]
 

convert a string containing a list of paths deliminated either with ';' (Windows) or ':' (All other platforms) into FilePath represetation.

std::string osgDB::Registry::createLibraryNameForExt (  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.

bool osgDB::Registry::getCreateNodeFromImage (    )  const [inline]
 

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

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

FilePathList& osgDB::Registry::getDataFilePathList (    )  [inline]
 

get the data file path which is used when search for data 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.

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

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

const ReaderWriter::Options* osgDB::Registry::getOptions (    )  const [inline]
 

ReaderWriter::Options* osgDB::Registry::getOptions (    )  [inline]
 

void osgDB::Registry::initDataFilePathList (    ) 
 

initilize the Data FilePath by reading the OSG_FILE_PATH environmental variable.

void osgDB::Registry::initFilePathLists (    )  [inline]
 

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 osgDB::Registry::initLibraryFilePathList (    ) 
 

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

Registry* osgDB::Registry::instance (    )  [static]
 

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

find the library in the SG_LIBRARY_PATH and load it.

void osgDB::Registry::readCommandLine (  std::vector< std::string > &    commandLine ) 
 

read the command line string list, removing any matched control sequences.

osg::Drawable* osgDB::Registry::readDrawable (  Input &    fr ) 
 

ReaderWriter::ReadResult osgDB::Registry::readImage (  const std::string &    fileName ) 
 

osg::Image* osgDB::Registry::readImage (  Input &    fr ) 
 

ReaderWriter::ReadResult osgDB::Registry::readNode (  const std::string &    fileName ) 
 

osg::Node* osgDB::Registry::readNode (  Input &    fr ) 
 

ReaderWriter::ReadResult osgDB::Registry::readObject (  const std::string &    fileName ) 
 

osg::Object* osgDB::Registry::readObject (  Input &    fr ) 
 

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

osg::StateAttribute* osgDB::Registry::readStateAttribute (  Input &    fr ) 
 

void osgDB::Registry::removeDotOsgWrapper (  DotOsgWrapper *    wrapper ) 
 

void osgDB::Registry::removeReaderWriter (  ReaderWriter *    rw ) 
 

void osgDB::Registry::setCreateNodeFromImage (  bool    flag )  [inline]
 

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

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.

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::setLibraryFilePathList (  const std::string &    paths )  [inline]
 

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.

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::setOptions (  ReaderWriter::Options *    opt )  [inline]
 

ReaderWriter::WriteResult osgDB::Registry::writeImage (  const osg::Image &    obj,
const std::string &    fileName
) 
 

ReaderWriter::WriteResult osgDB::Registry::writeNode (  const osg::Node &    node,
const std::string &    fileName
) 
 

ReaderWriter::WriteResult osgDB::Registry::writeObject (  const osg::Object &    obj,
const std::string &    fileName
) 
 

bool osgDB::Registry::writeObject (  const osg::Object &    obj,
Output &    fw
) 
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:48 2002 for the Open Scene Graph by doxygen 1.2.16.