GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SOOUTPUT (3)

NAME

SoOutput — used to write Inventor data files

CONTENTS

Inherits From
Synopsis
Description
Methods
See Also

INHERITS FROM

SoOutput

SYNOPSIS

#include <Inventor/SoOutput.h>

    typedef void *    
                    
typedef void *       SoOutputReallocCB(void *ptr, size_t newSize)

Methods from class SoOutput:

       
                    
                     SoOutput()    
   
                    
                     ~SoOutput()    
void    
                    
void                 setFilePointer(FILE *newFP)    
FILE *    
                    
FILE *               getFilePointer() const    
SbBool    
                    
SbBool               openFile(const char *fileName)    
   
                    
                     closeFile()    
void    
                    
void                 setBuffer(void *bufPointer, size_t initSize, SoOutputReallocCB *reallocFunc, int32_t offset = 0)    
SbBool    
                    
SbBool               getBuffer(void *&bufPointer, size_t &nBytes) const    
size_t    
                    
size_t               getBufferSize() const    
void    
                    
void                 resetBuffer()    
void    
                    
void                 setBinary(SbBool flag)    
SbBool    
                    
SbBool               isBinary() const    
void    
                    
void                 setHeaderString(const SbString &str)    
void    
                    
void                 resetHeaderString()    
static SbString    
                    
static SbString      getDefaultASCIIHeader()    
static SbString    
                    
static SbString      getDefaultBinaryHeader()    
void    
                    
void                 setFloatPrecision(int precision)

DESCRIPTION

This class is used for writing Inventor data files. It supports both ASCII (default) and binary formats and provides some convenience functions for handling files. It can also write to a buffer in memory as well as to a file pointer. A user-defined header can be specified for the output file. An instance of SoOutput is contained in an SoWriteAction; this is typically the only instance needed.

METHODS

       
                    
                     SoOutput()    
   
                    
                     ~SoOutput()
Constructor and destructor. The default SoOutput writes to stdout. The destructor closes any files opened by the SoOutput.

    void    
                    
void                 setFilePointer(FILE *newFP)
Sets file pointer to write to.

    FILE *    
                    
FILE *               getFilePointer() const
Returns the file pointer in use, or NULL if using a buffer.

    SbBool    
                    
SbBool               openFile(const char *fileName)
Opens named file, sets file pointer to result. This returns FALSE on error.

       
                    
                     closeFile()
Closes current file if opened with openFile().

    void    
                    
void                 setBuffer(void *bufPointer, size_t initSize, SoOutputReallocCB *reallocFunc, int32_t offset = 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.

    SbBool    
                    
SbBool               getBuffer(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_t    
                    
size_t               getBufferSize() 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.

    void    
                    
void                 resetBuffer()
Resets buffer for output again. Output starts over at beginning of buffer.

    void    
                    
void                 setBinary(SbBool flag)
Sets whether output should be ASCII (default) or binary.

    SbBool    
                    
SbBool               isBinary() const
Returns current state of binary flag.

    void    
                    
void                 setHeaderString(const SbString &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: "#Inventor V2.1 ascii MY FILE FORMAT EXTENSION" Then all Inventor 2.1 applications (and later) can read the file.

    void    
                    
void                 resetHeaderString()
Resets the header for output files to be the default header.

    static SbString    
                    
static SbString      getDefaultASCIIHeader()
Returns the string representing the default ASCII header.

    static SbString    
                    
static SbString      getDefaultBinaryHeader()
Returns the string representing the default binary header.

    void    
                    
void                 setFloatPrecision(int precision)
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.

SEE ALSO

SoInput, SoWriteAction, SoTranSender

Search for    or go to Top of page |  Section 3 |  Main Index


SOOUTPUT(3IV) (-->)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.