Click or drag to resize
SoOutput Class

Used to write Open Inventor data files.

Inheritance Hierarchy
SystemObject
  OIV.InventorSoNetBase
    OIV.InventorSoOutput

Namespace: OIV.Inventor
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoOutput : SoNetBase

The SoOutput type exposes the following members.

Constructors
  NameDescription
Public methodSoOutput

Constructor.

Top
Methods
  NameDescription
Public methodCloseFile

Closes current file if opened with OIV.Inventor.SoOutput.OpenFile(System.String).

Public methodDecrementIndent
Calls DecrementIndent(1).
Public methodDecrementIndent(Int32)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFilePutc

Write a byte to the currently open file.

Public methodFilePuts

Write a string to the currently open file.

Public methodFlushFile
Public methodGetBufferSize

The total number of bytes allocated to a memory buffer may be larger than the number of bytes written.

Public methodStatic memberGetDefaultASCIIHeader

Returns the string representing the default ASCII header.

Public methodStatic memberGetDefaultBinaryHeader

Returns the string representing the default binary header.

Public methodGetFileProperty

Returns the current properties used by OIV.Inventor.SoOutput.

Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetIndentLevel
Public methodGetStage
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIncrementIndent
Calls IncrementIndent(1).
Public methodIncrementIndent(Int32)
Public methodIndent
Public methodIsBinary

Returns current state of binary flag.

Public methodIsWritingForScaleViz

Returns true if ScaleViz is currently writing data for synchronization.

Public methodOpenFile

Opens named file, sets current file to result.

Public methodResetBuffer

Resets buffer for output again.

Public methodResetHeaderString

Resets the header for output files to be the default header.

Public methodSetBinary

Sets whether output should be ASCII (default) or binary.

Public methodSetDoublePrecision

Sets the precision for writing floating point numbers (type double), i.e. the number of significant digits.

Public methodSetFileProperty

Sets a combination of properties for the current file.

Public methodSetFloatPrecision

Sets the precision for writing floating point numbers (type float), i.e. the number of significant digits.

Public methodSetHeaderString

Sets the header for output files.

Public methodSetStage
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWrite(Boolean)
Public methodWrite(Byte)
Public methodWrite(Double)
Public methodWrite(Int16)
Public methodWrite(Int32)
Public methodWrite(Int64)

Public methodWrite(SByte)
Public methodWrite(Single)
Public methodWrite(String)
Public methodWrite(UInt16)

Public methodWrite(UInt32)

Public methodWrite(UInt64)

Public methodWriteBinaryArray
Top
Remarks

This class is used for writing Open Inventor data files. It supports both ASCII (default) and binary formats and provides some convenience functions for opening and closing files. See OIV.Inventor.Helpers.SbFileHelper for more convenience functions. It can write to a buffer in memory as well as to a file. Since Open Inventor 8.1, OIV.Inventor.SoOutput can write compressed data in the lossless Zlib (aka gzip) format. Both ASCII and binary format files may be compressed.

An instance of OIV.Inventor.SoOutput is automatically created by OIV.Inventor.Actions.SoWriteAction and can be queried using the GetOutput() method in that class. This is typically the only instance needed. For example:

SoWriteAction writeAction = new SoWriteAction()  ;
writeAction.GetOutput().OpenFile( "output.iv" );
writeAction.Apply( root );
writeAction.GetOutput().CloseFile();

Note that file properties (binary, compression, header string, etc) should be set before calling OpenFile() or SetFilePointer().

File extensions The recommended file extension for Open Inventor format files, both ASCII and binary is ".iv". Open Inventor will automatically detect if the file is ASCII or binary based on the file header string. Compressed Open Inventor files may be given the extension ".ivz" for convenience, but it is not required. Open Inventor automatically detects compressed files.

File Header Open Inventor writes a human readable file header as the first line of both ASCII and binary format files. Since Open Inventor 8.0, the default file header looks like this: ASCII : "#Inventor V8.0 ascii" Binary: "#Inventor V8.0 binary LE" The two character code at the end of the binary header indicates if the file was written on a little-endian (LE) or big-endian (BE) machine. The version number string may change again in the future if incompatible changes are made to the file format. You can always query the current default headers using static methods GetDefaultASCIIHeader() and GetDefaultBinaryHeader().

All versions of Open Inventor from version 2.1 through version 7.x, wrote the version number string "V2.1" by default and did not append "LE" (or "BE") to the binary header. Open Inventor cannot, in general, load files containing a file header from a newer version. However all versions of Open Inventor can load files written by older versions and can load files containing the V2.1 file header. We recommend always using the default file header because newer versions enable performance enhancing features in the file format. If you need to write a file compatible with older versions, call OIV.Inventor.SoOutput.SetHeaderString(System.String) with "#Inventor V2.1 ascii" or "#Inventor V2.1 binary".

See Also