SoOutput()~SoOutput()
Constructor and destructor. The default SoOutput writes to stdout. The destructor closes any files
opened by the SoOutput.
voidsetFilePointer(FILE*newFP)
Sets file pointer to write to.
FILE*getFilePointer()const
Returns the file pointer in use, or NULL if using a buffer.
SbBoolopenFile(constchar*fileName)
Opens named file, sets file pointer to result. This returns FALSE on error.
closeFile()
Closes current file if opened with openFile().
voidsetBuffer(void*bufPointer,size_tinitSize,SoOutputReallocCB*reallocFunc,int32_toffset=0)
Sets up memory buffer to write to, initial size, reallocation function (which is called if there is
not enough room in the buffer), and offset in the buffer at which to begin writing. If the
reallocation function returns NULL, writing will be disabled.
SbBoolgetBuffer(void*&bufPointer,size_t&nBytes)const
Returns pointer to memory buffer being written to and the new size of the buffer. Returns FALSE if not
writing into a buffer.
size_tgetBufferSize()const
The total number of bytes allocated to a memory buffer may be larger than the number of bytes written.
This returns that total number.
voidresetBuffer()
Resets buffer for output again. Output starts over at beginning of buffer.
voidsetBinary(SbBoolflag)
Sets whether output should be ASCII (default) or binary.
SbBoolisBinary()const
Returns current state of binary flag.
voidsetHeaderString(constSbString&str)
Sets the header for output files. This is useful, for example, if you have a file format that is a
superset of the Inventor file format and you want Inventor to read the files. It is highly recommend
that in your new header you simply append to the header of the Inventor file format you are extending.
For example, if a new file format is based on the Inventor 2.1 file format, register a header similar
to: "#InventorV2.1asciiMYFILEFORMATEXTENSION" Then all Inventor 2.1 applications (and later) can
read the file.
voidresetHeaderString()
Resets the header for output files to be the default header.
staticSbStringgetDefaultASCIIHeader()
Returns the string representing the default ASCII header.
staticSbStringgetDefaultBinaryHeader()
Returns the string representing the default binary header.
voidsetFloatPrecision(intprecision)
Sets the precision for writing floating point numbers, i.e. the number of significant digits. Floating
point numbers are written using %.xg format, where 'x' is the value of the precision argument.