threeD.raytracer.shaders
Class ShaderSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
threeD.raytracer.shaders.ShaderSet
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, ColorProducer, Producer, java.io.Serializable, java.util.Set, Shader
- Direct Known Subclasses:
- HighlightShader, ReflectionShader, TextureShader
- public class ShaderSet
- extends java.util.HashSet
- implements Shader
- See Also:
- Serialized Form
|
Method Summary |
boolean |
add(java.lang.Object o)
Adds the specified Object to this set and returns true. |
boolean |
addAll(java.util.Collection c)
Adds all of the elements stored by the specified Collection object to this set.
|
RGB |
evaluate(java.lang.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. |
java.lang.String |
toString()
|
| Methods inherited from class java.util.HashSet |
clear, clone, contains, isEmpty, iterator, remove, size |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
containsAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
ShaderSet
public ShaderSet()
add
public boolean add(java.lang.Object o)
- Adds the specified Object to this set and returns true.
- Specified by:
add in interface java.util.Set
- Throws:
java.lang.IllegalArgumentException - If the specified Object is not an instance of Shader.
addAll
public boolean addAll(java.util.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 java.util.Set
- Throws:
java.lang.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.
java.lang.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(java.lang.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:
java.lang.IllegalArgumentException - If args[0] is not a ShaderParameters object.
toString
public java.lang.String toString()
- Returns:
- "ShaderSet".
Copyright 2003-05 Mike Murray