Xj3D VRML/X3D Code API

org.web3d.j3d.loaders
Class J3DScene

java.lang.Object
  extended byorg.web3d.j3d.loaders.J3DScene
All Implemented Interfaces:
com.sun.j3d.loaders.Scene

public class J3DScene
extends java.lang.Object
implements com.sun.j3d.loaders.Scene

Java3D representation of a complete scene in VRML.

The scene returns lists of nodes of the given type. This list contains all of the nodes of that type in the order that they are declared in the incoming stream. As the scene changes due to scripting and external interactions, it will add new instances of these nodes to the end of the list. If there is none of the given node types, the methods shall return empty lists.

A requirement of the VRML specification is that if there is no Viewpoint described in the file, the browser shall add an automatic one. As this scene may be used in other applications than a VRML browser, we do not automatically insert the viewpoint. If none is defined, the viewpoint list returned will be empty and it is up to the loading application to add its own as appropriate.

Version:
$Revision: 2.3 $
Author:
Justin Couch

Method Summary
 javax.media.j3d.Background[] getBackgroundNodes()
          This method returns an array of all Background nodes defined in the file.
 javax.media.j3d.Behavior[] getBehaviorNodes()
          This method returns a group containing all of the Behavior nodes in the scene.
 java.lang.String getDescription()
          Get the VRML description information.
 javax.media.j3d.Fog[] getFogNodes()
          This method returns an array of all Fog nodes defined in the file.
 float[] getHorizontalFOVs()
          This method returns an array of floats that contains the horizontal field of view values for each corresponding entry in the array of view groups returned by the method getViewGroups.
 javax.media.j3d.Light[] getLightNodes()
          This method returns an array of all Lights defined in the file.
 java.util.Hashtable getNamedObjects()
          Get a list of the nodes that have been named with DEF in this scene.
 javax.media.j3d.BranchGroup getSceneGroup()
          Get the node that forms the root of this scene.
 javax.media.j3d.Sound[] getSoundNodes()
          This method returns an array of all of the Sound nodes defined in the file.
 javax.media.j3d.TransformGroup[] getViewGroups()
          This method returns an array of all View Groups defined in the file.
 void setDescription(java.lang.String ver)
          Set the VRML description information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDescription

public void setDescription(java.lang.String ver)
Set the VRML description information.

Parameters:
ver - A string representation of the description

getDescription

public java.lang.String getDescription()
Get the VRML description information. This is the Description of the VRML specification that was declared in the first line of the file.

Specified by:
getDescription in interface com.sun.j3d.loaders.Scene
Returns:
The description of this file

getBackgroundNodes

public javax.media.j3d.Background[] getBackgroundNodes()
This method returns an array of all Background nodes defined in the file. This listing will also include and Protos that are defined with their primary node type as being Viewpoint.

Specified by:
getBackgroundNodes in interface com.sun.j3d.loaders.Scene
Returns:
The list of backgrounds registered

getBehaviorNodes

public javax.media.j3d.Behavior[] getBehaviorNodes()
This method returns a group containing all of the Behavior nodes in the scene.

Specified by:
getBehaviorNodes in interface com.sun.j3d.loaders.Scene
Returns:
The list of behaviors registered

getFogNodes

public javax.media.j3d.Fog[] getFogNodes()
This method returns an array of all Fog nodes defined in the file. This listing will also include and Protos that are defined with their primary node type as being Fog.

Specified by:
getFogNodes in interface com.sun.j3d.loaders.Scene
Returns:
The list of fogs registered

getHorizontalFOVs

public float[] getHorizontalFOVs()
This method returns an array of floats that contains the horizontal field of view values for each corresponding entry in the array of view groups returned by the method getViewGroups.

Specified by:
getHorizontalFOVs in interface com.sun.j3d.loaders.Scene
Returns:
The list of field of views registered

getLightNodes

public javax.media.j3d.Light[] getLightNodes()
This method returns an array of all Lights defined in the file. This listing will also include and Protos that are defined with their primary node type as being LightNodeType.

Specified by:
getLightNodes in interface com.sun.j3d.loaders.Scene
Returns:
The list of lights registered

getSoundNodes

public javax.media.j3d.Sound[] getSoundNodes()
This method returns an array of all of the Sound nodes defined in the file. This listing will also include and Protos that are defined with their primary node type as being SoundNodeType.

Specified by:
getSoundNodes in interface com.sun.j3d.loaders.Scene
Returns:
The list of sounds registered

getViewGroups

public javax.media.j3d.TransformGroup[] getViewGroups()
This method returns an array of all View Groups defined in the file. This listing will also include any Protos that are defined with their primary node type as being Viewpoint.

Specified by:
getViewGroups in interface com.sun.j3d.loaders.Scene
Returns:
The list of viewpoints registered

getSceneGroup

public javax.media.j3d.BranchGroup getSceneGroup()
Get the node that forms the root of this scene.

Specified by:
getSceneGroup in interface com.sun.j3d.loaders.Scene
Returns:
A reference to the root node of the scene

getNamedObjects

public java.util.Hashtable getNamedObjects()
Get a list of the nodes that have been named with DEF in this scene. The map is keyed by the DEF name string and the values are the SceneGraphObject instances. If there are no nodes marked with DEF then the map will be empty.

Specified by:
getNamedObjects in interface com.sun.j3d.loaders.Scene
Returns:
A map of the DEF'd nodes.

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium