OpenSceneGraph  3.5.1
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osgDB::OutputStream Class Reference

Public Types

enum  WriteType { WRITE_UNKNOWN = 0, WRITE_SCENE, WRITE_IMAGE, WRITE_OBJECT }
 
enum  WriteImageHint {
  WRITE_USE_IMAGE_HINT = 0, WRITE_USE_EXTERNAL, WRITE_INLINE_DATA, WRITE_INLINE_FILE,
  WRITE_EXTERNAL_FILE
}
 
typedef std::map< const osg::Array *, unsigned int > ArrayMap
 
typedef std::map< const osg::Object *, unsigned int > ObjectMap
 

Public Member Functions

 OutputStream (const osgDB::Options *options)
 
virtual ~OutputStream ()
 
void setFileVersion (const std::string &d, int v)
 
int getFileVersion (const std::string &d=std::string()) const
 
bool isBinary () const
 
const std::string & getSchemaName () const
 
const osgDB::OptionsgetOptions () const
 
void setWriteImageHint (WriteImageHint hint)
 
WriteImageHint getWriteImageHint () const
 
OutputStreamoperator<< (bool b)
 
OutputStreamoperator<< (char c)
 
OutputStreamoperator<< (signed char c)
 
OutputStreamoperator<< (unsigned char c)
 
OutputStreamoperator<< (short s)
 
OutputStreamoperator<< (unsigned short s)
 
OutputStreamoperator<< (int i)
 
OutputStreamoperator<< (unsigned int i)
 
OutputStreamoperator<< (long l)
 
OutputStreamoperator<< (unsigned long l)
 
OutputStreamoperator<< (float f)
 
OutputStreamoperator<< (double d)
 
OutputStreamoperator<< (const std::string &s)
 
OutputStreamoperator<< (const char *s)
 
OutputStreamoperator<< (std::ostream &(*fn)(std::ostream &))
 
OutputStreamoperator<< (std::ios_base &(*fn)(std::ios_base &))
 
OutputStreamoperator<< (const ObjectGLenum &value)
 
OutputStreamoperator<< (const ObjectProperty &prop)
 
OutputStreamoperator<< (const ObjectMark &mark)
 
OutputStreamoperator<< (const osg::Vec2b &v)
 
OutputStreamoperator<< (const osg::Vec3b &v)
 
OutputStreamoperator<< (const osg::Vec4b &v)
 
OutputStreamoperator<< (const osg::Vec2ub &v)
 
OutputStreamoperator<< (const osg::Vec3ub &v)
 
OutputStreamoperator<< (const osg::Vec4ub &v)
 
OutputStreamoperator<< (const osg::Vec2s &v)
 
OutputStreamoperator<< (const osg::Vec3s &v)
 
OutputStreamoperator<< (const osg::Vec4s &v)
 
OutputStreamoperator<< (const osg::Vec2us &v)
 
OutputStreamoperator<< (const osg::Vec3us &v)
 
OutputStreamoperator<< (const osg::Vec4us &v)
 
OutputStreamoperator<< (const osg::Vec2i &v)
 
OutputStreamoperator<< (const osg::Vec3i &v)
 
OutputStreamoperator<< (const osg::Vec4i &v)
 
OutputStreamoperator<< (const osg::Vec2ui &v)
 
OutputStreamoperator<< (const osg::Vec3ui &v)
 
OutputStreamoperator<< (const osg::Vec4ui &v)
 
OutputStreamoperator<< (const osg::Vec2f &v)
 
OutputStreamoperator<< (const osg::Vec3f &v)
 
OutputStreamoperator<< (const osg::Vec4f &v)
 
OutputStreamoperator<< (const osg::Vec2d &v)
 
OutputStreamoperator<< (const osg::Vec3d &v)
 
OutputStreamoperator<< (const osg::Vec4d &v)
 
OutputStreamoperator<< (const osg::Quat &q)
 
OutputStreamoperator<< (const osg::Plane &p)
 
OutputStreamoperator<< (const osg::Matrixf &mat)
 
OutputStreamoperator<< (const osg::Matrixd &mat)
 
OutputStreamoperator<< (const osg::BoundingBoxf &bb)
 
OutputStreamoperator<< (const osg::BoundingBoxd &bb)
 
OutputStreamoperator<< (const osg::BoundingSpheref &bb)
 
OutputStreamoperator<< (const osg::BoundingSphered &bb)
 
OutputStreamoperator<< (const osg::Image *img)
 
OutputStreamoperator<< (const osg::Array *a)
 
OutputStreamoperator<< (const osg::PrimitiveSet *p)
 
OutputStreamoperator<< (const osg::Object *obj)
 
OutputStreamoperator<< (const osg::ref_ptr< osg::Image > &ptr)
 
OutputStreamoperator<< (const osg::ref_ptr< osg::Array > &ptr)
 
OutputStreamoperator<< (const osg::ref_ptr< osg::PrimitiveSet > &ptr)
 
