Xj3D 2.0 VRML/X3D Code API

org.web3d.x3d.sai
Interface X3DScene

All Superinterfaces:
X3DExecutionContext

public interface X3DScene
extends X3DExecutionContext

Abstract representation of a complete X3D scene graph.

All queries to this interface return a snapshot of the current information. If the scenegraph changes while the end user has a handle to an map, the map shall not be updated to reflect the new internal state. If the end user adds something to the maps, it shall not be representing in the underlying scene.

Version:
$Revision: 1.7 $
Author:
Justin Couch

Field Summary
 
Fields inherited from interface org.web3d.x3d.sai.X3DExecutionContext
ASCII_ENCODING, BIFS_ENCODING, BINARY_ENCODING, LAST_STD_ENCODING, NO_SCENE, SCRIPTED_ENCODING, VRML_ENCODING, XML_ENCODING
 
Method Summary
 void addMetaData(java.lang.String name, java.lang.String value)
          Add a meta tag data item to this scene.
 void addRootNode(X3DNode node)
          Add a new root node to the scene graph.
 X3DNode getExportedNode(java.lang.String name)
          Get the node which is exported from the scene under a given
 java.lang.String[] getExportedNodes()
          Get the list of exports from this file.
 java.util.Map getMetaData()
          Get the meta data mapping from this scene.
 void removeExportedNode(java.lang.String name)
          Remove an exported name from the scene.
 void removeMetaData(java.lang.String name)
          Remove the named tag from the map.
 void removeRootNode(X3DNode node)
          Remove the root node from the scene graph.
 void updateExportedNode(java.lang.String localName, java.lang.String exportName)
          Add a named node to this scene.
 
Methods inherited from interface org.web3d.x3d.sai.X3DExecutionContext
addRoute, createNode, createProto, getComponents, getEncoding, getExternProtoDeclaration, getExternProtoNames, getImportedNode, getNamedNode, getNamedNodes, getProfile, getProtoDeclaration, getProtosNames, getRootNodes, getRoutes, getSpecificationVersion, getWorldURL, removeExternProtoDeclaration, removeImportedNode, removeNamedNode, removeProtoDeclaration, removeRoute, updateExternProtoDeclaration, updateImportedNode, updateNamedNode, updateProtoDeclaration
 

Method Detail

addMetaData

void addMetaData(java.lang.String name,
                 java.lang.String value)
Add a meta tag data item to this scene. Both name and value must be non-null.

Parameters:
name - The name of the tag to add
value - The value of the tag
Throws:
java.lang.NullPointerException - The name or value were null

getMetaData

java.util.Map getMetaData()
Get the meta data mapping from this scene. The map returned cannot be changed and represents the current internal state.

Returns:
The current meta tag mappings

removeMetaData

void removeMetaData(java.lang.String name)
Remove the named tag from the map. If tag name does not exist, the request is silently ignored.

Parameters:
name - The name of the tag to remove

getExportedNode

X3DNode getExportedNode(java.lang.String name)
Get the node which is exported from the scene under a given

Parameters:
name - The export name to find
Returns:
The node representing the export

getExportedNodes

java.lang.String[] getExportedNodes()
Get the list of exports from this file. The map is the exported name to the node instance. If there are no nodes exported, the map will be empty. Note that exported nodes is not a valid concept for VRML97. It only exists for X3D V3.0 and above.

Returns:
A map of the exported nodes

updateExportedNode

void updateExportedNode(java.lang.String localName,
                        java.lang.String exportName)
Add a named node to this scene. The node must be a valid member of this scene already. If not, an error is generated. An exported name may be null, in which case the local name is used as the export name

Parameters:
localName - The local DEF name in this scene
exportName - The name to export the node as, or null

removeExportedNode

void removeExportedNode(java.lang.String name)
Remove an exported name from the scene. If the node is not currently exported this is silently ignored. The name is first checked against the explicit export names and then against the DEF names that are exported without using the AS keyword.

Parameters:
name - The exported name to remove

addRootNode

void addRootNode(X3DNode node)
Add a new root node to the scene graph. This must be a valid child node type or proto instance that can be a child node, as per the VRML specification. If the node is already part of this scene, this is treated as an implicit USE of the node at the root of the scene graph and the normal rules will apply.

Parameters:
node - The node pointer to add to the scene

removeRootNode

void removeRootNode(X3DNode node)
Remove the root node from the scene graph. This must be a valid child node type or proto instance, as per the VRML specification. If the node is not a root node then an exception is generated.


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium