Rings
Version 0.3

threeD.raytracer.textures
Class StripeTexture

java.lang.Object
  extended bythreeD.raytracer.textures.StripeTexture
All Implemented Interfaces:
ColorProducer, Editable, Producer, Texture

public class StripeTexture
extends java.lang.Object
implements Texture, Editable

The StripeTexture object can be used to stripe a surface.


Nested Class Summary
 
Nested classes inherited from class threeD.raytracer.util.Editable
Editable.Selection
 
Constructor Summary
StripeTexture()
          Constructs a StripeTexture object that can be used to stripe a surface.
StripeTexture(java.lang.Object[] props)
          Constructs a StripeTexture object using the specified properties.
 
Method Summary
 RGB evaluate(java.lang.Object[] args)
          Produces a color using the specified arguments.
 RGB getColorAt(Vector point)
          Returns the color of the texture represented by this Texture object at the specified point as an RGB object using the arguments stored by this Texture object.
 RGB getColorAt(Vector point, java.lang.Object[] props)
          Returns the color of the texture represented by this Texture object at the specified point as an RGB object using the specified arguments.
 Producer[] getInputPropertyValues()
           
 java.lang.String[] getPropertyDescriptions()
          Returns an array of String objects with descriptions for each editable property of this Editable object.
 java.lang.String[] getPropertyNames()
          Returns an array of String objects with names for each editable property of this Editable object.
 java.lang.Class[] getPropertyTypes()
          Returns an array of Class objects representing the class types of each editable property of this Editable object.
 java.lang.Object[] getPropertyValues()
          Returns the values of the properties of this Editable object as an Object array.
 void setInputPropertyValue(int index, Producer p)
          Sets the values of properties of this HighlightShader object to those specified.
 void setPropertyValue(java.lang.Object value, int index)
          Sets the value of the property of this StripeTexture object at the specified index to the specified value.
 void setPropertyValues(java.lang.Object[] values)
          Sets the values of properties of this StripeTexture object to those specified.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StripeTexture

public StripeTexture()
Constructs a StripeTexture object that can be used to stripe a surface. The default colors are black and white with a stripe width of 1.0 that is solid (not smooth) across the x axis.


StripeTexture

public StripeTexture(java.lang.Object[] props)
Constructs a StripeTexture object using the specified properties.

Method Detail

getColorAt

public RGB getColorAt(Vector point)
Description copied from interface: Texture
Returns the color of the texture represented by this Texture object at the specified point as an RGB object using the arguments stored by this Texture object.

Specified by:
getColorAt in interface Texture
Returns:
The color of the texture represented by this StripeTexture object at the specified point as an RGB object.

getColorAt

public RGB getColorAt(Vector point,
                      java.lang.Object[] props)
Description copied from interface: Texture
Returns the color of the texture represented by this Texture object at the specified point as an RGB object using the specified arguments.

Specified by:
getColorAt in interface Texture
Returns:
The color of the texture represented by this StripeTexture object at the specified point as an RGB object.
Throws:
java.lang.IllegalArgumentException - If one of the objects specified is not of the correct type.

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:
The RGB color produced.
Throws:
java.lang.IllegalArgumentException - If args does not contain the correct object types.
See Also:
ColorProducer.evaluate(java.lang.Object[])

getPropertyNames

public java.lang.String[] getPropertyNames()
Description copied from interface: Editable
Returns an array of String objects with names for each editable property of this Editable object.

Specified by:
getPropertyNames in interface Editable
Returns:
An array of String objects with names for each editable property of this StripeTexture object.

getPropertyDescriptions

public java.lang.String[] getPropertyDescriptions()
Description copied from interface: Editable
Returns an array of String objects with descriptions for each editable property of this Editable object.

Specified by:
getPropertyDescriptions in interface Editable
Returns:
An array of String objects with descriptions for each editable property of this StripeTexture object.

getPropertyTypes

public java.lang.Class[] getPropertyTypes()
Description copied from interface: Editable
Returns an array of Class objects representing the class types of each editable property of this Editable object.

Specified by:
getPropertyTypes in interface Editable
Returns:
An array of Class objects representing the class types of each editable property of this StripeTexture object.

getPropertyValues

public java.lang.Object[] getPropertyValues()
Description copied from interface: Editable
Returns the values of the properties of this Editable object as an Object array.

Specified by:
getPropertyValues in interface Editable
Returns:
The values of the properties of this StripeTexture object as an Object array.

setPropertyValue

public void setPropertyValue(java.lang.Object value,
                             int index)
Sets the value of the property of this StripeTexture 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 StripeTexture object.

setPropertyValues

public void setPropertyValues(java.lang.Object[] values)
Sets the values of properties of this StripeTexture 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.

getInputPropertyValues

public Producer[] getInputPropertyValues()
Specified by:
getInputPropertyValues in interface Editable
Returns:
{first color, second 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:
java.lang.IllegalArgumentException - If the Producer object specified is not of the correct type.
java.lang.IndexOutOfBoundsException - If the index > 1.

toString

public java.lang.String toString()
Returns:
"Stripe Texture".

Rings
Version 0.3

Copyright 2003-05 Mike Murray