template<typename T >
OutputStreamoperator<< (const osg::ref_ptr< T > &ptr)
 
void writeWrappedString (const std::string &str)
 
void writeCharArray (const char *s, unsigned int size)
 
template<typename T >
void writeSize (T size)
 
void writeArray (const osg::Array *a)
 
void writePrimitiveSet (const osg::PrimitiveSet *p)
 
void writeImage (const osg::Image *img)
 
void writeObject (const osg::Object *obj)
 
void writeObjectFields (const osg::Object *obj)
 
void writeObjectFields (const osg::Object *obj, const std::string &compoundName)
 
void setOutputIterator (OutputIterator *oi)
 set an output iterator, used directly when not using OutputStream with a traditional file releated stream. More...
 
void start (OutputIterator *outIterator, WriteType type)
 start writing to OutputStream treating it as a traditional file releated stream, handles headers and versioning More...
 
void compress (std::ostream *ostream)
 
void writeSchema (std::ostream &fout)
 
void throwException (const std::string &msg)
 
const OutputExceptiongetException () const
 

Public Attributes

ObjectProperty PROPERTY
 
ObjectMark BEGIN_BRACKET
 
ObjectMark END_BRACKET
 

Protected Types

typedef std::map< std::string, int > VersionMap
 
typedef std::map< std::string, std::string > SchemaMap
 

Protected Member Functions

template<typename T >
void writeArrayImplementation (const T *, int write_size, unsigned int numInRow=1)
 
unsigned int findOrCreateArrayID (const osg::Array *array, bool &newID)
 
unsigned int findOrCreateObjectID (const osg::Object *obj, bool &newID)
 

Protected Attributes

ArrayMap _arrayMap
 
ObjectMap _objectMap
 
VersionMap _domainVersionMap
 
WriteImageHint _writeImageHint
 
bool _useSchemaData
 
bool _useRobustBinaryFormat
 
SchemaMap _inbuiltSchemaMap
 
std::vector< std::string > _fields
 
std::string _schemaName
 
std::string _compressorName
 
std::stringstream _compressSource
 
osg::ref_ptr< OutputIterator_out
 
osg::ref_ptr< OutputException_exception
 
osg::ref_ptr< const osgDB::Options_options
 

Member Typedef Documentation

typedef std::map<const osg::Array*, unsigned int> osgDB::OutputStream::ArrayMap
typedef std::map<const osg::Object*, unsigned int> osgDB::OutputStream::ObjectMap
typedef std::map<std::string, std::string> osgDB::OutputStream::SchemaMap
protected
typedef std::map<std::string, int> osgDB::OutputStream::VersionMap
protected

Member Enumeration Documentation

Enumerator
WRITE_USE_IMAGE_HINT 

Use image hint, write inline data or use external

WRITE_USE_EXTERNAL 

Use external file on disk and write only the filename

WRITE_INLINE_DATA 

Write Image::data() to stream

WRITE_INLINE_FILE 

Write the image file itself to stream

WRITE_EXTERNAL_FILE 

Write Image::data() to disk and use it as external file

Enumerator
WRITE_UNKNOWN 
WRITE_SCENE 
WRITE_IMAGE 
WRITE_OBJECT 

Constructor & Destructor Documentation

osgDB::OutputStream::OutputStream ( const osgDB::Options options)
virtual osgDB::OutputStream::~OutputStream ( )
virtual

Member Function Documentation

