'\"! tbl | mmdoc '\"macro stdmacro .ie n \{\ . ds Cr \fB . ds Cb \fB .\} .el \{\ . ds Cr \f7 . ds Cb \f8 .\} .TH SoOutput(3IV) .SH NAME SoOutput \(em used to write Inventor data files .SH INHERITS FROM SoOutput .SH SYNOPSIS .ps -1 \*(Cr#include .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crtypedef void * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOutputReallocCB\*(Cr(void *ptr, size_t newSize) .sp .in 1i \f1Methods from class SoOutput: .in 0.5i .sp .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOutput\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoOutput\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFilePointer\*(Cr(FILE *newFP) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrFILE * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetFilePointer\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbopenFile\*(Cr(const char *fileName) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcloseFile\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBuffer\*(Cr(void *bufPointer, size_t initSize, SoOutputReallocCB *reallocFunc, int32_t offset = 0) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBuffer\*(Cr(void *&bufPointer, size_t &nBytes) const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crsize_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBufferSize\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbresetBuffer\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBinary\*(Cr(SbBool flag) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisBinary\*(Cr() const .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHeaderString\*(Cr(const SbString &str) .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbresetHeaderString\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SbString .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDefaultASCIIHeader\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SbString .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDefaultBinaryHeader\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFloatPrecision\*(Cr(int precision) .sp .SH 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 \*(CbSoOutput\f1 is contained in an \*(CbSoWriteAction\f1; this is typically the only instance needed. .SH METHODS .ta 20m .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbSoOutput\*(Cr() .br .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(Cb~SoOutput\*(Cr() .br .in 1i \f1Constructor and destructor. The default \*(CbSoOutput\f1 writes to \f3stdout\f1. The destructor closes any files opened by the \*(CbSoOutput\f1. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFilePointer\*(Cr(FILE *newFP) .br .in 1i \f1Sets file pointer to write to. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrFILE * .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetFilePointer\*(Cr() const .br .in 1i \f1Returns the file pointer in use, or NULL if using a buffer. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbopenFile\*(Cr(const char *fileName) .br .in 1i \f1Opens named file, sets file pointer to result. This returns FALSE on error. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Cr .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbcloseFile\*(Cr() .br .in 1i \f1Closes current file if opened with \*(CbopenFile()\f1. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBuffer\*(Cr(void *bufPointer, size_t initSize, SoOutputReallocCB *reallocFunc, int32_t offset = 0) .br .in 1i \f1Sets 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. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBuffer\*(Cr(void *&bufPointer, size_t &nBytes) const .br .in 1i \f1Returns pointer to memory buffer being written to and the new size of the buffer. Returns FALSE if not writing into a buffer. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crsize_t .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetBufferSize\*(Cr() const .br .in 1i \f1The total number of bytes allocated to a memory buffer may be larger than the number of bytes written. This returns that total number. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbresetBuffer\*(Cr() .br .in 1i \f1Resets buffer for output again. Output starts over at beginning of buffer. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetBinary\*(Cr(SbBool flag) .br .in 1i \f1Sets whether output should be ASCII (default) or binary. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(CrSbBool .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbisBinary\*(Cr() const .br .in 1i \f1Returns current state of binary flag. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetHeaderString\*(Cr(const SbString &str) .br .in 1i \f1Sets 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: \*(Cr"#Inventor V2.1 ascii MY FILE FORMAT EXTENSION"\f1 Then all Inventor 2.1 applications (and later) can read the file. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbresetHeaderString\*(Cr() .br .in 1i \f1Resets the header for output files to be the default header. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SbString .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDefaultASCIIHeader\*(Cr() .br .in 1i \f1Returns the string representing the default ASCII header. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crstatic SbString .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbgetDefaultBinaryHeader\*(Cr() .br .in 1i \f1Returns the string representing the default binary header. .sp .in 0.5i .in 1i+20n .ti 0.5i .ta 20m .ds Pt \*(Crvoid .ie \w'\*(Pt'>=20n \{\ .ne 3 \*(Pt .ti 0.5i \c\ \} .el\{\ .ne 2 \*(Pt \c\ \} \*(CbsetFloatPrecision\*(Cr(int precision) .br .in 1i \f1Sets 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. .sp .in 0.5i .SH SEE ALSO \*(CbSoInput, SoWriteAction, SoTranSender