Package com.sun.j3d.loaders
Class SceneBase
java.lang.Object
com.sun.j3d.loaders.SceneBase
- All Implemented Interfaces:
Scene
This class implements the Scene interface and extends it to incorporate
utilities that could be used by loaders. There should be little need
for future loaders to subclass this, or to implement Scene directly,
as the functionality of a SceneBase is fairly straightforward. This
class is responsible for both the storage and retrieval of data from
the Scene. The storage methods (used only by Loader writers) are all
of the add* routines. The retrieval methods (used primarily by Loader
users) are all of the get* routines.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBackgroundNode(Background background) Adds the given Background node to the list of backgrounds.voidAdds the given behavior to a list of behaviorsvoidaddDescription(String descriptionString) Sets the text description of the scene to the passed in String.voidaddFogNode(Fog fog) Adds the given Fog node to the list of fog nodes.voidaddHorizontalFOV(float hfov) Adds the given field of view value to the list of field of view values.voidaddLightNode(Light light) Adds the given Light node to the list of lights.voidaddNamedObject(String name, Object object) Adds the given String/Object pair to the table of named objects.voidaddSoundNode(Sound sound) Adds the given Sound node to the list of sounds.voidAdds the given group to the list of view groups.This method returns an array of all Background nodes defined in the file.Behavior[]This method returns a group containing all of the Behavior nodes in the scene.This method returns the text description of the file.Fog[]This method returns an array of all Fog nodes defined in the file.float[]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.Light[]This method returns an array of all Lights defined in the file.This method returns a Hashtable which contains a list of all named objects in the file and their associated scene graph objects.This method returns the BranchGroup containing the overall scene loaded by the loader.Sound[]This method returns an array of all of the Sound nodes defined in the file.This method returns an array of all View Groups defined in the file.voidsetSceneGroup(BranchGroup scene) Sets the sceneGroup to be the group that is passed in.
-
Constructor Details
-
SceneBase
public SceneBase()
-
-
Method Details
-
setSceneGroup
Sets the sceneGroup to be the group that is passed in. -
addViewGroup
Adds the given group to the list of view groups. -
addHorizontalFOV
public void addHorizontalFOV(float hfov) Adds the given field of view value to the list of field of view values. -
addBehaviorNode
Adds the given behavior to a list of behaviors -
addLightNode
Adds the given Light node to the list of lights. -
addBackgroundNode
Adds the given Background node to the list of backgrounds. -
addSoundNode
Adds the given Sound node to the list of sounds. -
addFogNode
Adds the given Fog node to the list of fog nodes. -
addDescription
Sets the text description of the scene to the passed in String. -
addNamedObject
Adds the given String/Object pair to the table of named objects. -
getSceneGroup
This method returns the BranchGroup containing the overall scene loaded by the loader.- Specified by:
getSceneGroupin interfaceScene
-
getViewGroups
This method returns an array of all View Groups defined in the file. A View Group is defined as a TransformGroup which contains a ViewPlatform. The TransformGroup holds the position/orientation information for the given ViewPlatform and the ViewPlatform holds an view-specific information, such as Field of View.- Specified by:
getViewGroupsin interfaceScene
-
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:
getHorizontalFOVsin interfaceScene
-
getLightNodes
This method returns an array of all Lights defined in the file.- Specified by:
getLightNodesin interfaceScene
-
getNamedObjects
This method returns a Hashtable which contains a list of all named objects in the file and their associated scene graph objects. The naming scheme for file objects is file-type dependent, but may include such names as the DEF names of Vrml or filenames of subjects (as in Lightwave 3D).- Specified by:
getNamedObjectsin interfaceScene
-
getBackgroundNodes
This method returns an array of all Background nodes defined in the file.- Specified by:
getBackgroundNodesin interfaceScene
-
getFogNodes
This method returns an array of all Fog nodes defined in the file.- Specified by:
getFogNodesin interfaceScene
-
getBehaviorNodes
This method returns a group containing all of the Behavior nodes in the scene.- Specified by:
getBehaviorNodesin interfaceScene
-
getSoundNodes
This method returns an array of all of the Sound nodes defined in the file.- Specified by:
getSoundNodesin interfaceScene
-
getDescription
This method returns the text description of the file. If no such description exists, this method should return null.- Specified by:
getDescriptionin interfaceScene
-