home *** CD-ROM | disk | FTP | other *** search
- package com.sun.j3d.loaders;
-
- import java.util.Hashtable;
- import java.util.Vector;
- import javax.media.j3d.Background;
- import javax.media.j3d.Behavior;
- import javax.media.j3d.BranchGroup;
- import javax.media.j3d.Fog;
- import javax.media.j3d.Light;
- import javax.media.j3d.Sound;
- import javax.media.j3d.TransformGroup;
-
- public class SceneBase implements Scene {
- BranchGroup sceneGroup = null;
- BranchGroup behaviorGroup = null;
- Hashtable namedObjects = new Hashtable();
- String description = null;
- Vector viewVector = new Vector();
- Vector hfovVector = new Vector();
- Vector behaviorVector = new Vector();
- Vector lightVector = new Vector();
- Vector fogVector = new Vector();
- Vector backgroundVector = new Vector();
- Vector soundVector = new Vector();
-
- public void setSceneGroup(BranchGroup var1) {
- this.sceneGroup = var1;
- }
-
- public void addViewGroup(TransformGroup var1) {
- this.viewVector.addElement(var1);
- }
-
- public void addHorizontalFOV(float var1) {
- this.hfovVector.addElement(new Float(var1));
- }
-
- public void addBehaviorNode(Behavior var1) {
- this.behaviorVector.addElement(var1);
- }
-
- public void addLightNode(Light var1) {
- this.lightVector.addElement(var1);
- }
-
- public void addBackgroundNode(Background var1) {
- this.backgroundVector.addElement(var1);
- }
-
- public void addSoundNode(Sound var1) {
- this.soundVector.addElement(var1);
- }
-
- public void addFogNode(Fog var1) {
- this.fogVector.addElement(var1);
- }
-
- public void addDescription(String var1) {
- this.description = var1;
- }
-
- public void addNamedObject(String var1, Object var2) {
- if (this.namedObjects.get(var1) == null) {
- this.namedObjects.put(var1, var2);
- } else {
- int var3 = 1;
-
- for(boolean var4 = false; !var4; ++var3) {
- String var5 = var1 + "[" + var3 + "]";
- if (this.namedObjects.get(var5) == null) {
- this.namedObjects.put(var5, var2);
- var4 = true;
- }
- }
- }
-
- }
-
- public BranchGroup getSceneGroup() {
- return this.sceneGroup;
- }
-
- public TransformGroup[] getViewGroups() {
- if (this.viewVector.isEmpty()) {
- return null;
- } else {
- TransformGroup[] var1 = new TransformGroup[this.viewVector.size()];
- this.viewVector.copyInto(var1);
- return var1;
- }
- }
-
- public float[] getHorizontalFOVs() {
- if (this.hfovVector.isEmpty()) {
- return null;
- } else {
- int var1 = this.hfovVector.size();
- float[] var2 = new float[var1];
- Float[] var3 = new Float[this.hfovVector.size()];
- this.hfovVector.copyInto(var3);
-
- for(int var4 = 0; var4 < var1; ++var4) {
- var2[var4] = var3[var4];
- var3[var4] = null;
- }
-
- return var2;
- }
- }
-
- public Light[] getLightNodes() {
- if (this.lightVector.isEmpty()) {
- return null;
- } else {
- Light[] var1 = new Light[this.lightVector.size()];
- this.lightVector.copyInto(var1);
- return var1;
- }
- }
-
- public Hashtable getNamedObjects() {
- return this.namedObjects;
- }
-
- public Background[] getBackgroundNodes() {
- if (this.backgroundVector.isEmpty()) {
- return null;
- } else {
- Background[] var1 = new Background[this.backgroundVector.size()];
- this.backgroundVector.copyInto(var1);
- return var1;
- }
- }
-
- public Fog[] getFogNodes() {
- if (this.fogVector.isEmpty()) {
- return null;
- } else {
- Fog[] var1 = new Fog[this.fogVector.size()];
- this.fogVector.copyInto(var1);
- return var1;
- }
- }
-
- public Behavior[] getBehaviorNodes() {
- if (this.behaviorVector.isEmpty()) {
- return null;
- } else {
- Behavior[] var1 = new Behavior[this.behaviorVector.size()];
- this.behaviorVector.copyInto(var1);
- return var1;
- }
- }
-
- public Sound[] getSoundNodes() {
- if (this.soundVector.isEmpty()) {
- return null;
- } else {
- Sound[] var1 = new Sound[this.soundVector.size()];
- this.soundVector.copyInto(var1);
- return var1;
- }
- }
-
- public String getDescription() {
- return this.description;
- }
- }
-