OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osgDB::OutputStream Class Reference

#include <OutputStream.h>

Collaboration diagram for osgDB::OutputStream:
Collaboration graph
[legend]

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
 

Detailed Description

Definition at line 56 of file OutputStream.h.

Member Typedef Documentation

typedef std::map<const osg::Array*, unsigned int> osgDB::OutputStream::ArrayMap

Definition at line 59 of file OutputStream.h.

typedef std::map<const osg::Object*, unsigned int> osgDB::OutputStream::ObjectMap

Definition at line 60 of file OutputStream.h.

typedef std::map<std::string, std::string> osgDB::OutputStream::SchemaMap
protected

Definition at line 210 of file OutputStream.h.

typedef std::map<std::string, int> osgDB::OutputStream::VersionMap
protected

Definition at line 204 of file OutputStream.h.

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

Definition at line 70 of file OutputStream.h.

Enumerator
WRITE_UNKNOWN 
WRITE_SCENE 
WRITE_IMAGE 
WRITE_OBJECT 

Definition at line 62 of file OutputStream.h.

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

Definition at line 187 of file OutputStream.h.

int osgDB::OutputStream::getFileVersion ( const std::string &  d = std::string()) const

Here is the caller graph for this function:

const osgDB::Options* osgDB::OutputStream::getOptions ( ) const
inline

Definition at line 87 of file OutputStream.h.

const std::string& osgDB::OutputStream::getSchemaName ( ) const
inline

Definition at line 86 of file OutputStream.h.

WriteImageHint osgDB::OutputStream::getWriteImageHint ( ) const
inline

Definition at line 90 of file OutputStream.h.

bool osgDB::OutputStream::isBinary ( ) const
inline

Definition at line 85 of file OutputStream.h.

Here is the caller graph for this function:

OutputStream& osgDB::OutputStream::operator<< ( bool  b)
inline

Definition at line 93 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( char  c)
inline

Definition at line 94 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( signed char  c)
inline

Definition at line 95 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( unsigned char  c)
inline

Definition at line 96 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( short  s)
inline

Definition at line 97 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( unsigned short  s)
inline

Definition at line 98 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( int  i)
inline

Definition at line 99 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( unsigned int  i)
inline

Definition at line 100 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( long  l)
inline

Definition at line 101 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( unsigned long  l)
inline

Definition at line 102 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( float  f)
inline

Definition at line 103 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( double  d)
inline

Definition at line 104 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const std::string &  s)
inline

Definition at line 105 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const char *  s)
inline

Definition at line 106 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( std::ostream &(*)(std::ostream &)  fn)
inline

Definition at line 107 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( std::ios_base &(*)(std::ios_base &)  fn)
inline

Definition at line 108 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const ObjectGLenum value)
inline

Definition at line 110 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const ObjectProperty prop)
inline

Definition at line 111 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const ObjectMark mark)
inline

Definition at line 112 of file OutputStream.h.

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

Definition at line 147 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const osg::Array a)
inline

Definition at line 148 of file OutputStream.h.

Here is the call graph for this function:

OutputStream& osgDB::OutputStream::operator<< ( const osg::PrimitiveSet p)
inline

Definition at line 149 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const osg::Object obj)
inline

Definition at line 150 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< osg::Image > &  ptr)
inline

Definition at line 152 of file OutputStream.h.

OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< osg::Array > &  ptr)
inline

Definition at line 153 of file OutputStream.h.

Here is the call graph for this function:

OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< osg::PrimitiveSet > &  ptr)
inline

Definition at line 154 of file OutputStream.h.

template<typename T >
OutputStream& osgDB::OutputStream::operator<< ( const osg::ref_ptr< T > &  ptr)
inline

Definition at line 156 of file OutputStream.h.

void osgDB::OutputStream::setFileVersion ( const std::string &  d,
int  v 
)
inline

Definition at line 82 of file OutputStream.h.

void osgDB::OutputStream::setOutputIterator ( OutputIterator oi)
inline

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

Definition at line 175 of file OutputStream.h.

void osgDB::OutputStream::setWriteImageHint ( WriteImageHint  hint)
inline

Definition at line 89 of file OutputStream.h.

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

Definition at line 221 of file OutputStream.h.

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

Definition at line 160 of file OutputStream.h.

void osgDB::OutputStream::writeImage ( const osg::Image img)

Here is the caller graph for this function:

void osgDB::OutputStream::writeObject ( const osg::Object obj)

Here is the caller graph for this function:

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

Definition at line 164 of file OutputStream.h.

void osgDB::OutputStream::writeWrappedString ( const std::string &  str)
inline

Definition at line 159 of file OutputStream.h.

Here is the caller graph for this function:

Member Data Documentation

ArrayMap osgDB::OutputStream::_arrayMap
protected

Definition at line 201 of file OutputStream.h.

std::string osgDB::OutputStream::_compressorName
protected

Definition at line 214 of file OutputStream.h.

std::stringstream osgDB::OutputStream::_compressSource
protected

Definition at line 215 of file OutputStream.h.

VersionMap osgDB::OutputStream::_domainVersionMap
protected

Definition at line 205 of file OutputStream.h.

osg::ref_ptr<OutputException> osgDB::OutputStream::_exception
protected

Definition at line 217 of file OutputStream.h.

std::vector<std::string> osgDB::OutputStream::_fields
protected

Definition at line 212 of file OutputStream.h.

SchemaMap osgDB::OutputStream::_inbuiltSchemaMap
protected

Definition at line 211 of file OutputStream.h.

ObjectMap osgDB::OutputStream::_objectMap
protected

Definition at line 202 of file OutputStream.h.

osg::ref_ptr<const osgDB::Options> osgDB::OutputStream::_options
protected

Definition at line 218 of file OutputStream.h.

osg::ref_ptr<OutputIterator> osgDB::OutputStream::_out
protected

Definition at line 216 of file OutputStream.h.

std::string osgDB::OutputStream::_schemaName
protected

Definition at line 213 of file OutputStream.h.

bool osgDB::OutputStream::_useRobustBinaryFormat
protected

Definition at line 208 of file OutputStream.h.

bool osgDB::OutputStream::_useSchemaData
protected

Definition at line 207 of file OutputStream.h.

WriteImageHint osgDB::OutputStream::_writeImageHint
protected

Definition at line 206 of file OutputStream.h.

ObjectMark osgDB::OutputStream::BEGIN_BRACKET

Definition at line 191 of file OutputStream.h.

ObjectMark osgDB::OutputStream::END_BRACKET

Definition at line 192 of file OutputStream.h.

ObjectProperty osgDB::OutputStream::PROPERTY

Definition at line 190 of file OutputStream.h.


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