Class SoWriteAction
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.actions.SoAction
com.openinventor.inventor.actions.SoWriteAction
Writes a scene graph to a file.
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.
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 action = new SoWriteAction(); SoOutput output = action.getOutput(); output.openFile( "output.iv" ); output.setBinary( true ); // Optional: write binary format action.apply( root ); output.closeFile();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SoWriteAction
(SoOutput out) Constructor that takes anSoOutput
to use for output. -
Method Summary
Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, apply, clearApplyResult, forwardTraversal, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle