Rings
Version 0.3

threeD.raytracer.surfaceUI
Class AbstractSurfaceUI

java.lang.Object
  extended bythreeD.raytracer.surfaceUI.AbstractSurfaceUI
All Implemented Interfaces:
Surface, SurfaceUI, SurfaceWrapper
Direct Known Subclasses:
SurfaceUIFactory.SurfaceUIImpl

public abstract class AbstractSurfaceUI
extends java.lang.Object
implements SurfaceUI

AbstractSurfaceUI is an abstract implementation of the SurfaceUI interface that takes care of all of the standard methods of SurfaceUI that all SurfaceUI implementations use in the same way. The name is "Surface" by default.


Field Summary
protected  AbstractSurface surface
           
 
Constructor Summary
AbstractSurfaceUI()
          Sets all values to the default.
AbstractSurfaceUI(AbstractSurface surface)
          Sets the underlying AbstractSurface object of this AbstractSurfaceUI to the specified AbstractSurface object.
AbstractSurfaceUI(AbstractSurface surface, java.lang.String name)
          Sets the underlying AbstractSurface object of this AbstractSurfaceUI to the specified AbstractSurface object and sets the name to the specified String object.
 
Method Summary
 RGB getColorAt(Vector point)
          Returns the color of this AbstractSurfaceUI at the specified point as an RGB object.
 Dialog getDialog()
          Returns null.
 javax.swing.Icon getIcon()
           
 java.lang.String getName()
          Returns the name of this AbstractSurfaceUI as a String object.
 Vector getNormalAt(Vector point)
          Returns a Vector object that represents the vector normal to this surface at the point represented by the specified Vector object.
 boolean getShadeBack()
          Returns the value returned by the getShadeBack() method of the underlying AbstractSurface stored by this AbstractSurfaceUI.
 boolean getShadeFront()
          Returns the value returned by the getShadeFront() method of the underlying AbstractSurface stored by this AbstractSurfaceUI.
 Surface getSurface()
          Returns the underlying AbstractSurface object stored by this AbstractSurfaceUI.
 boolean hasDialog()
          Returns false.
 boolean intersect(Ray ray)
          Returns true if the ray represented by the specified Ray object intersects the surface represented by this AbstractSurfaceUI in real space.
 Intersection intersectAt(Ray ray)
          Returns an Intersection object representing the point along the ray represented by the specified Ray object that intersection between the ray and the surface represented by this AbstractSurfaceUI occurs.
 void setName(java.lang.String name)
          Sets the name of this AbstractSurfaceUI to the specified String object.
 void setParent(SurfaceGroup parent)
          Sets the parent of the underlying AbstractSurface object stored by this AbstractSurfaceUI.
 void setSurface(AbstractSurface surface)
          Sets the underlying AbstractSurface object stored by this AbstractSurfaceUI to the specified AbstractSurface object.
 RGB shade(ShaderParameters parameters)
          Returns the value of shade() obtained from the AbstractSurface object stored by this AbstractSurfaceUI.
 java.lang.String toString()
          Returns the name of this AbstractSurfaceUI as a String object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface threeD.raytracer.surfaceUI.SurfaceUI
draw, getType
 

Field Detail

surface

protected AbstractSurface surface
Constructor Detail

AbstractSurfaceUI

public AbstractSurfaceUI()
Sets all values to the default.


AbstractSurfaceUI

public AbstractSurfaceUI(AbstractSurface surface)
Sets the underlying AbstractSurface object of this AbstractSurfaceUI to the specified AbstractSurface object.


AbstractSurfaceUI

public AbstractSurfaceUI(AbstractSurface surface,
                         java.lang.String name)
Sets the underlying AbstractSurface object of this AbstractSurfaceUI to the specified AbstractSurface object and sets the name to the specified String object.

Method Detail

getShadeFront

public boolean getShadeFront()
Returns the value returned by the getShadeFront() method of the underlying AbstractSurface stored by this AbstractSurfaceUI.

Specified by:
getShadeFront in interface Surface

getShadeBack

public boolean getShadeBack()
Returns the value returned by the getShadeBack() method of the underlying AbstractSurface stored by this AbstractSurfaceUI.

Specified by:
getShadeBack in interface Surface

setName

public void setName(java.lang.String name)
Sets the name of this AbstractSurfaceUI to the specified String object.

Specified by:
setName in interface SurfaceUI

getName

public java.lang.String getName()
Returns the name of this AbstractSurfaceUI as a String object.

Specified by:
getName in interface SurfaceUI

hasDialog

public boolean hasDialog()
Returns false.

Specified by:
hasDialog in interface SurfaceUI

getDialog

public Dialog getDialog()
Returns null.

Specified by:
getDialog in interface SurfaceUI

getIcon

public javax.swing.Icon getIcon()
Specified by:
getIcon in interface SurfaceUI
Returns:
An icon that shows the color of the underlying surface object.

setParent

public void setParent(SurfaceGroup parent)
Sets the parent of the underlying AbstractSurface object stored by this AbstractSurfaceUI.

Parameters:
parent - The new parent

setSurface

public void setSurface(AbstractSurface surface)
Sets the underlying AbstractSurface object stored by this AbstractSurfaceUI to the specified AbstractSurface object.


getSurface

public Surface getSurface()
Returns the underlying AbstractSurface object stored by this AbstractSurfaceUI.

Specified by:
getSurface in interface SurfaceWrapper

toString

public java.lang.String toString()
Returns the name of this AbstractSurfaceUI as a String object.


getColorAt

public RGB getColorAt(Vector point)
Returns the color of this AbstractSurfaceUI at the specified point as an RGB object.

Specified by:
getColorAt in interface Surface

getNormalAt

public Vector getNormalAt(Vector point)
Returns a Vector object that represents the vector normal to this surface at the point represented by the specified Vector object.

Specified by:
getNormalAt in interface Surface

intersect

public boolean intersect(Ray ray)
Returns true if the ray represented by the specified Ray object intersects the surface represented by this AbstractSurfaceUI in real space.

Specified by:
intersect in interface Surface

intersectAt

public Intersection intersectAt(Ray ray)
Returns an Intersection object representing the point along the ray represented by the specified Ray object that intersection between the ray and the surface represented by this AbstractSurfaceUI occurs.

Specified by:
intersectAt in interface Surface

shade

public RGB shade(ShaderParameters parameters)
Returns the value of shade() obtained from the AbstractSurface object stored by this AbstractSurfaceUI.

Specified by:
shade in interface Surface
See Also:
Shader

Rings
Version 0.3

Copyright 2003-05 Mike Murray