15#define OSGDB_READFILE 1
231#ifdef OSG_PROVIDE_READFILE
247inline osg::Object* readObjectFile(
const std::string& filename)
253inline T* readFile(
const std::string& filename,
const Options* options)
256 osg::ref_ptr<T> t =
dynamic_cast<T*
>(
object.get());
262inline T* readFile(
const std::string& filename)
275extern OSGDB_EXPORT osg::Image* readImageFile(
const std::string& filename,
const Options* options);
283inline osg::Image* readImageFile(
const std::string& filename)
295extern OSGDB_EXPORT osg::HeightField* readHeightFieldFile(
const std::string& filename,
const Options* options);
303inline osg::HeightField* readHeightFieldFile(
const std::string& filename)
315extern OSGDB_EXPORT osg::Node* readNodeFile(
const std::string& filename,
const Options* options);
323inline osg::Node* readNodeFile(
const std::string& filename)
333extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& fileList,
const Options* options);
337inline osg::Node* readNodeFiles(std::vector<std::string>& fileList)
346extern OSGDB_EXPORT osg::Node* readNodeFiles(osg::ArgumentParser& parser,
const Options* options);
350inline osg::Node* readNodeFiles(osg::ArgumentParser& parser)
362extern OSGDB_EXPORT osg::Shader* readShaderFile(
const std::string& filename,
const Options* options);
370inline osg::Shader* readShaderFile(
const std::string& filename)
384 osg::Shader* shader = readShaderFile(filename, options);
395inline osg::Shader* readShaderFile(
osg::Shader::Type type,
const std::string& filename)
406inline osg::Shader* readShaderFileWithFallback(
osg::Shader::Type type,
const std::string& filename,
const Options* options,
const char* fallback)
408 osg::Shader* shader = readShaderFile(filename, options);
410 if (!shader) shader =
new osg::Shader(type, fallback);
418inline osg::Shader* readShaderFileWithFallback(
osg::Shader::Type type,
const std::string& filename,
const char* fallback)
420 return osgDB::readShaderFileWithFallback(type, filename,
Registry::instance()->getOptions(), fallback);
430extern OSGDB_EXPORT osg::Script* readScriptFile(
const std::string& filename,
const Options* options);
438inline osg::Script* readScriptFile(
const std::string& filename)
The osgDB library provides support for reading and writing scene graphs, providing a plugin framework...
Definition Archive:24
OSGDB_EXPORT osg::ref_ptr< osg::Node > readRefNodeFile(const std::string &filename, const Options *options)
Read an osg::Node from file.
OSGDB_EXPORT osg::ref_ptr< osg::Object > readRefObjectFile(const std::string &filename, const Options *options)
Read an osg::Object from file.
OSGDB_EXPORT osg::ref_ptr< osg::Script > readRefScriptFile(const std::string &filename, const Options *options)
Read an osg::Script from file.
OSGDB_EXPORT osg::ref_ptr< osg::Shader > readRefShaderFile(const std::string &filename, const Options *options)
Read an osg::Shader from file.
OSGDB_EXPORT osg::ref_ptr< osg::Image > readRefImageFile(const std::string &filename, const Options *options)
Read an osg::Image from file.
OSGDB_EXPORT osg::ref_ptr< osg::Shader > readRefShaderFileWithFallback(osg::Shader::Type type, const std::string &filename, const Options *options, const char *fallback)
Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to ...
OSGDB_EXPORT osg::ref_ptr< osg::Node > readRefNodeFiles(std::vector< std::string > &fileList, const Options *options)
Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more than one su...
osg::ref_ptr< T > readRefFile(const std::string &filename, const Options *options)
Definition ReadFile:50
OSGDB_EXPORT osg::ref_ptr< osg::HeightField > readRefHeightFieldFile(const std::string &filename, const Options *options)
Read an osg::HeightField from file.
Definition ArgumentParser:28
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * release()
release the pointer from ownership by this ref_ptr<>, decrementing the objects refencedCount() via un...
Definition ref_ptr:126
bool valid() const
Definition ref_ptr:120
bool setType(Type t)
Set the Shader type as an enum.
@ UNDEFINED
Definition Shader:99
Options base class used for passing options into plugins to control their operation.
Definition Options:30
static Registry * instance(bool erase=false)
#define OSGDB_EXPORT
Definition Export:39