threeD.raytracer.engine
Class ShaderSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
threeD.raytracer.engine.ShaderSet
- All Implemented Interfaces:
- Cloneable, Collection, ColorProducer, Producer, Serializable, Set, Shader
- Direct Known Subclasses:
- HighlightShader, ReflectionShader, TextureShader
- public class ShaderSet
- extends HashSet
- implements Shader
- See Also:
- Serialized Form
|
Method Summary |
boolean |
add(Object o)
Adds the specified Object to this set and returns true. |
boolean |
addAll(Collection c)
Adds all of the elements stored by the specified Collection object to this set.
|
RGB |
evaluate(Object[] args)
Produces a color using the specified arguments. |
RGB |
shade(ShaderParameters p)
Returns an RGB object that represents the shaded color calculated using the values
of the specified ShaderParameters object. |
String |
toString()
|
ShaderSet
public ShaderSet()
add
public boolean add(Object o)
- Adds the specified Object to this set and returns true.
- Specified by:
add in interface Set
- Throws:
IllegalArgumentException - If the specified Object is not an instance of Shader.
addAll
public boolean addAll(Collection c)
- Adds all of the elements stored by the specified Collection object to this set.
Returns true if the set changed as a result.
- Specified by:
addAll in interface Set
- Throws:
IllegalArgumentException - If an element in the specified Collection object is not
an instance of Shader. Note: Elements that have not yet been added
to the set at the time this error occurs will not be added.
NullPointerException - If the specified Collection object is null.
shade
public RGB shade(ShaderParameters p)
- Description copied from interface:
Shader
- Returns an RGB object that represents the shaded color calculated using the values
of the specified ShaderParameters object.
- Specified by:
shade in interface Shader
- Returns:
- The sum of the values given by the shade method for each Shader object stored by this ShaderSet object.
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.
toString
public String toString()
- Returns:
- "ShaderSet".
Copyright 2003-05 Mike Murray