SoWriteAction Class |
Writes a scene graph to a file.
Namespace: OIV.Inventor.Actions
The SoWriteAction type exposes the following members.
Name | Description | |
---|---|---|
![]() | SoWriteAction | Constructor. |
![]() | SoWriteAction(SoOutput) | Constructor that takes an SoOutput to use for output. |
Name | Description | |
---|---|---|
![]() | Apply(SoNode) | Initiates an action on the graph defined by a node. |
![]() | Apply(SoPath) | Initiates an action on the graph defined by a path. |
![]() | Apply(SoPathList) | Calls Apply(pathList, false). (Inherited from SoAction.) |
![]() | Apply(SoPathList, Boolean) | Initiates an action on the graph defined by a list of paths. |
![]() | ClearApplyResult | When applied, an action may reference nodes or create objects (e.g. |
![]() ![]() | EnableElement | |
![]() | EnableElements | (Overrides SoActionEnableElements.) |
![]() | Equals | (Inherited from Object.) |
![]() | ForwardTraversal | Traverse a node that is not part of the current scenegraph. |
![]() | GetContinueActionInBranchFlag | This function indicates if the action must stop in the current branch. |
![]() | GetCurPath | (Inherited from SoAction.) |
![]() | GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) |
![]() | GetNodeAppliedTo | (Inherited from SoAction.) |
![]() | GetOriginalPathListAppliedTo | (Inherited from SoAction.) |
![]() | GetOutput | Returns reference to SoOutput instance in action. |
![]() | GetPathAppliedTo | (Inherited from SoAction.) |
![]() | GetPathCode(SbNativeArrayInt32) | Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. |
![]() | GetPathCode(SbNativeInt32Array) | Obsolete. Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. |
![]() | GetPathListAppliedTo | (Inherited from SoAction.) |
![]() | GetPipeId | Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. |
![]() | GetSceneManager | Return the SoSceneManager associated with this action. |
![]() | GetState | (Inherited from SoAction.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetWhatAppliedTo | (Inherited from SoAction.) |
![]() | HasTerminated | (Inherited from SoAction.) |
![]() | InvalidateState | Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. |
![]() | IsBeingApplied | Returns true if this action is currently being applied. |
![]() | IsLastPathListAppliedTo | (Inherited from SoAction.) |
![]() | IsUsingAlternateRep | Returns true if current action is using alternate representations. |
![]() | PostDelayedTraversal | Method called by SoMultiPassManager after delayed pass traversals. |
![]() | PreDelayedTraversal | Method called by SoMultiPassManager before delayed pass traversals. |
![]() | ResetContinueActionInBranchFlag | This function resets the continue action flag. |
![]() | SetPipeId | Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. |
![]() | SetSceneManager | Set the scene manager associated with this action (if any ). |
![]() | SetUpState | (Inherited from SoAction.) |
![]() | StopActionInBranch | This function stops the action in the current Scene Graph branch. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Traverse | (Inherited from SoAction.) |
![]() | UseAlternateRep | Tell the action to use alternate representations during traversal when available. |
![]() | WriteAllPROTO | Write all defined VRMLPROTO to the current SoOutput. |
![]() | WriteEXTERNPROTO | Write given SoVRMLEXTERNPROTODef to the current SoOutput. |
![]() | WritePROTO | Write given SoVRMLPROTODef to the current SoOutput. |
This class is used for writing scene graphs in Open Inventor (.iv) format. SoWriteAction traverses the scene graph and uses an instance of SoOutput to write each node. SoOutput methods can be called to specify what file or memory buffer to write to. SoOutput supports both ASCII (default) and binary formats and provides some convenience functions for opening and closing files. See SbFileHelper for more convenience functions. Since Open Inventor 8.1, SoOutput can write compressed data in the lossless Zlib (gzip) format. Both ASCII and binary format files may be compressed.
X3D / VRML Open Inventor ASCII format is essentially the same as the VRML97 format (because the standard was influenced by Open Inventor), which is now called the "Classic VRML" encoding in the X3D specification (see www.x3d.org). The main difference is the file header. If you need to write VRML compatible files, you must set the appropriate file header string using SoOutput's setHeaderString method. However setting the correct header string does not guarantee everything in the file is valid X3D/VRML. If you need to convert a scene graph containing Open Inventor specific nodes to X3D/VRML, use SoToVRML2Action, then SoWriteAction.
STL Open Inventor can also export geometry to an STL (.stl) format file. See SoSTLWriteAction.
An instance of SoOutput is automatically created by SoWriteAction. This is typically the only instance needed. For example:
SoWriteAction writeAction = new SoWriteAction(); writeAction.GetOutput().OpenFile( "output.iv" ); writeAction.GetOutput().SetBinary( true ); // Optional: write binary format writeAction.Apply( root ); writeAction.GetOutput().CloseFile();