Rings
Version 0.2

threeD.raytracer.engine
Class DiffuseShader

java.lang.Object
  extended bythreeD.raytracer.engine.DiffuseShader
All Implemented Interfaces:
ColorProducer, Editable, Producer, Shader

public class DiffuseShader
extends Object
implements Shader, Editable

A DiffuseShader object provides a shading method for diffuse surfaces. The DiffuseShader class uses a lambertian shading algorithm.


Nested Class Summary
 
Nested classes inherited from class threeD.raytracer.util.Editable
Editable.Selection
 
Constructor Summary
DiffuseShader()
          Constructs a new DiffuseShader object.
 
Method Summary
 RGB evaluate(Object[] args)
          Produces a color using the specified arguments.
 Producer[] getInputPropertyValues()
           
 String[] getPropertyDescriptions()
          Returns a zero length array.
 String[] getPropertyNames()
          Returns a zero length array.
 Class[] getPropertyTypes()
          Returns a zero length array.
 Object[] getPropertyValues()
          Returns a zero length array.
 void setInputPropertyValue(int index, Producer p)
          Does nothing.
 void setPropertyValue(Object value, int index)
          Sets the value of the property of this Editable object at the specified index to the specified value.
 void setPropertyValues(Object[] values)
          Does nothing.
 RGB shade(ShaderParameters p)
          Method specified by the Shader interface.
 String toString()
          Returns "Diffuse Shader".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiffuseShader

public DiffuseShader()
Constructs a new DiffuseShader object.

Method Detail

shade

public RGB shade(ShaderParameters p)
Method specified by the Shader interface.

Specified by:
shade in interface Shader

evaluate

public RGB evaluate(Object[] args)
Description copied from interface: ColorProducer
Produces a color using the specified arguments.

Specified by:
evaluate in interface ColorProducer
Parameters:
args - Arguments.
Returns:
this.shade(args[0]).
Throws:
IllegalArgumentException - If args[0] is not a ShaderParameters object.

getPropertyNames

public String[] getPropertyNames()
Returns a zero length array.

Specified by:
getPropertyNames in interface Editable

getPropertyDescriptions

public String[] getPropertyDescriptions()
Returns a zero length array.

Specified by:
getPropertyDescriptions in interface Editable

getPropertyTypes

public Class[] getPropertyTypes()
Returns a zero length array.

Specified by:
getPropertyTypes in interface Editable

getPropertyValues

public Object[] getPropertyValues()
Returns a zero length array.

Specified by:
getPropertyValues in interface Editable

setPropertyValue

public void setPropertyValue(Object value,
                             int index)
Description copied from interface: Editable
Sets the value of the property of this Editable object at the specified index to the specified value.

Specified by:
setPropertyValue in interface Editable
Throws:
IndexOutOfBoundsException

setPropertyValues

public void setPropertyValues(Object[] values)
Does nothing.

Specified by:
setPropertyValues in interface Editable

getInputPropertyValues

public Producer[] getInputPropertyValues()
Specified by:
getInputPropertyValues in interface Editable
Returns:
An empty array.

setInputPropertyValue

public void setInputPropertyValue(int index,
                                  Producer p)
Does nothing.

Specified by:
setInputPropertyValue in interface Editable
Parameters:
index - Index of input property (array index from this.getInputPropertyValue).
p - Producer object to use for input property.

toString

public String toString()
Returns "Diffuse Shader".


Rings
Version 0.2

Copyright 2003-05 Mike Murray