Class SoFile
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoFile
-
- All Implemented Interfaces:
SafeDisposable
public class SoFile extends SoNode
Node that reads children from a named file. This node represents a subgraph that was read from a named input file. When anSoFile
node is written out, just the field containing the name of the file is written; no children are written out. When anSoFile
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 (seeSoInput
), 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 anSoFile
node, you can modify the contents of the named file and then "touch" thename
field (seeSoField
). Alternatively, you can use thecopyChildren()
method to get an 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 asSoGroup
does.SoRayPickAction
Traverses its hidden children, but, if intersections are found, generates paths that end at theSoFile
node.SoWriteAction
Writes just thename
field and no children.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFFilePathString
name
Name of file from which to read children.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoFile()
Creates a file node with default settings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SoGroup
copyChildren()
Returns a newSoGroup
containing copies of all of the file node's children.static boolean
getSearchOK()
Queries whether the search action will traverse the hidden children.static void
setSearchOK(boolean flag)
If flag is true, the search action will traverse hidden children.-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
name
public final SoSFFilePathString name
Name of file from which to read children.
-
-
Method Detail
-
copyChildren
public SoGroup copyChildren()
Returns a newSoGroup
containing copies of all of the file node's children.
-
getSearchOK
public static boolean getSearchOK()
Queries whether the search action will traverse the hidden children.
-
setSearchOK
public static void setSearchOK(boolean flag)
If flag is true, the search action will traverse hidden children. Default is false (children will not be searched).
-
-