Class FlatRenderer.PolygonInfo

java.lang.Object
  |
  +--FlatRenderer.PolygonInfo
Direct Known Subclasses:
GouraudRenderer.PolygonInfoEx
Enclosing class:
FlatRenderer

protected static class FlatRenderer.PolygonInfo
extends Object

Information about a polygon in process.


Field Summary
protected  FlatRenderer.ActiveEdgeTable AET
          The current Active Edge Table for the current scan line of this polygon.
protected  Color color
          The luminated color of the polygon.
protected  PlaneEquation equation
          The plane equation of the polygon.
protected  FlatRenderer.EdgeTable ET
          The global Edge Table for this polygon.
protected  List lights
          The available lights.
protected  Mesh.Polygon polygon
          The owner polygon.
 
Constructor Summary
protected FlatRenderer.PolygonInfo()
          Constructs a null PolygonInfo.
  FlatRenderer.PolygonInfo(Mesh.Polygon poly, List lights)
          Constructs the object.
 
Method Summary
protected  Color calcLumColor()
          Calculates the luminated color of this polygon; returns the polygon's base color if there are no light object.
 FlatRenderer.ActiveEdgeTable getAET()
          Returns the current Active Edge Table of the polygon.
 Color getColor()
          Returns the illuminated color of this polygon.
 FlatRenderer.EdgeTable getET()
          Returns the Edge Table of the polygon.
 Mesh.Polygon getPolygon()
          returns the owner polygon.
 double getZ(double x, double y)
          Returns the Z value of the polygon, given the x and y values.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

polygon

protected Mesh.Polygon polygon
The owner polygon.

equation

protected PlaneEquation equation
The plane equation of the polygon.

ET

protected FlatRenderer.EdgeTable ET
The global Edge Table for this polygon.

AET

protected FlatRenderer.ActiveEdgeTable AET
The current Active Edge Table for the current scan line of this polygon.

lights

protected List lights
The available lights.

color

protected Color color
The luminated color of the polygon.
Constructor Detail

FlatRenderer.PolygonInfo

protected FlatRenderer.PolygonInfo()
Constructs a null PolygonInfo. Derived classes must initialize all of the data members.

FlatRenderer.PolygonInfo

public FlatRenderer.PolygonInfo(Mesh.Polygon poly,
                                List lights)
Constructs the object. Creates the plane equation, edge table, and active edge table for the polygon.
Parameters:
poly - the polygon this object is tied with.
Method Detail

calcLumColor

protected Color calcLumColor()
Calculates the luminated color of this polygon; returns the polygon's base color if there are no light object.

getColor

public Color getColor()
Returns the illuminated color of this polygon.

getZ

public double getZ(double x,
                   double y)
Returns the Z value of the polygon, given the x and y values. Does not take into account whether the x or y values are invalid (i.e. not inside the polygon.
Parameters:
x - the x value in the polygon.
y - the y value in the polygon.
Returns:
the z value given the (x,y) values of the polygon.

getET

public FlatRenderer.EdgeTable getET()
Returns the Edge Table of the polygon.

getAET

public FlatRenderer.ActiveEdgeTable getAET()
Returns the current Active Edge Table of the polygon.

getPolygon

public Mesh.Polygon getPolygon()
returns the owner polygon.