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

## threeD.raytracer.shaders
Class RefractionShader

    java.lang.Object
      threeD.raytracer.shaders.RefractionShader

All Implemented Interfaces:
  ColorProducer, Editable, Producer, Shader

public class RefractionShader
extends java.lang.Object
implements Shader, Editable

A RefractionShader object provides a shading method for dielectric surfaces.

Nested Class Summary

Nested classes inherited from class threeD.raytracer.util.Editable
`Editable.Selection`

Field Summary
`static boolean` | `produceOutput`

Constructor Summary
`RefractionShader()` Constructs a new RefractionShader object.

Method Summary
`RGB` | `evaluate(java.lang.Object[] args)` Produces a color using the specified arguments.
`double[]` | `getAttenuationFactors()` Returns the 3 attenuation factors (RGB) used by this RefractionShader object.
`double` | `getIndexOfRefraction()` Returns the index of refraction value used by this RefractionShader object.
`Producer[]` | `getInputPropertyValues()`
`java.lang.String[]` | `getPropertyDescriptions()` Returns an array of String objects with descriptions for each editable property of this RefractionShader object.
`java.lang.String[]` | `getPropertyNames()` Returns an array of String objects with names for each editable property of this RefractionShader object.
`java.lang.Class[]` | `getPropertyTypes()` Returns an array of Class objects representing the class types of each editable property of this RefractionShader object.
`java.lang.Object[]` | `getPropertyValues()` Returns the values of the properties of this ReflectionShader object as an Object array.
`Vector` | `refract(Vector n, Vector d)`
`void` | `setAttenuationFactors(double r, double g, double b)` Sets the attenuation factors used by this RefractionShader object.
`void` | `setIndexOfRefraction(double n)` Sets the index of refraction value used by this RefractionShader object.
`void` | `setInputPropertyValue(int index, Producer p)` Does nothing.
`void` | `setPropertyValue(java.lang.Object value, int index)` Sets the value of the property of this RefractionShader object at the specified index to the specified value.
`void` | `setPropertyValues(java.lang.Object[] values)` Sets the values of editable properties of this ReflectionShader object to those specified.
`RGB` | `shade(ShaderParameters p)` Method specified by the Shader interface.
`RGB` | `shade(Vector point, Vector viewerDirection, Vector lightDirection, Light light, Light[] otherLights, Surface surface, Surface[] otherSurfaces, Vector n)`
`java.lang.String` | `toString()` Returns "Refraction Shader".

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### produceOutput

    public static boolean produceOutput

Constructor Detail

### RefractionShader

    public RefractionShader()

  Constructs a new RefractionShader object.

Method Detail

### shade

    public RGB shade(ShaderParameters p)

  Method specified by the Shader interface.

  Specified by:
    `shade` in interface `Shader`

### shade

    public RGB shade(Vector point,
                     Vector viewerDirection,
                     Vector lightDirection,
                     Light light,
                     Light[] otherLights,
                     Surface surface,
                     Surface[] otherSurfaces,
                     Vector n)

### refract

    public Vector refract(Vector n,
                          Vector d)

### 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.

### setIndexOfRefraction

    public void setIndexOfRefraction(double n)

  Sets the index of refraction value used by this RefractionShader object.

### setAttenuationFactors

    public void setAttenuationFactors(double r,
                                      double g,
                                      double b)

  Sets the attenuation factors used by this RefractionShader object.

### getIndexOfRefraction

    public double getIndexOfRefraction()

  Returns the index of refraction value used by this RefractionShader object.

### getAttenuationFactors

    public double[] getAttenuationFactors()

  Returns the 3 attenuation factors (RGB) used by this RefractionShader object.

### getPropertyNames

    public java.lang.String[] getPropertyNames()

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

  Specified by:
    `getPropertyNames` in interface `Editable`

### getPropertyDescriptions

    public java.lang.String[] getPropertyDescriptions()

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

  Specified by:
    `getPropertyDescriptions` in interface `Editable`

### getPropertyTypes

    public java.lang.Class[] getPropertyTypes()

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

  Specified by:
    `getPropertyTypes` in interface `Editable`

### getPropertyValues

    public java.lang.Object[] getPropertyValues()

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

  Specified by:
    `getPropertyValues` in interface `Editable`

### setPropertyValue

    public void setPropertyValue(java.lang.Object value,
                                 int index)

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

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

### 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.

### setPropertyValues

    public void setPropertyValues(java.lang.Object[] values)

  Sets the values of editable properties of this ReflectionShader object to those specified.

  Specified by:
    `setPropertyValues` in interface `Editable`
  Throws:
    `java.lang.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)
    `java.lang.IndexOutOfBoundsException` - If the length of the specified array is longer than permitted.

### toString

    public java.lang.String toString()

  Returns "Refraction Shader".

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

Copyright 2003-05 Mike Murray