net.sf.j3d.threeD.raytracer.engine
Class Scene

java.lang.Object
  extended by net.sf.j3d.threeD.raytracer.engine.Scene
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Simulation

public class Scene
extends Object
implements Cloneable

A Scene object represents a scene in 3d. It stores a Camera object, an array of Light objects, and an array of Surface objects.


Constructor Summary
Scene()
          Constructs a Scene object with a default Camera object and no Light or Surface objects.
Scene(Camera camera, Light[] lights, Surface[] surfaces)
          Constructs a Scene object with the specified Camera object, Light array, and Surface array.
Scene(Surface[] surfaces)
          Constructs a Scene object with a default Camera object, no Light objects, and the surfaces represented by the specified Surface array.
 
Method Summary
 void addLight(Light light)
          Adds the specified Light object to this Scene object.
 void addSurface(Surface surface)
          Adds the specified Surface object to this Scene object.
 Object clone()
           
 Camera getCamera()
          Returns the Camera object stored by this Scene object.
 Light getLight(int index)
          Returns the Surface object stored by this Scene object at the specified index.
 Light[] getLights()
          Returns the Light objects stored by this Scene object as a Light array.
 Surface getSurface(int index)
          Returns the Surface object stored by this Scene object at the specified index.
 Surface[] getSurfaces()
          Returns the Surface objects stored by this Scene object as a Surface array.
 void removeLight(int index)
          Removes the Light object stored at the specified index from this Scene object.
 void removeSurface(int index)
          Removes the Surface object stored at the specified index from this Scene object.
 void setCamera(Camera camera)
          Sets the camera of this Scene object to the camera represented by the specified Camera object.
 void setLights(Light[] lights)
          Replaces all of the lights of this Scene object with those represented by the specified Light array.
 void setSurfaces(Surface[] surfaces)
          Replaces all of the Surface objects of this Scene object with those represented by the specified Surface array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scene

public Scene()
Constructs a Scene object with a default Camera object and no Light or Surface objects.


Scene

public Scene(Surface[] surfaces)
Constructs a Scene object with a default Camera object, no Light objects, and the surfaces represented by the specified Surface array.


Scene

public Scene(Camera camera,
             Light[] lights,
             Surface[] surfaces)
Constructs a Scene object with the specified Camera object, Light array, and Surface array.

Method Detail

setCamera

public void setCamera(Camera camera)
Sets the camera of this Scene object to the camera represented by the specified Camera object.


setLights

public void setLights(Light[] lights)
Replaces all of the lights of this Scene object with those represented by the specified Light array.


addLight

public void addLight(Light light)
Adds the specified Light object to this Scene object.


removeLight

public void removeLight(int index)
Removes the Light object stored at the specified index from this Scene object.


setSurfaces

public void setSurfaces(Surface[] surfaces)
Replaces all of the Surface objects of this Scene object with those represented by the specified Surface array.


addSurface

public void addSurface(Surface surface)
Adds the specified Surface object to this Scene object.


removeSurface

public void removeSurface(int index)
Removes the Surface object stored at the specified index from this Scene object.


getCamera

public Camera getCamera()
Returns the Camera object stored by this Scene object.


getLights

public Light[] getLights()
Returns the Light objects stored by this Scene object as a Light array.


getLight

public Light getLight(int index)
Returns the Surface object stored by this Scene object at the specified index.


getSurfaces

public Surface[] getSurfaces()
Returns the Surface objects stored by this Scene object as a Surface array.


getSurface

public Surface getSurface(int index)
Returns the Surface object stored by this Scene object at the specified index.


clone

public Object clone()
Overrides:
clone in class Object
Returns:
A Scene object that stores the same Camera, Lights, and Surfaces as this Scene object.