| 1 |
NAME SoFile "" "" { node that reads children from a named file } |
| 2 |
|
| 3 |
INCLUDE nodes/SoFile.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
This node represents a subgraph that was read from a named input file. |
| 7 |
When an \cSoFile\. node is written out, just the field containing the |
| 8 |
name of the file is written; no children are written out. When an |
| 9 |
\cSoFile\. is encountered during reading, reading continues from the |
| 10 |
named file, and all nodes read from the file are added as hidden |
| 11 |
children of the file node. |
| 12 |
\p |
| 13 |
Whenever the \vname\. field changes, any existing children are removed |
| 14 |
and the contents of the new file is read in. The file node remembers |
| 15 |
what directory the last file was read from and will read the new file |
| 16 |
from the same directory after checking the standard list of |
| 17 |
directories (see \cSoInput\.), assuming the field isn't set to an |
| 18 |
absolute path name. |
| 19 |
\p |
| 20 |
The children of an \cSoFile\. node are hidden; there is no way of |
| 21 |
accessing or editing them. If you wish to edit the contents of an |
| 22 |
\cSoFile\. node, you can modify the contents of the named file and |
| 23 |
then "touch" the \vname\. field (see \cSoField\.). Alternatively, |
| 24 |
you can use the |
| 25 |
\+\mcopyChildren()\. method\. |
| 26 |
\-\mSoFileCopyChildren()\. function\. |
| 27 |
to get a editable copy of the file node's children. Note that this |
| 28 |
does not affect the original file on disk, however. |
| 29 |
} |
| 30 |
|
| 31 |
FIELD name { Name of file from which to read children. } |
| 32 |
|
| 33 |
METHOD "" SoFile() { |
| 34 |
Creates a file node with default settings. |
| 35 |
} |
| 36 |
|
| 37 |
METHOD "" SoGroup * copyChildren() const { |
| 38 |
Returns a new \cSoGroup\. containing copies of all of the file node's |
| 39 |
children. |
| 40 |
} |
| 41 |
|
| 42 |
METHOD "" static SoType getClassTypeId() { |
| 43 |
Returns type identifier for this class. |
| 44 |
} |
| 45 |
|
| 46 |
ACTION SoGLRenderAction, SoCallbackAction, |
| 47 |
SoGetBoundingBoxAction, SoGetMatrixAction, SoHandleEventAction { |
| 48 |
Traverses its children just as \cSoGroup\. does. |
| 49 |
} |
| 50 |
|
| 51 |
ACTION SoRayPickAction { |
| 52 |
Traverses its hidden children, but, if intersections are found, |
| 53 |
generates paths that end at the \cSoFile\. node. |
| 54 |
} |
| 55 |
|
| 56 |
ACTION SoWriteAction { |
| 57 |
Writes just the \vname\. field and no children. |
| 58 |
} |
| 59 |
|
| 60 |
ALSO { SoInput, SoPath } |