Added readScript/writeScript methods to ReaderWriter

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14366 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-07-14 15:59:06 +00:00
parent 5a7a20d01e
commit 50e63ad3ee
14 changed files with 314 additions and 68 deletions

View File

@@ -194,6 +194,29 @@ inline osg::Shader* readShaderFile(osg::Shader::Type type, const std::string& fi
return readShaderFile(type, filename,Registry::instance()->getOptions());
}
/** Read an osg::Script from file.
* Return valid osg::Script on success,
* return NULL on failure.
* Use the Options object to control cache operations and file search paths in osgDB::Registry.
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::Script* readScriptFile(const std::string& filename,const Options* options);
/** Read an osg::Script from file.
* Return valid osg::Script on success,
* return NULL on failure.
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::Script* readScriptFile(const std::string& filename)
{
return readScriptFile(filename,Registry::instance()->getOptions());
}
/** Read an osg::Object from file.
* Return an assigned osg::ref_ptr on success,
* return an osg::ref_ptr with a NULL pointer assigned to it on failure.
@@ -221,7 +244,7 @@ inline osg::ref_ptr<osg::Object> readRefObjectFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename,const Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename,const Options* options);
/** Read an osg::Image from file.
* Return an assigned osg::ref_ptr on success,
@@ -229,7 +252,7 @@ extern OSGDB_EXPORT osg::ref_ptr<osg::Image> readRefImageFile(const std::string
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename)
inline osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename)
{
return readRefImageFile(filename,Registry::instance()->getOptions());
}
@@ -241,7 +264,7 @@ inline osg::ref_ptr<osg::Image> readRefImageFile(const std::string& filename)
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string& filename,const Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string& filename,const Options* options);
/** Read an osg::HeightField from file.
* Return an assigned osg::ref_ptr on success,
@@ -249,7 +272,7 @@ extern OSGDB_EXPORT osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string& filename)
inline osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string& filename)
{
return readRefHeightFieldFile(filename,Registry::instance()->getOptions());
}
@@ -261,7 +284,7 @@ inline osg::ref_ptr<osg::HeightField> readRefHeightFieldFile(const std::string&
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename,const Options* options);
extern OSGDB_EXPORT osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename,const Options* options);
/** Read an osg::Node from file.
* Return an assigned osg::ref_ptr on success,
@@ -269,7 +292,7 @@ extern OSGDB_EXPORT osg::ref_ptr<osg::Node> readRefNodeFile(const std::string&
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename)
inline osg::ref_ptr<osg::Node> readRefNodeFile(const std::string& filename)
{
return readRefNodeFile(filename,Registry::instance()->getOptions());
}
@@ -289,7 +312,7 @@ extern OSGDB_EXPORT osg::ref_ptr<osg::Shader> readRefShaderFile(const std::strin
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::ref_ptr<osg::Shader> readRefShaderFile(const std::string& filename)
inline osg::ref_ptr<osg::Shader> readRefShaderFile(const std::string& filename)
{
return readRefShaderFile(filename, Registry::instance()->getOptions());
}
@@ -320,6 +343,26 @@ inline osg::ref_ptr<osg::Shader> readRefShaderFile(osg::Shader::Type type, const
}
/** Read an osg::Script from file.
* Return an assigned osg::ref_ptr on success,
* return an osg::ref_ptr with a NULL pointer assigned to it on failure.
* Use the Options object to control cache operations and file search paths in osgDB::Registry.
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
extern OSGDB_EXPORT osg::ref_ptr<osg::Script> readRefScriptFile(const std::string& filename,const Options* options);
/** Read an osg::Script from file.
* Return an assigned osg::ref_ptr on success,
* return an osg::ref_ptr with a NULL pointer assigned to it on failure.
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to read the specified file.*/
inline osg::ref_ptr<osg::Script> readRefScriptFile(const std::string& filename)
{
return readRefScriptFile(filename,Registry::instance()->getOptions());
}
}
#endif