Open Inventor Reference
SoByteStream Class Reference

Converts scene graph objects to character byte streams. More...

#include <Inventor/misc/SoByteStream.h>

List of all members.

Public Member Functions

 SoByteStream ()
 Constructor and destructor.
 ~SoByteStream ()
 Constructor and destructor.
void convert (SoNode *node, SbBool binaryFormat=TRUE)
 Convert the passed node, path, or path list into a byte stream.
void convert (SoPath *path, SbBool binaryFormat=TRUE)
void convert (SoPathList *pathList, SbBool binaryFormat=TRUE)
 These convert the passed scene graph object(s) into a byte stream.
void * getData ()
 Returns the data from the last convert() operation.
uint32_t getNumBytes ()
 Returns the number of bytes from the last convert() operation.
void copy (void *d, size_t len)
 This allows apps to store raw data here without converting an Inventor node, path, or path list.
SbBool isRawData () const

Static Public Member Functions

static SoPathListunconvert (SoByteStream *byteStream)
 Unconvert a byte stream back to a path list.
static SoPathListunconvert (void *data, uint32_t numBytes)
 These take byte stream data and unconvert it back to scene graph objects.

Detailed Description

This class creates a byte stream representation of a scene graph, using an SoWriteAction to write path lists to an in-memory buffer. Byte streams are commonly used to transfer data in copy and paste operations.

Definition at line 78 of file SoByteStream.h.


Constructor & Destructor Documentation

SoByteStream::SoByteStream ( )
SoByteStream::~SoByteStream ( )

Member Function Documentation

void SoByteStream::convert ( SoNode node,
SbBool  binaryFormat = TRUE 
)

Caller may specify whether the byte stream is written in binary (TRUE) or ascii (FALSE) format. The converted data can be accessed through getData() and getNumBytes().

See also:
convert(SoPathList *pathList, SbBool binaryFormat)
void SoByteStream::convert ( SoPath path,
SbBool  binaryFormat = TRUE 
)
void SoByteStream::convert ( SoPathList pathList,
SbBool  binaryFormat = TRUE 
)

The caller may specify whether the byte stream is written in binary (TRUE) or ASCII (FALSE) format, and can pass the object(s) by node, path, or pathList.

void SoByteStream::copy ( void *  d,
size_t  len 
)

This sets isRaw to TRUE, and that data cannot be unconverted.

void* SoByteStream::getData ( ) [inline]

This byte stream format is well suited to data transfers, like copy and paste.

Definition at line 105 of file SoByteStream.h.

uint32_t SoByteStream::getNumBytes ( ) [inline]

Definition at line 108 of file SoByteStream.h.

SbBool SoByteStream::isRawData ( ) const [inline]

Definition at line 127 of file SoByteStream.h.

static SoPathList* SoByteStream::unconvert ( void *  data,
uint32_t  numBytes 
) [static]

The objects are returned in a path list.

static SoPathList* SoByteStream::unconvert ( SoByteStream byteStream) [static]

This static routine performs an SoDB::read on the data, and returns a path list of the paths read in. These take byte stream data and unconvert it back to scene graph objects. The objects are returned in a path list.


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