apps.lightrays.raytracer
Class RayTracerEngine

java.lang.Object
  extended by apps.lightrays.raytracer.RayTracerEngine
All Implemented Interfaces:
java.awt.image.ImageProducer, java.lang.Runnable

public class RayTracerEngine
extends java.lang.Object
implements java.awt.image.ImageProducer, java.lang.Runnable

The Class RayTracerEngine.


Field Summary
 Camera camera
          The camera.
 
Constructor Summary
RayTracerEngine(java.awt.Dimension image_size)
          Instantiates a new ray tracer engine.
RayTracerEngine(java.awt.Dimension image_size, Scene scene, Camera camera)
          Instantiates a new ray tracer engine.
 
Method Summary
 void addConsumer(java.awt.image.ImageConsumer ic)
           
 int getHeight()
          Gets the height.
 double getPercentComplete()
          Gets the percent complete.
 Pixels getPixels()
          Gets the pixels.
 int getWidth()
          Gets the width.
 boolean isConsumer(java.awt.image.ImageConsumer ic)
           
 boolean isFinished()
          Checks if is finished.
 void removeConsumer(java.awt.image.ImageConsumer ic)
           
 void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
           
 void run()
           
 void setCamera(Camera camera)
          Sets the camera.
 void setRayTracerListener(RayTracerListener l)
          Sets the ray tracer listener.
 void setScene(Scene s)
          Sets the scene.
 void setSuperSampling(boolean flag)
          Sets the super sampling.
 void start()
          Start.
 void startProduction(java.awt.image.ImageConsumer ic)
           
 void traceLine(int y)
          Trace line.
 void traceLineSupersampling(int y)
          Trace line supersampling.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

camera

public Camera camera
The camera.

Constructor Detail

RayTracerEngine

public RayTracerEngine(java.awt.Dimension image_size)
Instantiates a new ray tracer engine.

Parameters:
image_size - the image_size

RayTracerEngine

public RayTracerEngine(java.awt.Dimension image_size,
                       Scene scene,
                       Camera camera)
Instantiates a new ray tracer engine.

Parameters:
image_size - the image_size
scene - the scene
camera - the camera
Method Detail

addConsumer

public void addConsumer(java.awt.image.ImageConsumer ic)
Specified by:
addConsumer in interface java.awt.image.ImageProducer

getHeight

public int getHeight()
Gets the height.

Returns:
the height

getPercentComplete

public double getPercentComplete()
Gets the percent complete.

Returns:
the percent complete

getPixels

public Pixels getPixels()
Gets the pixels.

Returns:
the pixels

getWidth

public int getWidth()
Gets the width.

Returns:
the width

isConsumer

public boolean isConsumer(java.awt.image.ImageConsumer ic)
Specified by:
isConsumer in interface java.awt.image.ImageProducer

isFinished

public boolean isFinished()
Checks if is finished.

Returns:
true, if is finished

removeConsumer

public void removeConsumer(java.awt.image.ImageConsumer ic)
Specified by:
removeConsumer in interface java.awt.image.ImageProducer

requestTopDownLeftRightResend

public void requestTopDownLeftRightResend(java.awt.image.ImageConsumer ic)
Specified by:
requestTopDownLeftRightResend in interface java.awt.image.ImageProducer

run

public void run()
Specified by:
run in interface java.lang.Runnable

setCamera

public void setCamera(Camera camera)
Sets the camera.

Parameters:
camera - the new camera

setRayTracerListener

public void setRayTracerListener(RayTracerListener l)
Sets the ray tracer listener.

Parameters:
l - the new ray tracer listener

setScene

public void setScene(Scene s)
Sets the scene.

Parameters:
s - the new scene

setSuperSampling

public void setSuperSampling(boolean flag)
Sets the super sampling.

Parameters:
flag - the new super sampling

start

public void start()
Start.


startProduction

public void startProduction(java.awt.image.ImageConsumer ic)
Specified by:
startProduction in interface java.awt.image.ImageProducer

traceLine

public void traceLine(int y)
Trace line.

Parameters:
y - the y

traceLineSupersampling

public void traceLineSupersampling(int y)
Trace line supersampling.

Parameters:
y - the y