de.grogra.ray2.tracing
Class RayProcessorBase

java.lang.Object
  extended by de.grogra.ray2.tracing.ProcessorBase
      extended by de.grogra.ray2.tracing.RayProcessorBase
All Implemented Interfaces:
RayProcessor, java.lang.Cloneable
Direct Known Subclasses:
DefaultRayProcessor, PathTracer, PhotonMapRayProcessor, Radiosity

public abstract class RayProcessorBase
extends ProcessorBase
implements RayProcessor


Nested Class Summary
 class RayProcessorBase.Locals
           
 
Field Summary
 java.util.ArrayList<Volume> enteredSolids
           
static java.lang.String RECURSION_DEPTH
           
protected  PixelwiseRenderer renderer
           
 Scene scene
           
protected  Tuple3d sumColor
           
 
Constructor Summary
RayProcessorBase()
           
 
Method Summary
 RayProcessor dup(Scene scene)
          Returns a clone of this RayProcessor.
 void getColorFromRay(Line ray, Spectrum resp, Color4f color, java.util.Random random)
          The main method of a ray processor.
 double getIOR(Intersection is, Spectrum spec)
           
 LightProcessor getLightProcessor()
           
 void initialize(PixelwiseRenderer renderer, Scene scene)
          With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.
 void initializeBeforeTracing(java.util.Random random)
          With this method the processor is initialized with the Randomizer actually before starting the ray tracing.
protected  void initLocals()
           
protected  void mergeStatistics(ProcessorBase src)
           
 int record(Intersection is, boolean reflected)
           
 double record(Intersection is, boolean push, Spectrum spec)
          Deprecated. 
 void setLightProcessor(LightProcessor proc)
           
 void setRecursionDepth(int value)
           
 void unrecord(Intersection is, int index)
           
 
Methods inherited from class de.grogra.ray2.tracing.ProcessorBase
appendStatistics, appendStatisticsImpl, clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.ray2.tracing.RayProcessor
appendStatistics
 

Field Detail

enteredSolids

public java.util.ArrayList<Volume> enteredSolids

RECURSION_DEPTH

public static final java.lang.String RECURSION_DEPTH
See Also:
Constant Field Values

renderer

protected PixelwiseRenderer renderer

scene

public Scene scene

sumColor

protected Tuple3d sumColor
Constructor Detail

RayProcessorBase

public RayProcessorBase()
Method Detail

dup

public RayProcessor dup(Scene scene)
Description copied from interface: RayProcessor
Returns a clone of this RayProcessor. All constant variables are copied shallowly, state variables are newly created and copied where necessary.

Specified by:
dup in interface RayProcessor
Parameters:
scene - duplicate of scene
Returns:
clone of this ray processor

getColorFromRay

public void getColorFromRay(Line ray,
                            Spectrum resp,
                            Color4f color,
                            java.util.Random random)
Description copied from interface: RayProcessor
The main method of a ray processor. This method computes a color for the specified ray. color.w contains the alpha value for the ray, the other components are premultiplied with this alpha value.

Specified by:
getColorFromRay in interface RayProcessor
Parameters:
ray - input - calculate for this ray
resp - responsivity of camera
color - output - the calculated color
random - pseudorandom generator

getIOR

public double getIOR(Intersection is,
                     Spectrum spec)

getLightProcessor

public LightProcessor getLightProcessor()

initialize

public void initialize(PixelwiseRenderer renderer,
                       Scene scene)
Description copied from interface: RayProcessor
With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.

Specified by:
initialize in interface RayProcessor
Parameters:
renderer - the renderer which provides the needed information
scene - the scene which is rendered

initializeBeforeTracing

public void initializeBeforeTracing(java.util.Random random)
Description copied from interface: RayProcessor
With this method the processor is initialized with the Randomizer actually before starting the ray tracing.

Specified by:
initializeBeforeTracing in interface RayProcessor
Parameters:
random - pseudorandom generator

initLocals

protected void initLocals()
Overrides:
initLocals in class ProcessorBase

mergeStatistics

protected void mergeStatistics(ProcessorBase src)
Overrides:
mergeStatistics in class ProcessorBase

record

public int record(Intersection is,
                  boolean reflected)

record

@Deprecated
public double record(Intersection is,
                                boolean push,
                                Spectrum spec)
Deprecated. 


setLightProcessor

public void setLightProcessor(LightProcessor proc)

setRecursionDepth

public void setRecursionDepth(int value)

unrecord

public void unrecord(Intersection is,
                     int index)