SoWriteAction Class Reference
[Actions]

Writes a scene graph to a file. More...

#include <Inventor/actions/SoWriteAction.h>

Inheritance diagram for SoWriteAction:
SoAction SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoWriteAction ()
 SoWriteAction (SoOutput *out)
SoOutputgetOutput () const
void writePROTO (SoVRMLPROTODef *protoDef)
void writeEXTERNPROTO (SoVRMLEXTERNPROTODef *externprotoDef)
void writeAllPROTO ()

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

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.

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.

EXAMPLE

SEE ALSO

SoOutput, SoSTLWriteAction

See related examples:

AlternateRep, InteractiveSimplification


Constructor & Destructor Documentation

SoWriteAction::SoWriteAction (  ) 

Constructor.

SoWriteAction::SoWriteAction ( SoOutput out  ) 

Constructor that takes an SoOutput to use for output.


Member Function Documentation

static SoType SoWriteAction::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoAction.

SoOutput* SoWriteAction::getOutput (  )  const [inline]

Returns reference to SoOutput instance in action.

virtual SoType SoWriteAction::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Implements SoTypedObject.

void SoWriteAction::writeAllPROTO (  ) 

Write all defined VRMLPROTO to the current SoOutput.

void SoWriteAction::writeEXTERNPROTO ( SoVRMLEXTERNPROTODef externprotoDef  ) 

Write given SoVRMLEXTERNPROTODef to the current SoOutput.

void SoWriteAction::writePROTO ( SoVRMLPROTODef protoDef  ) 

Write given SoVRMLPROTODef to the current SoOutput.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/