pl.webnet.JaTrac
Class Scene

java.lang.Object
  |
  +--pl.webnet.JaTrac.Scene
All Implemented Interfaces:
XmlSettable

class Scene
extends java.lang.Object
implements XmlSettable

This class contains a complete scene with lists of all primitives, lights and mappings.


Field Summary
(package private)  pl.webnet.JaTrac.Camera camera
           
(package private)  pl.webnet.JaTrac.IntersectionTester iTester
           
(package private) static java.util.Vector lights
           
(package private)  pl.webnet.JaTrac.Level rootNode
           
(package private)  pl.webnet.JaTrac.Spectrum spectrum
           
 
Constructor Summary
Scene()
           
 
Method Summary
 void add(pl.webnet.JaTrac.Level level)
           
static void add(pl.webnet.JaTrac.Light light)
          Add new light to the scene.
 void add(pl.webnet.JaTrac.TreeNode tn)
           
 java.lang.String[] getAttachArray()
          Get object's attach array.
 java.lang.String[] getParamArray()
          Get object's parameter array.
 java.lang.Object initialize()
          Initialize object's internal state after setting all params from XML file.
 java.util.Iterator iterator()
          This Iterator is used to iterate through all primitives in the scene.
 void preprocessSurfaces()
          Go through levels of the hierarchy and calculate what Surfaces affect each level.
private  void preprocessSurfaces(pl.webnet.JaTrac.Level level, java.util.Vector collected)
          Go through levels of the hierarchy and calculate what Surfaces affect each level.
 void set(pl.webnet.JaTrac.IntersectionTester it)
           
 void setCamera(pl.webnet.JaTrac.Camera cam)
           
 void setSpectrum(pl.webnet.JaTrac.Spectrum s)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

camera

pl.webnet.JaTrac.Camera camera

spectrum

pl.webnet.JaTrac.Spectrum spectrum

rootNode

pl.webnet.JaTrac.Level rootNode

lights

static java.util.Vector lights

iTester

pl.webnet.JaTrac.IntersectionTester iTester
Constructor Detail

Scene

public Scene()
Method Detail

iterator

public java.util.Iterator iterator()
This Iterator is used to iterate through all primitives in the scene. It's somewhat slower than direct recursion, so Intersectors shouldn't use it, but for other uses it is very convenient.


add

public static void add(pl.webnet.JaTrac.Light light)
Add new light to the scene.

Parameters:
light - the light to be put on the scene

add

public void add(pl.webnet.JaTrac.TreeNode tn)

add

public void add(pl.webnet.JaTrac.Level level)

set

public void set(pl.webnet.JaTrac.IntersectionTester it)

getParamArray

public java.lang.String[] getParamArray()
Description copied from interface: XmlSettable
Get object's parameter array. The array maps XML element names to variable names and, if setting one variable is not enough, lists names of functions to call.

Specified by:
getParamArray in interface XmlSettable
Returns:
object's parameter array.

getAttachArray

public java.lang.String[] getAttachArray()
Description copied from interface: XmlSettable
Get object's attach array. The array specifies what functions to call to attach children nodes to this object.

Specified by:
getAttachArray in interface XmlSettable
Returns:
object's attach array.

initialize

public java.lang.Object initialize()
Description copied from interface: XmlSettable
Initialize object's internal state after setting all params from XML file. Called after element's end tag is encountered in XML file.

Specified by:
initialize in interface XmlSettable

setCamera

public void setCamera(pl.webnet.JaTrac.Camera cam)

setSpectrum

public void setSpectrum(pl.webnet.JaTrac.Spectrum s)

preprocessSurfaces

public void preprocessSurfaces()
Go through levels of the hierarchy and calculate what Surfaces affect each level. Store this average surface in each level instance for quicker lookup of surface parameters during rendering.


preprocessSurfaces

private void preprocessSurfaces(pl.webnet.JaTrac.Level level,
                                java.util.Vector collected)
Go through levels of the hierarchy and calculate what Surfaces affect each level. Store this average surface in each level instance for quicker lookup of surface parameters during rendering.

Parameters:
level - top node of the tree to process
collected - list of surfaces collected as yet (for recursive use)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object