Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.j3d.threeD.raytracer.shaders
Class HighlightShader

    java.lang.Object
      java.util.AbstractCollection<E>
          java.util.AbstractSet<E>
              java.util.HashSet
                  net.sf.j3d.threeD.raytracer.shaders.ShaderSet
                      net.sf.j3d.threeD.raytracer.shaders.HighlightShader

All Implemented Interfaces:
  Serializable, Cloneable, Iterable, Collection, Set, ColorProducer, Shader, Editable, Producer

    public class HighlightShader

extends ShaderSet
implements Shader, Editable

A HighlightShader object provides a shading method for highlights on surfaces. The HighlightShader class uses a phong shading algorithm.

Author:
  Mike Murray
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface net.sf.j3d.threeD.raytracer.util.Editable
`Editable.Selection`

Constructor Summary
`HighlightShader()` Constructs a new HighlightShader object using white as a highlight color and 1.0 as a highlight exponent.
`HighlightShader(ColorProducer color, double exponent)` Constructs a new HighlightShader object using the specified highlight color and highlight exponent.

Method Summary
`RGB` | `evaluate(Object[] args)` Produces a color using the specified arguments.
`ColorProducer` | `getHighlightColor()` Returns the color used for the highlight shaded by this HighlightShader object as an ColorProducer object.
`double` | `getHighlightExponent()` Returns the highlight exponent (phong exponent) used by this HighlightShader object.
`Producer[]` | `getInputPropertyValues()`
`String[]` | `getPropertyDescriptions()` Returns an array of String objects with descriptions for each editable property of this HighlightShader object.
`String[]` | `getPropertyNames()` Returns an array of String objects with names for each editable property of this HighlightShader object.
`Class[]` | `getPropertyTypes()` Returns an array of Class objects representing the class types of each editable property of this HighlightShader object.
`Object[]` | `getPropertyValues()` Returns the values of the properties of this HighlightShader object as an Object array.
`void` | `setHighlightColor(ColorProducer color)` Sets the color used for the highlight shaded by this HighlightShader object to the color represented by the specifed RGB object.
`void` | `setHighlightExponent(double exp)` Sets the highlight exponent (phong exponent) used by this HighlightShader object.
`void` | `setInputPropertyValue(int index, Producer p)` Sets the values of properties of this HighlightShader object to those specified.
`void` | `setPropertyValue(Object value, int index)` Sets the value of the property of this HighlightShader object at the specified index to the specified value.
`void` | `setPropertyValues(Object[] values)` Sets the values of properties of this HighlightShader object to those specified.
`RGB` | `shade(ShaderParameters p)` Method specified by the Shader interface.
`String` | `toString()` Returns "Highlight Shader".

Methods inherited from class net.sf.j3d.threeD.raytracer.shaders.ShaderSet
`add, addAll, equals`

Methods inherited from class java.util.HashSet
`clear, clone, contains, isEmpty, iterator, remove, size`

Methods inherited from class java.util.AbstractSet
`hashCode, removeAll`

Methods inherited from class java.util.AbstractCollection
`containsAll, retainAll, toArray, toArray`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Set
`containsAll, hashCode, removeAll, retainAll, toArray, toArray`

Constructor Detail

### HighlightShader

    public HighlightShader()

  Constructs a new HighlightShader object using white as a highlight color and 1.0 as a highlight exponent.

### HighlightShader

    public HighlightShader(ColorProducer color,
                           double exponent)

  Constructs a new HighlightShader object using the specified highlight color and highlight exponent.

Method Detail

### shade

    public RGB shade(ShaderParameters p)

  Method specified by the Shader interface.

  Specified by:
    `shade` in interface `Shader`
  Overrides:
    `shade` in class `ShaderSet`
  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`
  Overrides:
    `evaluate` in class `ShaderSet`
  Parameters:
    `args` - Arguments.
  Returns:
    this.shade(args[0]).
  Throws:
    `IllegalArgumentException` - If args[0] is not a ShaderParameters object.

### setHighlightColor

    public void setHighlightColor(ColorProducer color)

  Sets the color used for the highlight shaded by this HighlightShader object to the color represented by the specifed RGB object.

### setHighlightExponent

    public void setHighlightExponent(double exp)

  Sets the highlight exponent (phong exponent) used by this HighlightShader object.

### getHighlightColor

    public ColorProducer getHighlightColor()

  Returns the color used for the highlight shaded by this HighlightShader object as an ColorProducer object.

### getHighlightExponent

    public double getHighlightExponent()

  Returns the highlight exponent (phong exponent) used by this HighlightShader object.

### getPropertyNames

    public String[] getPropertyNames()

  Returns an array of String objects with names for each editable property of this HighlightShader object.

  Specified by:
    `getPropertyNames` in interface `Editable`

### getPropertyDescriptions

    public String[] getPropertyDescriptions()

  Returns an array of String objects with descriptions for each editable property of this HighlightShader object.

  Specified by:
    `getPropertyDescriptions` in interface `Editable`

### getPropertyTypes

    public Class[] getPropertyTypes()

  Returns an array of Class objects representing the class types of each editable property of this HighlightShader object.

  Specified by:
    `getPropertyTypes` in interface `Editable`

### getPropertyValues

    public Object[] getPropertyValues()

  Returns the values of the properties of this HighlightShader object as an Object array.

  Specified by:
    `getPropertyValues` in interface `Editable`

### setPropertyValue

    public void setPropertyValue(Object value,
                                 int index)

  Sets the value of the property of this HighlightShader object at the specified index to the specified value.

  Specified by:
    `setPropertyValue` in interface `Editable`
  Throws:
    `IllegalArgumentException` - If the object specified is not of the correct type.
    `IndexOutOfBoundsException` - If the index specified does not correspond to an editable property of this HighlightShader object.

### setPropertyValues

    public void setPropertyValues(Object[] values)

  Sets the values of properties of this HighlightShader object to those specified.

  Specified by:
    `setPropertyValues` in interface `Editable`
  Throws:
    `IllegalArgumentException` - If one of the objects specified is not of the correct type. (Note: none of the values after the erroneous value will be set)
    `IndexOutOfBoundsException` - If the length of the specified array is longer than permitted.

### getInputPropertyValues

    public Producer[] getInputPropertyValues()

  Specified by:
    `getInputPropertyValues` in interface `Editable`
  Returns:
    {highlight color}.

### setInputPropertyValue

    public void setInputPropertyValue(int index,
                                      Producer p)

  Sets the values of properties of this HighlightShader object to those specified.

  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.
  Throws:
    `IllegalArgumentException` - If the Producer object specified is not of the correct type.
    `IndexOutOfBoundsException` - If the lindex != 0;

### toString

    public String toString()

  Returns "Highlight Shader".

  Overrides:
    `toString` in class `ShaderSet`
  Returns:
    "ShaderSet".

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD