org.dolben.poly
Class ColoredFaces

java.lang.Object
  extended by org.dolben.poly.Solid
      extended by org.dolben.poly.ColoredFaces
Direct Known Subclasses:
ShadedFaces

public class ColoredFaces
extends Solid

A polyhedron drawn as colored faces.


Field Summary
protected  Lighting lighting
           
 
Fields inherited from class org.dolben.poly.Solid
polyhedron
 
Constructor Summary
ColoredFaces(Polyhedron poly)
          Creates a new Solid for a given polyhedron.
 
Method Summary
protected  java.awt.Color getColor(int index)
          Gets the color of a polygon based on the number of its sides.
 void paint(Projector projector, java.awt.Graphics graphics)
          Draws the polyhedron.
 
Methods inherited from class org.dolben.poly.Solid
getPolyhedron
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lighting

protected Lighting lighting
Constructor Detail

ColoredFaces

public ColoredFaces(Polyhedron poly)
Creates a new Solid for a given polyhedron.

Parameters:
poly - the polyhedron to be drawn
Method Detail

getColor

protected java.awt.Color getColor(int index)
Gets the color of a polygon based on the number of its sides.


paint

public void paint(Projector projector,
                  java.awt.Graphics graphics)
Draws the polyhedron.

Specified by:
paint in class Solid
Parameters:
projector - the projector that maps 3D to Graphics coordinates
graphics - the drawing context