ReaderWriter
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGDB_READERWRITER
#define OSGDB_READERWRITER 1
#include <osg/Image>
#include <osg/Shape>
#include <osg/Node>
#include <osg/ScriptEngine>
#include <osgDB/AuthenticationMap>
#include <deque>
#include <list>
#include <iosfwd>
namespace osgDB {
class Archive;
typedef std::deque<std::string> FilePathList;
// forward declare
class Options;
class OSGDB_EXPORT ReaderWriter : public osg::Object
{
public:
ReaderWriter():
osg::Object(true) {}
ReaderWriter(const ReaderWriter& rw,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(rw,copyop) {}
virtual ~ReaderWriter();
META_Object(osgDB,ReaderWriter);
typedef std::map<std::string, std::string> FormatDescriptionMap;
typedef std::list<std::string> FeatureList;
virtual const FormatDescriptionMap& supportedProtocols() const { return _supportedProtocols; }
virtual const FormatDescriptionMap& supportedExtensions() const { return _supportedExtensions; }
virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; }
virtual bool acceptsExtension(const std::string& /*extension*/) const;
virtual bool acceptsProtocol(const std::string& protocol) const;
enum Features
{
FEATURE_NONE = 0,
FEATURE_READ_OBJECT = 1<<0,
FEATURE_READ_IMAGE = 1<<1,
FEATURE_READ_HEIGHT_FIELD = 1<<2,
FEATURE_READ_NODE = 1<<3,
FEATURE_READ_SHADER = 1<<4,
FEATURE_WRITE_OBJECT = 1<<5,
FEATURE_WRITE_IMAGE = 1<<6,
FEATURE_WRITE_HEIGHT_FIELD = 1<<7,
FEATURE_WRITE_NODE = 1<<8,
FEATURE_WRITE_SHADER = 1<<9,
FEATURE_READ_SCRIPT = 1<<10,
FEATURE_WRITE_SCRIPT = 1<<11,
FEATURE_ALL = FEATURE_READ_OBJECT |
FEATURE_READ_IMAGE |
FEATURE_READ_HEIGHT_FIELD |
FEATURE_READ_NODE |
FEATURE_READ_SHADER |
FEATURE_READ_SCRIPT |
FEATURE_WRITE_OBJECT |
FEATURE_WRITE_IMAGE |
FEATURE_WRITE_HEIGHT_FIELD |
FEATURE_WRITE_NODE |
FEATURE_WRITE_SHADER |
FEATURE_WRITE_SCRIPT
};
virtual Features supportedFeatures() const;
static FeatureList featureAsString(Features feature);
class OSGDB_EXPORT ReadResult
{
public:
enum ReadStatus
{
NOT_IMPLEMENTED,
FILE_NOT_HANDLED,
FILE_NOT_FOUND,
ERROR_IN_READING_FILE,
FILE_LOADED,
FILE_LOADED_FROM_CACHE,
FILE_REQUESTED,
INSUFFICIENT_MEMORY_TO_LOAD
};
ReadResult(ReadStatus status=FILE_NOT_HANDLED):_status(status) {}
ReadResult(const std::string& m):_status(ERROR_IN_READING_FILE),_message(m) {}
ReadResult(osg::Object* obj, ReadStatus status=FILE_LOADED):_status(status),_object(obj) {}
template<class T>
ReadResult(const osg::ref_ptr<T>& obj, ReadStatus status=FILE_LOADED):_status(status),_object(obj.get()) {}
ReadResult(const ReadResult& rr):_status(rr._status),_message(rr._message),_object(rr._object) {}
ReadResult& operator = (const ReadResult& rr) { if (this==&rr) return *this; _status=rr._status; _message=rr._message;_object=rr._object; return *this; }
bool operator < (const ReadResult& rhs) const { return _status < rhs._status; }
osg::Object* getObject();
osg::Image* getImage();
osg::HeightField* getHeightField();
osg::Node* getNode();
osgDB::Archive* getArchive();
osg::Shader* getShader();
osg::Script* getScript();
bool validObject() { return _object.valid(); }
bool validImage() { return getImage()!=0; }
bool validHeightField() { return getHeightField()!=0; }
bool validNode() { return getNode()!=0; }
bool validArchive() { return getArchive()!=0; }
bool validShader() { return getShader()!=0; }
bool validScript() { return getScript()!=0; }
osg::Object* takeObject();
osg::Image* takeImage();
osg::HeightField* takeHeightField();
osg::Node* takeNode();
osgDB::Archive* takeArchive();
osg::Shader* takeShader();
osg::Script* takeScript();
std::string& message() { return _message; }
const std::string& message() const { return _message; }
std::string statusMessage() const;
ReadStatus status() const { return _status; }
bool success() const { return _status==FILE_LOADED || _status==FILE_LOADED_FROM_CACHE ; }
bool loadedFromCache() const { return _status==FILE_LOADED_FROM_CACHE; }
bool error() const { return _status==ERROR_IN_READING_FILE; }
bool notHandled() const { return _status==FILE_NOT_HANDLED || _status==NOT_IMPLEMENTED; }
bool notFound() const { return _status==FILE_NOT_FOUND; }
bool notEnoughMemory() const { return _status==INSUFFICIENT_MEMORY_TO_LOAD; }
protected:
ReadStatus _status;
std::string _message;
osg::ref_ptr<osg::Object> _object;
};
class WriteResult
{
public:
enum WriteStatus
{
NOT_IMPLEMENTED,
FILE_NOT_HANDLED,
ERROR_IN_WRITING_FILE,
FILE_SAVED
};
WriteResult(WriteStatus status=FILE_NOT_HANDLED):_status(status) {}
WriteResult(const std::string& m):_status(ERROR_IN_WRITING_FILE),_message(m) {}
WriteResult(const WriteResult& rr):_status(rr._status),_message(rr._message) {}
WriteResult& operator = (const WriteResult& rr) { if (this==&rr) return *this; _status=rr._status; _message=rr._message; return *this; }
bool operator < (const WriteResult& rhs) const { return _status < rhs._status; }
std::string& message() { return _message; }
const std::string& message() const { return _message; }
std::string statusMessage() const;
WriteStatus status() const { return _status; }
bool success() const { return _status==FILE_SAVED; }
bool error() const { return _status==ERROR_IN_WRITING_FILE; }
bool notHandled() const { return _status==FILE_NOT_HANDLED || _status==NOT_IMPLEMENTED; }
protected:
WriteStatus _status;
std::string _message;
};
enum ArchiveStatus
{
READ,
WRITE,
CREATE
};
typedef osgDB::Options Options;
virtual bool fileExists(const std::string& filename, const Options* options) const;
virtual ReadResult openArchive(const std::string& /*fileName*/,ArchiveStatus, unsigned int =4096, const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult openArchive(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readObject(const std::string& /*fileName*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readImage(const std::string& /*fileName*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readHeightField(const std::string& /*fileName*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readNode(const std::string& /*fileName*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readShader(const std::string& /*fileName*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readScript(const std::string& /*fileName*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual WriteResult writeObject(const osg::Object& /*obj*/,const std::string& /*fileName*/,const Options* =NULL) const {return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeImage(const osg::Image& /*image*/,const std::string& /*fileName*/,const Options* =NULL) const {return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeHeightField(const osg::HeightField& /*heightField*/,const std::string& /*fileName*/,const Options* =NULL) const {return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeNode(const osg::Node& /*node*/,const std::string& /*fileName*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeShader(const osg::Shader& /*shader*/,const std::string& /*fileName*/,const Options* =NULL) const {return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeScript(const osg::Script& /*script*/,const std::string& /*fileName*/,const Options* =NULL) const {return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual ReadResult readObject(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readImage(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readHeightField(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readNode(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readShader(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual ReadResult readScript(std::istream& /*fin*/,const Options* =NULL) const { return ReadResult(ReadResult::NOT_IMPLEMENTED); }
virtual WriteResult writeObject(const osg::Object& /*obj*/,std::ostream& /*fout*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeImage(const osg::Image& /*image*/,std::ostream& /*fout*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeHeightField(const osg::HeightField& /*heightField*/,std::ostream& /*fout*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeNode(const osg::Node& /*node*/,std::ostream& /*fout*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeShader(const osg::Shader& /*shader*/,std::ostream& /*fout*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
virtual WriteResult writeScript(const osg::Script& /*script*/,std::ostream& /*fout*/,const Options* =NULL) const { return WriteResult(WriteResult::NOT_IMPLEMENTED); }
void supportsProtocol(const std::string& fmt, const std::string& description);
void supportsExtension(const std::string& ext, const std::string& description);
void supportsOption(const std::string& opt, const std::string& description);
protected:
FormatDescriptionMap _supportedProtocols;
FormatDescriptionMap _supportedExtensions;
FormatDescriptionMap _supportedOptions;
};
}
#endif // OSGDB_READERWRITER
AuthenticationMap
Image
Node
Shape
osgDB::Archive
Definition Archive:29
osgDB::Options
Definition Options:30
osgDB::ReaderWriter::ReadResult
Definition ReaderWriter:109
osgDB::ReaderWriter::ReadResult::takeScript
osg::Script * takeScript()
osgDB::ReaderWriter::ReadResult::validScript
bool validScript()
Definition ReaderWriter:151
osgDB::ReaderWriter::ReadResult::takeHeightField
osg::HeightField * takeHeightField()
osgDB::ReaderWriter::ReadResult::getScript
osg::Script * getScript()
osgDB::ReaderWriter::ReadResult::notFound
bool notFound() const
Definition ReaderWriter:172
osgDB::ReaderWriter::ReadResult::ReadResult
ReadResult(osg::Object *obj, ReadStatus status=FILE_LOADED)
Definition ReaderWriter:127
osgDB::ReaderWriter::ReadResult::notHandled
bool notHandled() const
Definition ReaderWriter:171
osgDB::ReaderWriter::ReadResult::loadedFromCache
bool loadedFromCache() const
Definition ReaderWriter:169
osgDB::ReaderWriter::ReadResult::notEnoughMemory
bool notEnoughMemory() const
Definition ReaderWriter:173
osgDB::ReaderWriter::ReadResult::validHeightField
bool validHeightField()
Definition ReaderWriter:147
osgDB::ReaderWriter::ReadResult::ReadResult
ReadResult(const ReadResult &rr)
Definition ReaderWriter:132
osgDB::ReaderWriter::ReadResult::ReadResult
ReadResult(const std::string &m)
Definition ReaderWriter:125
osgDB::ReaderWriter::ReadResult::status
ReadStatus status() const
Definition ReaderWriter:167
osgDB::ReaderWriter::ReadResult::message
const std::string & message() const
Definition ReaderWriter:162
osgDB::ReaderWriter::ReadResult::takeNode
osg::Node * takeNode()
osgDB::ReaderWriter::ReadResult::getImage
osg::Image * getImage()
osgDB::ReaderWriter::ReadResult::validArchive
bool validArchive()
Definition ReaderWriter:149
osgDB::ReaderWriter::ReadResult::ReadResult
ReadResult(const osg::ref_ptr< T > &obj, ReadStatus status=FILE_LOADED)
Definition ReaderWriter:130
osgDB::ReaderWriter::ReadResult::getArchive
osgDB::Archive * getArchive()
osgDB::ReaderWriter::ReadResult::validShader
bool validShader()
Definition ReaderWriter:150
osgDB::ReaderWriter::ReadResult::_message
std::string _message
Definition ReaderWriter:178
osgDB::ReaderWriter::ReadResult::validImage
bool validImage()
Definition ReaderWriter:146
osgDB::ReaderWriter::ReadResult::getHeightField
osg::HeightField * getHeightField()
osgDB::ReaderWriter::ReadResult::statusMessage
std::string statusMessage() const
report the ReadResult's status, and message (if any). Useful for reporting of errors to users.
osgDB::ReaderWriter::ReadResult::message
std::string & message()
Definition ReaderWriter:161
osgDB::ReaderWriter::ReadResult::ReadStatus
ReadStatus
Definition ReaderWriter:113
osgDB::ReaderWriter::ReadResult::FILE_LOADED_FROM_CACHE
@ FILE_LOADED_FROM_CACHE
File found in cache and returned.
Definition ReaderWriter:119
osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED
@ FILE_NOT_HANDLED
File is not appropriate for this file reader, due to some incompatibility, but not a read error.
Definition ReaderWriter:115
osgDB::ReaderWriter::ReadResult::FILE_LOADED
@ FILE_LOADED
File successfully found, loaded, and converted into osg.
Definition ReaderWriter:118
osgDB::ReaderWriter::ReadResult::INSUFFICIENT_MEMORY_TO_LOAD
@ INSUFFICIENT_MEMORY_TO_LOAD
File found but not loaded because estimated required memory surpasses available memory.
Definition ReaderWriter:121
osgDB::ReaderWriter::ReadResult::NOT_IMPLEMENTED
@ NOT_IMPLEMENTED
read*() method not implemented in concrete ReaderWriter.
Definition ReaderWriter:114
osgDB::ReaderWriter::ReadResult::FILE_NOT_FOUND
@ FILE_NOT_FOUND
File could not be found or could not be read.
Definition ReaderWriter:116
osgDB::ReaderWriter::ReadResult::ERROR_IN_READING_FILE
@ ERROR_IN_READING_FILE
File found, loaded, but an error was encountered during processing.
Definition ReaderWriter:117
osgDB::ReaderWriter::ReadResult::FILE_REQUESTED
@ FILE_REQUESTED
Asynchronous file read has been requested, but returning immediately, keep polling plugin until file ...
Definition ReaderWriter:120
osgDB::ReaderWriter::ReadResult::takeArchive
osgDB::Archive * takeArchive()
osgDB::ReaderWriter::ReadResult::error
bool error() const
Definition ReaderWriter:170
osgDB::ReaderWriter::ReadResult::validNode
bool validNode()
Definition ReaderWriter:148
osgDB::ReaderWriter::ReadResult::getObject
osg::Object * getObject()
osgDB::ReaderWriter::ReadResult::getShader
osg::Shader * getShader()
osgDB::ReaderWriter::ReadResult::success
bool success() const
Definition ReaderWriter:168
osgDB::ReaderWriter::ReadResult::takeImage
osg::Image * takeImage()
osgDB::ReaderWriter::ReadResult::takeObject
osg::Object * takeObject()
osgDB::ReaderWriter::ReadResult::_status
ReadStatus _status
Definition ReaderWriter:177
osgDB::ReaderWriter::ReadResult::ReadResult
ReadResult(ReadStatus status=FILE_NOT_HANDLED)
Definition ReaderWriter:124
osgDB::ReaderWriter::ReadResult::_object
osg::ref_ptr< osg::Object > _object
Definition ReaderWriter:179
osgDB::ReaderWriter::ReadResult::validObject
bool validObject()
Definition ReaderWriter:145
osgDB::ReaderWriter::ReadResult::takeShader
osg::Shader * takeShader()
osgDB::ReaderWriter::ReadResult::getNode
osg::Node * getNode()
osgDB::ReaderWriter::WriteResult
Definition ReaderWriter:184
osgDB::ReaderWriter::WriteResult::message
std::string & message()
Definition ReaderWriter:203
osgDB::ReaderWriter::WriteResult::WriteStatus
WriteStatus
Definition ReaderWriter:188
osgDB::ReaderWriter::WriteResult::FILE_SAVED
@ FILE_SAVED
Definition ReaderWriter:192
osgDB::ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE
@ ERROR_IN_WRITING_FILE
Definition ReaderWriter:191
osgDB::ReaderWriter::WriteResult::FILE_NOT_HANDLED
@ FILE_NOT_HANDLED
Definition ReaderWriter:190
osgDB::ReaderWriter::WriteResult::NOT_IMPLEMENTED
@ NOT_IMPLEMENTED
write*() method not implemented in concrete ReaderWriter.
Definition ReaderWriter:189
osgDB::ReaderWriter::WriteResult::WriteResult
WriteResult(const WriteResult &rr)
Definition ReaderWriter:198
osgDB::ReaderWriter::WriteResult::status
WriteStatus status() const
Definition ReaderWriter:209
osgDB::ReaderWriter::WriteResult::_status
WriteStatus _status
Definition ReaderWriter:216
osgDB::ReaderWriter::WriteResult::success
bool success() const
Definition ReaderWriter:210
osgDB::ReaderWriter::WriteResult::WriteResult
WriteResult(WriteStatus status=FILE_NOT_HANDLED)
Definition ReaderWriter:195
osgDB::ReaderWriter::WriteResult::statusMessage
std::string statusMessage() const
Report the WriteResult's status, and message (if any). Useful for reporting of errors to users.
osgDB::ReaderWriter::WriteResult::message
const std::string & message() const
Definition ReaderWriter:204
osgDB::ReaderWriter::WriteResult::_message
std::string _message
Definition ReaderWriter:217
osgDB::ReaderWriter::WriteResult::notHandled
bool notHandled() const
Definition ReaderWriter:212
osgDB::ReaderWriter::WriteResult::WriteResult
WriteResult(const std::string &m)
Definition ReaderWriter:196
osgDB::ReaderWriter::WriteResult::error
bool error() const
Definition ReaderWriter:211
osgDB::ReaderWriter::writeHeightField
virtual WriteResult writeHeightField(const osg::HeightField &, std::ostream &, const Options *=NULL) const
Definition ReaderWriter:262
osgDB::ReaderWriter::supportedProtocols
virtual const FormatDescriptionMap & supportedProtocols() const
Definition ReaderWriter:58
osgDB::ReaderWriter::featureAsString
static FeatureList featureAsString(Features feature)
osgDB::ReaderWriter::_supportedOptions
FormatDescriptionMap _supportedOptions
Definition ReaderWriter:289
osgDB::ReaderWriter::Options
osgDB::Options Options
Definition ReaderWriter:227
osgDB::ReaderWriter::~ReaderWriter
virtual ~ReaderWriter()
osgDB::ReaderWriter::readImage
virtual ReadResult readImage(const std::string &, const Options *=NULL) const
Definition ReaderWriter:240
osgDB::ReaderWriter::FormatDescriptionMap
std::map< std::string, std::string > FormatDescriptionMap
Definition ReaderWriter:54
osgDB::ReaderWriter::readNode
virtual ReadResult readNode(std::istream &, const Options *=NULL) const
Definition ReaderWriter:256
osgDB::ReaderWriter::writeImage
virtual WriteResult writeImage(const osg::Image &, const std::string &, const Options *=NULL) const
Definition ReaderWriter:247
osgDB::ReaderWriter::supportsExtension
void supportsExtension(const std::string &ext, const std::string &description)
osgDB::ReaderWriter::readObject
virtual ReadResult readObject(const std::string &, const Options *=NULL) const
Definition ReaderWriter:239
osgDB::ReaderWriter::readHeightField
virtual ReadResult readHeightField(const std::string &, const Options *=NULL) const
Definition ReaderWriter:241
osgDB::ReaderWriter::writeObject
virtual WriteResult writeObject(const osg::Object &, std::ostream &, const Options *=NULL) const
Definition ReaderWriter:260
osgDB::ReaderWriter::supportedExtensions
virtual const FormatDescriptionMap & supportedExtensions() const
Definition ReaderWriter:61
osgDB::ReaderWriter::writeHeightField
virtual WriteResult writeHeightField(const osg::HeightField &, const std::string &, const Options *=NULL) const
Definition ReaderWriter:248
osgDB::ReaderWriter::writeNode
virtual WriteResult writeNode(const osg::Node &, const std::string &, const Options *=NULL) const
Definition ReaderWriter:249
osgDB::ReaderWriter::readShader
virtual ReadResult readShader(const std::string &, const Options *=NULL) const
Definition ReaderWriter:243
osgDB::ReaderWriter::ArchiveStatus
ArchiveStatus
Definition ReaderWriter:221
osgDB::ReaderWriter::CREATE
@ CREATE
Definition ReaderWriter:224
osgDB::ReaderWriter::READ
@ READ
Definition ReaderWriter:222
osgDB::ReaderWriter::WRITE
@ WRITE
Definition ReaderWriter:223
osgDB::ReaderWriter::readScript
virtual ReadResult readScript(std::istream &, const Options *=NULL) const
Definition ReaderWriter:258
osgDB::ReaderWriter::supportedFeatures
virtual Features supportedFeatures() const
osgDB::ReaderWriter::writeShader
virtual WriteResult writeShader(const osg::Shader &, const std::string &, const Options *=NULL) const
Definition ReaderWriter:250
osgDB::ReaderWriter::ReaderWriter
ReaderWriter(const ReaderWriter &rw, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition ReaderWriter:47
osgDB::ReaderWriter::openArchive
virtual ReadResult openArchive(const std::string &, ArchiveStatus, unsigned int=4096, const Options *=NULL) const
Definition ReaderWriter:234
osgDB::ReaderWriter::writeNode
virtual WriteResult writeNode(const osg::Node &, std::ostream &, const Options *=NULL) const
Definition ReaderWriter:263
osgDB::ReaderWriter::FeatureList
std::list< std::string > FeatureList
Definition ReaderWriter:55
osgDB::ReaderWriter::writeScript
virtual WriteResult writeScript(const osg::Script &, std::ostream &, const Options *=NULL) const
Definition ReaderWriter:265
osgDB::ReaderWriter::readShader
virtual ReadResult readShader(std::istream &, const Options *=NULL) const
Definition ReaderWriter:257
osgDB::ReaderWriter::writeScript
virtual WriteResult writeScript(const osg::Script &, const std::string &, const Options *=NULL) const
Definition ReaderWriter:251
osgDB::ReaderWriter::_supportedExtensions
FormatDescriptionMap _supportedExtensions
Definition ReaderWriter:288
osgDB::ReaderWriter::writeImage
virtual WriteResult writeImage(const osg::Image &, std::ostream &, const Options *=NULL) const
Definition ReaderWriter:261
osgDB::ReaderWriter::_supportedProtocols
FormatDescriptionMap _supportedProtocols
Definition ReaderWriter:287
osgDB::ReaderWriter::readHeightField
virtual ReadResult readHeightField(std::istream &, const Options *=NULL) const
Definition ReaderWriter:255
osgDB::ReaderWriter::openArchive
virtual ReadResult openArchive(std::istream &, const Options *=NULL) const
Definition ReaderWriter:237
osgDB::ReaderWriter::readImage
virtual ReadResult readImage(std::istream &, const Options *=NULL) const
Definition ReaderWriter:254
osgDB::ReaderWriter::supportsProtocol
void supportsProtocol(const std::string &fmt, const std::string &description)
osgDB::ReaderWriter::writeObject
virtual WriteResult writeObject(const osg::Object &, const std::string &, const Options *=NULL) const
Definition ReaderWriter:246
osgDB::ReaderWriter::Features
Features
Bit mask for setting up which feature types are available for read and/or write.
Definition ReaderWriter:73
osgDB::ReaderWriter::FEATURE_NONE
@ FEATURE_NONE
Definition ReaderWriter:74
osgDB::ReaderWriter::FEATURE_WRITE_SCRIPT
@ FEATURE_WRITE_SCRIPT
Definition ReaderWriter:86
osgDB::ReaderWriter::FEATURE_WRITE_HEIGHT_FIELD
@ FEATURE_WRITE_HEIGHT_FIELD
Definition ReaderWriter:82
osgDB::ReaderWriter::FEATURE_WRITE_IMAGE
@ FEATURE_WRITE_IMAGE
Definition ReaderWriter:81
osgDB::ReaderWriter::FEATURE_READ_HEIGHT_FIELD
@ FEATURE_READ_HEIGHT_FIELD
Definition ReaderWriter:77
osgDB::ReaderWriter::FEATURE_WRITE_SHADER
@ FEATURE_WRITE_SHADER
Definition ReaderWriter:84
osgDB::ReaderWriter::FEATURE_READ_SCRIPT
@ FEATURE_READ_SCRIPT
Definition ReaderWriter:85
osgDB::ReaderWriter::FEATURE_ALL
@ FEATURE_ALL
Definition ReaderWriter:87
osgDB::ReaderWriter::FEATURE_WRITE_OBJECT
@ FEATURE_WRITE_OBJECT
Definition ReaderWriter:80
osgDB::ReaderWriter::FEATURE_READ_NODE
@ FEATURE_READ_NODE
Definition ReaderWriter:78
osgDB::ReaderWriter::FEATURE_READ_SHADER
@ FEATURE_READ_SHADER
Definition ReaderWriter:79
osgDB::ReaderWriter::FEATURE_READ_OBJECT
@ FEATURE_READ_OBJECT
Definition ReaderWriter:75
osgDB::ReaderWriter::FEATURE_READ_IMAGE
@ FEATURE_READ_IMAGE
Definition ReaderWriter:76
osgDB::ReaderWriter::FEATURE_WRITE_NODE
@ FEATURE_WRITE_NODE
Definition ReaderWriter:83
osgDB::ReaderWriter::supportsOption
void supportsOption(const std::string &opt, const std::string &description)
osgDB::ReaderWriter::acceptsExtension
virtual bool acceptsExtension(const std::string &) const
osgDB::ReaderWriter::supportedOptions
virtual const FormatDescriptionMap & supportedOptions() const
Definition ReaderWriter:64
osgDB::ReaderWriter::writeShader
virtual WriteResult writeShader(const osg::Shader &, std::ostream &, const Options *=NULL) const
Definition ReaderWriter:264
osgDB::ReaderWriter::META_Object
META_Object(osgDB, ReaderWriter)
osgDB::ReaderWriter::readScript
virtual ReadResult readScript(const std::string &, const Options *=NULL) const
Definition ReaderWriter:244
osgDB::ReaderWriter::fileExists
virtual bool fileExists(const std::string &filename, const Options *options) const
osgDB::ReaderWriter::readObject
virtual ReadResult readObject(std::istream &, const Options *=NULL) const
Definition ReaderWriter:253
osgDB::ReaderWriter::ReaderWriter
ReaderWriter()
Definition ReaderWriter:44
osgDB::ReaderWriter::readNode
virtual ReadResult readNode(const std::string &, const Options *=NULL) const
Definition ReaderWriter:242
osgDB::ReaderWriter::acceptsProtocol
virtual bool acceptsProtocol(const std::string &protocol) const
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::HeightField
Definition Shape:483
osg::Image
Definition Image:179
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::Object::Object
Object()
Definition Object:69
osg::Script
Definition osg/ScriptEngine:30
osg::Shader
Definition Shader:89
osg::ref_ptr
Definition ref_ptr:32
osgDB
Definition Archive:24
osgDB::FilePathList
std::deque< std::string > FilePathList
Definition osgDB/Callbacks:28
osg
Definition AlphaFunc:19
OSGDB_EXPORT
#define OSGDB_EXPORT
Definition osgDB/Export:39
NULL
#define NULL
Definition osg/Export:55
ScriptEngine