|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectthreeD.raytracer.engine.AbstractSurface
AbstractSurface is an abstract implementation of Surface that takes care of all of the standard methods of Surface that are shared by all Surface implementations in the same way. By default the location is at the origin, the size is 1.0, and the color is black. Also, an AbstractSurface uses a DiffuseShader by default.
| Constructor Summary | |
AbstractSurface()
Sets all values of this AbstractSurface to the defaults specified above. |
|
AbstractSurface(Vector location,
double size)
Sets the location and size of this AbstractSurface to those specifed, and uses the defaults for the other values. |
|
AbstractSurface(Vector location,
double size,
RGB color)
Sets the location, size, and color of this AbstractSurface to those specified. |
|
| Method Summary | |
void |
addShader(Shader shader)
Appends the specified Shader object to the list of Shader objects used to shade this AbstractSurface. |
void |
addTexture(Texture texture)
Appends the specified Texture object to the list of Texture objects used to color this AbstractSurface. |
void |
addTransform(TransformMatrix transform)
Applies the transformation represented by the specified TransformMatrix to this AbstractSurface when it is rendered. |
void |
calculateTransform()
Calculates the complete transformation that will be applied to this AbstractSurface when it is rendered and stores it for later use. |
RGB |
getColor()
Returns the color of this AbstractSurface as an RGB object. |
RGB |
getColorAt(Vector point)
Returns the color of this AbstractSurface at the specified point as an RGB object. |
Vector |
getLocation()
Returns the location of this AbstractSurface as a Vector object. |
SurfaceGroup |
getParent()
Returns the parent of this AbstractSurface as a SurfaceGroup object. |
double[] |
getRotationCoefficients()
Returns an array of double values containing the angle measurements (in radians) used to rotate this AbstractSurface about the x, y, and z axes when it is rendered as an array of double values. |
double[] |
getScaleCoefficients()
Returns an array of double values containing the values used to scale this AbstractSurface on the x, y, and z axes when it is rendered. |
boolean |
getShadeBack()
Returns true if the back side of this AbstractSurface should be shaded. |
boolean |
getShadeFront()
Returns true if the front side of this AbstractSurface should be shaded. |
ShaderSet |
getShaderSet()
Returns a Set object that maintains the Shader objects stored by this AbstractSurface. |
double |
getSize()
Returns the size of this AbstractSurface as a double value. |
Texture |
getTexture(int index)
Returns the Texture object at the specified index in the list of Texture objects used to color this AbstractSurface. |
Texture[] |
getTextures()
Returns the list of Texture objects used to color this AbstractSurface as an array of Texture objects. |
java.util.Set |
getTextureSet()
Returns a Set object that maintains the Texture objects stored by this AbstractSurface. |
TransformMatrix |
getTransform()
Returns the TransformMatrix object used to transform this AbstractSurface when it is rendered. |
TransformMatrix |
getTransform(boolean include)
Returns the TransformMatrix object used to transform this AbstractSurface when it is rendered. |
TransformMatrix[] |
getTransforms()
Returns the TransformMatrix objects used to transform this Surface object when it is rendered as an array of TransformMatrix objects. |
void |
removeTexture(int index)
Removes the Texture object at the specified index from the list of Texture objects used to color this AbstractSurface. |
void |
removeTransform(int index)
Removes the TransformMatrix object at the specified index from this Surface object. |
void |
setColor(RGB color)
Sets the color of this AbstractSurface to the color represented by the specified RGB object. |
void |
setLocation(Vector location)
Sets the location of this AbstractSurface to the specified Vector object. |
void |
setParent(SurfaceGroup parent)
Sets the parent surface group of this AbstractSurface to the specified SurfaceGroup object. |
void |
setRotationCoefficients(double x,
double y,
double z)
Sets the angle measurements (in radians) used to rotate this AbstractSurface about the x, y, and z axes when it is rendered to the specified double values. |
void |
setScaleCoefficients(double x,
double y,
double z)
Sets the values used to scale this AbstractSurface on the x, y, and z axes when it is rendered to the specified double values. |
void |
setShadeBack(boolean shade)
Sets the flag indicating that the back side of this AbstractSurface should be shaded to the specified boolean value. |
void |
setShadeFront(boolean shade)
Sets the flag indicating that the front side of this AbstractSurface should be shaded to the specified boolean value. |
void |
setShaders(Shader[] shaders)
Sets the Shader objects (used to shade this AbstractSurface) to those specified. |
void |
setSize(double size)
Sets the size of this AbstractSurface to the specified double value. |
void |
setTexture(int index,
Texture texture)
Sets the Texture object (used to color this AbstractSurface) at the specified index to the specified Texture object. |
void |
setTextures(Texture[] textures)
Sets the Texture objects (used to color this AbstractSurface) to those specified. |
void |
setTransform(int index,
TransformMatrix transform)
Sets the TransformMatrix object at the specified index used to transform this Surface object when it is rendered to the TransformMatrix object specified. |
void |
setTransforms(TransformMatrix[] transforms)
Sets the TransformMatrix objects used to transform this AbstractSurface when it is rendered to those stored in the specified TransformMatrix object array. |
RGB |
shade(ShaderParameters p)
Calculates a color value for this AbstractSurface using the sum of the values calculated by the Shader objects stored by this AbstractSurface and the parent of this AbstractSurface and returns this value as an RGB object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface threeD.raytracer.engine.Surface |
getNormalAt, intersect, intersectAt |
| Constructor Detail |
public AbstractSurface()
public AbstractSurface(Vector location,
double size)
public AbstractSurface(Vector location,
double size,
RGB color)
| Method Detail |
public void setParent(SurfaceGroup parent)
public SurfaceGroup getParent()
public void setShadeFront(boolean shade)
public void setShadeBack(boolean shade)
public boolean getShadeFront()
getShadeFront in interface Surfacepublic boolean getShadeBack()
getShadeBack in interface Surfacepublic void setLocation(Vector location)
public void setSize(double size)
public void setScaleCoefficients(double x,
double y,
double z)
public void setRotationCoefficients(double x,
double y,
double z)
public void setTransform(int index,
TransformMatrix transform)
public void setTransforms(TransformMatrix[] transforms)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic void addTransform(TransformMatrix transform)
public void removeTransform(int index)
public void calculateTransform()
public void setTexture(int index,
Texture texture)
public void setTextures(Texture[] textures)
public void addTexture(Texture texture)
public void removeTexture(int index)
public java.util.Set getTextureSet()
public void setShaders(Shader[] shaders)
public void addShader(Shader shader)
public ShaderSet getShaderSet()
public RGB shade(ShaderParameters p)
shade in interface SurfaceShaderpublic void setColor(RGB color)
public Vector getLocation()
public double getSize()
public double[] getScaleCoefficients()
public double[] getRotationCoefficients()
public TransformMatrix getTransform()
public TransformMatrix getTransform(boolean include)
public TransformMatrix[] getTransforms()
public Texture getTexture(int index)
public Texture[] getTextures()
public RGB getColor()
public RGB getColorAt(Vector point)
getColorAt in interface Surface
|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||