Rings
Version 0.2

threeD.raytracer.surfaceUI
Class TriangleUI

java.lang.Object
  extended bythreeD.raytracer.surfaceUI.AbstractSurfaceUI
      extended bythreeD.raytracer.surfaceUI.TriangleUI
All Implemented Interfaces:
Surface, SurfaceUI, SurfaceWrapper

public class TriangleUI
extends AbstractSurfaceUI

A TriangleUI object is an extension of the basic Triangle object that can be used in an application with a user interface.


Field Summary
 
Fields inherited from class threeD.raytracer.surfaceUI.AbstractSurfaceUI
surface
 
Constructor Summary
TriangleUI()
          Constructs a new TriangleUI object that represents a triangle with all 3 vertices at the origin that is black.
TriangleUI(Triangle triangle)
          Constructs a new TriangleUI object based on the specified Triangle object.
TriangleUI(Vector p1, Vector p2, Vector p3)
          Cunstructs a new TriangleUI object using the specified vertices that is black.
TriangleUI(Vector p1, Vector p2, Vector p3, RGB color)
          Constructs a new TriangleUI object using the specified vertices and the color represented by the specified RGB object.
 
Method Summary
 void draw(Graphics g, Camera camera)
          Draws a simple representation of the triangle represented by this TriangleUI object on the specified graphics object using the viewing settings from the specified Camera object.
 Dialog getDialog()
          Returns a Dialog object that can be used to specify extra information about this TriangleUI object.
 String getType()
          Returns "Triangle" as the surface type for this TriangleUI object.
 Vector[] getVertices()
          Returns an array of Vector objects representing the vertices of the triangle represented by this TriangleUI object.
 boolean hasDialog()
          Returns true.
 void setVertices(Vector p1, Vector p2, Vector p3)
          Sets the vertices of the triangle represented by this TriangleUI object to those specified.
 
Methods inherited from class threeD.raytracer.surfaceUI.AbstractSurfaceUI
getColorAt, getName, getNormalAt, getShadeBack, getShadeFront, getSurface, intersect, intersectAt, setName, setParent, setSurface, shade, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TriangleUI

public TriangleUI()
Constructs a new TriangleUI object that represents a triangle with all 3 vertices at the origin that is black.


TriangleUI

public TriangleUI(Vector p1,
                  Vector p2,
                  Vector p3)
Cunstructs a new TriangleUI object using the specified vertices that is black.


TriangleUI

public TriangleUI(Vector p1,
                  Vector p2,
                  Vector p3,
                  RGB color)
Constructs a new TriangleUI object using the specified vertices and the color represented by the specified RGB object.


TriangleUI

public TriangleUI(Triangle triangle)
Constructs a new TriangleUI object based on the specified Triangle object.

Method Detail

setVertices

public void setVertices(Vector p1,
                        Vector p2,
                        Vector p3)
Sets the vertices of the triangle represented by this TriangleUI object to those specified.


getVertices

public Vector[] getVertices()
Returns an array of Vector objects representing the vertices of the triangle represented by this TriangleUI object.


getType

public String getType()
Returns "Triangle" as the surface type for this TriangleUI object.


hasDialog

public boolean hasDialog()
Returns true.

Specified by:
hasDialog in interface SurfaceUI
Overrides:
hasDialog in class AbstractSurfaceUI

getDialog

public Dialog getDialog()
Returns a Dialog object that can be used to specify extra information about this TriangleUI object.

Specified by:
getDialog in interface SurfaceUI
Overrides:
getDialog in class AbstractSurfaceUI

draw

public void draw(Graphics g,
                 Camera camera)
Draws a simple representation of the triangle represented by this TriangleUI object on the specified graphics object using the viewing settings from the specified Camera object.


Rings
Version 0.2

Copyright 2003-05 Mike Murray