Open Inventor Reference
SoFile Class Reference

Node that reads children from a named file. More...

#include <Inventor/nodes/SoFile.h>

Inheritance diagram for SoFile:
SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoFile ()
 Creates a file node with default settings.
SoGroupcopyChildren () const
 Method that returns a copy of the File node's children added to a group.
virtual void doAction (SoAction *action)
 Traversal methods for all the actions:
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void handleEvent (SoHandleEventAction *action)
virtual void pick (SoPickAction *action)
virtual SoChildListgetChildren () const
 Returns pointer to children.
virtual void copyContents (const SoFieldContainer *fromFC, SbBool copyConnections)
 Copies the contents of the given node into this instance.

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoSFString name
 Name of file from which to read children.

Protected Member Functions

virtual SbBool readInstance (SoInput *in, unsigned short flags)
 Reads stuff into instance of SoFile. Returns FALSE on error.
virtual ~SoFile ()

Detailed Description

This node represents a subgraph that was read from a named input file. When an SoFile node is written out, just the field containing the name of the file is written; no children are written out. When an SoFile is encountered during reading, reading continues from the named file, and all nodes read from the file are added as hidden children of the file node.

Whenever the name field changes, any existing children are removed and the contents of the new file is read in. The file node remembers what directory the last file was read from and will read the new file from the same directory after checking the standard list of directories (see SoInput), assuming the field isn't set to an absolute path name.

The children of an SoFile node are hidden; there is no way of accessing or editing them. If you wish to edit the contents of an SoFile node, you can modify the contents of the named file and then "touch" the name field (see SoField). Alternatively, you can use the copyChildren() method to get a editable copy of the file node's children. Note that this does not affect the original file on disk, however.

File Format/Default
File {
  name <Undefined file>
}
Action Behavior
SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoHandleEventAction
Traverses its children just as SoGroup does.
SoRayPickAction
Traverses its hidden children, but, if intersections are found, generates paths that end at the SoFile node.
SoWriteAction
Writes just the name field and no children.
See Also
SoInput, SoPath

Definition at line 123 of file SoFile.h.


Constructor & Destructor Documentation

SoFile::SoFile ( )
virtual SoFile::~SoFile ( ) [protected, virtual]

Member Function Documentation

virtual void SoFile::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoNode.

SoGroup* SoFile::copyChildren ( ) const
virtual void SoFile::copyContents ( const SoFieldContainer fromFC,
SbBool  copyConnections 
) [virtual]

This copies without re-reading the file.

Reimplemented from SoNode.

virtual void SoFile::doAction ( SoAction action) [virtual]

Reimplemented from SoNode.

virtual void SoFile::getBoundingBox ( SoGetBoundingBoxAction action) [virtual]

Reimplemented from SoNode.

virtual SoChildList* SoFile::getChildren ( ) const [virtual]

Reimplemented from SoNode.

virtual void SoFile::getMatrix ( SoGetMatrixAction action) [virtual]

Reimplemented from SoNode.

virtual void SoFile::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

virtual void SoFile::handleEvent ( SoHandleEventAction action) [virtual]

Reimplemented from SoNode.

static void SoFile::initClass ( ) [static]

Reimplemented from SoNode.

virtual void SoFile::pick ( SoPickAction action) [virtual]

Reimplemented from SoNode.

virtual SbBool SoFile::readInstance ( SoInput in,
unsigned short  flags 
) [protected, virtual]

Reimplemented from SoFieldContainer.


Member Data Documentation

Definition at line 132 of file SoFile.h.


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