void osgDB::OutputStream::compress ( std::ostream *  ostream)
unsigned int osgDB::OutputStream::findOrCreateArrayID ( const osg::Array array,
bool &  newID 
)
protected
unsigned int osgDB::OutputStream::findOrCreateObjectID ( const osg::Object obj,
bool &  newID 
)
protected
const OutputException* osgDB::OutputStream::getException ( ) const
inline
int osgDB::OutputStream::getFileVersion ( const std::string &  d = std::string()) const
const osgDB::Options* osgDB::OutputStream::getOptions ( ) const
inline
const std::string& osgDB::OutputStream::getSchemaName ( ) const
inline
WriteImageHint osgDB::OutputStream::getWriteImageHint ( ) const
inline
bool osgDB::OutputStream::isBinary ( ) const
inline
OutputStream& osgDB::OutputStream::operator<< ( bool  b)
inline
OutputStream& osgDB::OutputStream::operator<< ( char  c)
inline
OutputStream& osgDB::OutputStream::operator<< ( signed char  c)
inline
OutputStream& osgDB::OutputStream::operator<< ( unsigned char  c)
inline
OutputStream& osgDB::OutputStream::operator<< ( short  s)
inline
OutputStream& osgDB::OutputStream::operator<< ( unsigned short  s)
inline
OutputStream& osgDB::OutputStream::operator<< ( int  i)
inline
OutputStream& osgDB::OutputStream::operator<< ( unsigned int  i)
inline
OutputStream& osgDB::OutputStream::operator<< ( long  l)
inline
OutputStream& osgDB::OutputStream::operator<< ( unsigned long  l)
inline
OutputStream& osgDB::OutputStream::operator<< ( float  f)
inline
OutputStream& osgDB::OutputStream::operator<< ( double  d)
inline
OutputStream& osgDB::OutputStream::operator<< ( const std::string &  s)
inline
OutputStream& osgDB::OutputStream::operator<< ( const char *  s)
inline
OutputStream& osgDB::OutputStream::operator<< ( std::ostream &(*)(std::ostream &)  fn)
inline
OutputStream& osgDB::OutputStream::operator<< ( std::ios_base &(*)(std::ios_base &)  fn)
inline
OutputStream& osgDB::OutputStream::operator<< ( const ObjectGLenum value)
inline
OutputStream& osgDB::OutputStream::operator<< ( const ObjectProperty prop)
inline
OutputStream& osgDB::OutputStream::operator<< ( const ObjectMark mark)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2b v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3b v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4b v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2ub v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3ub v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4ub v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2s v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3s v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4s v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2us v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3us v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4us v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2i v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3i v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4i v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2ui v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3ui v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4ui v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2f v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3f v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4f v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec2d v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec3d v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Vec4d v)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Quat q)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Plane p)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Matrixf mat)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Matrixd mat)
OutputStream& osgDB::OutputStream::operator<< ( const osg::BoundingBoxf bb)
OutputStream& osgDB::OutputStream::operator<< ( const osg::BoundingBoxd bb)
OutputStream& osgDB::OutputStream::operator<< ( const osg::BoundingSpheref bb)
OutputStream& osgDB::OutputStream::operator<< ( const osg::BoundingSphered bb)
OutputStream& osgDB::OutputStream::operator<< ( const osg::Image img)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::Array a)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::PrimitiveSet p)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::Object obj)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< osg::Image > &  ptr)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< osg::Array > &  ptr)
inline
OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< osg::PrimitiveSet > &  ptr)
inline
template<typename T >
OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< T > &  ptr)
inline
void osgDB::OutputStream::setFileVersion ( const std::string &  d,
int  v 
)
inline
void osgDB::OutputStream::setOutputIterator ( OutputIterator oi)
inline

set an output iterator, used directly when not using OutputStream with a traditional file releated stream.

void osgDB::OutputStream::setWriteImageHint ( WriteImageHint  hint)
inline
void osgDB::OutputStream::start ( OutputIterator outIterator,
WriteType  type 
)

start writing to OutputStream treating it as a traditional file releated stream, handles headers and versioning

void osgDB::OutputStream::throwException ( const std::string &  msg)
inline
void osgDB::OutputStream::writeArray ( const osg::Array a)
template<typename T >
void osgDB::OutputStream::writeArrayImplementation ( const T *  ,
int  write_size,
unsigned int  numInRow = 1 
)
protected
void osgDB::OutputStream::writeCharArray ( const char *  s,
unsigned int  size 
)
inline
void osgDB::OutputStream::writeImage ( const osg::Image img)
void osgDB::OutputStream::writeObject ( const osg::Object obj)
void osgDB::OutputStream::writeObjectFields ( const osg::Object obj)
void osgDB::OutputStream::writeObjectFields ( const osg::Object obj,
const std::string &  compoundName 
)
void osgDB::OutputStream::writePrimitiveSet ( const osg::PrimitiveSet p)
void osgDB::OutputStream::writeSchema ( std::ostream &  fout)
template<typename T >
void osgDB::OutputStream::writeSize ( size)
inline
void osgDB::OutputStream::writeWrappedString ( const std::string &  str)
inline

Member Data Documentation

ArrayMap osgDB::OutputStream::_arrayMap
protected
std::string osgDB::OutputStream::_compressorName
protected
std::stringstream osgDB::OutputStream::_compressSource
protected
VersionMap osgDB::OutputStream::_domainVersionMap
protected
osg::ref_ptr<OutputException> osgDB::OutputStream::_exception
protected
std::vector<std::string> osgDB::OutputStream::_fields
protected
SchemaMap osgDB::OutputStream::_inbuiltSchemaMap
protected
ObjectMap osgDB::OutputStream::_objectMap
protected
osg::ref_ptr<const osgDB::Options> osgDB::OutputStream::_options
protected
osg::ref_ptr<OutputIterator> osgDB::OutputStream::_out
protected
std::string osgDB::OutputStream::_schemaName
protected
bool osgDB::OutputStream::_useRobustBinaryFormat
protected
bool osgDB::OutputStream::_useSchemaData
protected
WriteImageHint osgDB::OutputStream::_writeImageHint
protected
ObjectMark osgDB::OutputStream::BEGIN_BRACKET
ObjectMark osgDB::OutputStream::END_BRACKET
ObjectProperty osgDB::OutputStream::PROPERTY

The documentation for this class was generated from the following file:

osg logo
Generated at Wed Nov 11 2015 22:14:55 for the OpenSceneGraph by doxygen 1.8.10.