SoToU3DAction Class Reference
[HardCopy]

HardCopy Export a scene graph to a U3D file. More...

#include <HardCopy/SoToU3DAction.h>

Inheritance diagram for SoToU3DAction:
SoCallbackAction SoAction SoTypedObject SoToPDFAction

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoToU3DAction ()
virtual ~SoToU3DAction ()
SoNONUNICODE bool openFile (const char *filename)
bool openFile (const SbString &filename)
bool closeFile ()
virtual void apply (SoNode *node)
virtual void apply (SoPath *path)
virtual void apply (const SoPathList &pathList, SbBool obeysRules=false)
void forcePolygonalText3 (bool force)
bool isPolygonalText3Forced () const
void setExportDraggers (bool force)
bool areDraggersExported () const

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

HardCopy Export a scene graph to a U3D file.

This class can export an Open Inventor scenegraph to a U3D file. U3D files can be used to import a 3D scene into a PDF file. For a simple PDF export, see SoToPDFAction.

U3D is a much simpler format than the Open Inventor scene graph and limits what can be exported.

Limitations of U3D:

Tips

Use case

  SoHardCopy::init();
  ...
  // setup the root scene graph to export
  SoSeparator* root = new SoSeparator;
  ...
  SoToU3DAction u3dAction;
  bool result = u3dAction.openFile( "output.u3d" );
  if ( !result )
  {
     // Report error
  }
  u3dAction.apply( root );
  result = u3dAction.closeFile();
  if ( !result )
  {
     // Report error
  }

Warning

SEE ALSO

SoToPDFAction.

See related examples:

PDFExport


Constructor & Destructor Documentation

SoToU3DAction::SoToU3DAction (  ) 
virtual SoToU3DAction::~SoToU3DAction (  )  [virtual]

Member Function Documentation

virtual void SoToU3DAction::apply ( const SoPathList pathList,
SbBool  obeysRules = false 
) [virtual]

Initiates an action on the graph specified by list of paths.

TRUE can be passed for the obeysRules flag if the given path list has the following four properties:

  • All paths have the same head node,
  • Paths are sorted in traversal order,
  • If one path ends at node A, no other path continues through A,
  • No two paths are the same.

These rules will be obeyed by path lists returned by picking and by searches for non-group nodes.

Reimplemented from SoAction.

virtual void SoToU3DAction::apply ( SoPath path  )  [virtual]

Initiates an action on the graph specified by a path.

Reimplemented from SoAction.

virtual void SoToU3DAction::apply ( SoNode node  )  [virtual]

Initiates an action on the graph specified by a node.

Reimplemented from SoAction.

bool SoToU3DAction::areDraggersExported (  )  const

Returns true if draggers are exported.

bool SoToU3DAction::closeFile (  ) 

Finalize export to the U3D output file.

Returns false if an error has occured.

Reimplemented in SoToPDFAction.

void SoToU3DAction::forcePolygonalText3 ( bool  force  ) 

Forces SoText2 nodes to be exported using SoText3 (default is true).

static SoType SoToU3DAction::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoCallbackAction.

Reimplemented in SoToPDFAction.

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

Returns the type identifier for this specific instance.

Reimplemented from SoCallbackAction.

Reimplemented in SoToPDFAction.

bool SoToU3DAction::isPolygonalText3Forced (  )  const

Returns true if polygonal text3 is forced (see forcePolygonalText3).

bool SoToU3DAction::openFile ( const SbString filename  ) 

Set the U3D output file.

Returns false if an error has occured.

Reimplemented in SoToPDFAction.

SoNONUNICODE bool SoToU3DAction::openFile ( const char *  filename  ) 

Set the U3D output file.

Returns false if an error has occured.

Non Unicode List:
This function should not be used in a Unicode application. Use the SbString version instead.

Reimplemented in SoToPDFAction.

void SoToU3DAction::setExportDraggers ( bool  force  ) 

Allow the export of draggers (default is true).


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/