Refactored the Registry::ReadFileCallback, WriteFileCallback and ReaderWriter::Options to they are now defined in their own header and in the osgDB namespace.

Introduced a new FindFileCallback to Registry to compliement the existing ReadFileCallback and WriteFileCallback.

Added support for assign Find, Read and WriteFileCallbacks to osdDB::Options to enable plugins/applications to override the callbacks just for that
read/write call and any nested file operations
This commit is contained in:
Robert Osfield
2009-05-09 08:49:27 +00:00
parent a4ff2c4af7
commit b7b065abe3
43 changed files with 1180 additions and 825 deletions

View File

@@ -24,7 +24,7 @@
using namespace osg;
using namespace osgDB;
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
@@ -32,7 +32,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename, co
}
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
@@ -40,21 +40,21 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename, const
}
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const ReaderWriter::Options* options )
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options );
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;