Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLWorldRootNodeType

All Superinterfaces:
FrameStateListener, VRMLExecutionSpace, VRMLNode, VRMLNodeType
All Known Subinterfaces:
OGLWorldRootNodeType

public interface VRMLWorldRootNodeType
extends VRMLNodeType, VRMLExecutionSpace

An abstract representation of the root node of a world.

We need a root node representation to act as a standard place to collate all the nodes of a world. While the XML encoding provides a single root node in the X3D element, the UTF8 encoding does not. This class acts as that sort of collector. For the XML code or the UTF8 code, we would expect more concrete implemetations of this interface to be derived.

While this could be a VRMLGroupingNodeType we really don't want to extend that interface. It implies that this node could then be inserted anywhere into the scenegraph. That we want to prevent. Instead, we just copy all the methods here. We also copy the bounded node methods because these might be useful. We do not require implementations to figure out the bounds, but if they do then it would be nice to grab that information.

Version:
$Revision: 1.10 $
Author:
Justin Couch

Method Summary
 void addChild(VRMLNodeType newChild)
          Append a new child node to the existing collection.
 float[] getBboxCenter()
          Accessor method to get current value of field bboxCenter default value is 0 0 0.
 float[] getBboxSize()
          Accessor method to get current value of field bboxSize default value is -1 -1 -1.
 VRMLNodeType[] getChildren()
          Get the children, provides a live reference not a copy
 int getChildrenSize()
          Returns the number of children
 void removeChild(VRMLNodeType removeChild)
          Remove an existing child node from the collection.
 void setBboxCenter(float[] newBboxCenter)
          Accessor method to set a new value for field attribute bboxCenter
 void setBboxSize(float[] newBboxSize)
          Accessor method to set a new value for field attribute bboxSize
 void setChildren(VRMLNodeType newChild)
          Accessor method to set the children field Creates an array containing only newChild If passed null this method will act like removeChildren
 void setChildren(VRMLNodeType[] newChildren)
          Accesor method to set the children field If passed null this method will act like removeChildren
 void setContainedScene(BasicScene scene)
          Set the scene that is contained by this world, which happens to be an execution space.
 void setRootWorld()
          Set the ID of this world root to be the initial (index 0) layer.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 
Methods inherited from interface org.web3d.vrml.lang.VRMLExecutionSpace
getContainedScene
 

Method Detail

setRootWorld

void setRootWorld()
Set the ID of this world root to be the initial (index 0) layer.


setContainedScene

void setContainedScene(BasicScene scene)
Set the scene that is contained by this world, which happens to be an execution space. The scene instance must be non-null.

Parameters:
scene - The scene to use

setBboxCenter

void setBboxCenter(float[] newBboxCenter)
Accessor method to set a new value for field attribute bboxCenter

Parameters:
newBboxCenter - The new center of the bounding box

getBboxCenter

float[] getBboxCenter()
Accessor method to get current value of field bboxCenter default value is 0 0 0.

Returns:
Value of bboxCenter(SFVec3f)

setBboxSize

void setBboxSize(float[] newBboxSize)
Accessor method to set a new value for field attribute bboxSize

Parameters:
newBboxSize - The new size for the bounding box

getBboxSize

float[] getBboxSize()
Accessor method to get current value of field bboxSize default value is -1 -1 -1.

Returns:
The size of the bounding box(SFVec3f)

getChildren

VRMLNodeType[] getChildren()
Get the children, provides a live reference not a copy

Returns:
An array of VRMLNodes

setChildren

void setChildren(VRMLNodeType[] newChildren)
Accesor method to set the children field If passed null this method will act like removeChildren

Parameters:
newChildren - Array of new children

setChildren

void setChildren(VRMLNodeType newChild)
Accessor method to set the children field Creates an array containing only newChild If passed null this method will act like removeChildren

Parameters:
newChild - The new child

getChildrenSize

int getChildrenSize()
Returns the number of children

Returns:
The number of children

addChild

void addChild(VRMLNodeType newChild)
Append a new child node to the existing collection. Should be used sparingly. It is really only provided for Proto handling purposes.

Parameters:
newChild - The new child

removeChild

void removeChild(VRMLNodeType removeChild)
Remove an existing child node from the collection. Should be used sparingly. It is really only provided for Proto handling purposes. If it is not registered, silently ignores the request.

Parameters:
removeChild - The child to remove

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium