org.metasyntactic.graphics.shapes
Class ConvexPolygon

java.lang.Object
  |
  +--org.metasyntactic.graphics.shapes.Shape
        |
        +--org.metasyntactic.graphics.shapes.CartesianShape
              |
              +--org.metasyntactic.graphics.shapes.ReflectiveShape
                    |
                    +--org.metasyntactic.graphics.shapes.Polygon
                          |
                          +--org.metasyntactic.graphics.shapes.ConvexPolygon
Direct Known Subclasses:
Rectangle

public class ConvexPolygon
extends Polygon


Constructor Summary
ConvexPolygon(java.util.List vertices)
          Creates a new instance of ConvexPolygon
 
Method Summary
static Shape fromXML(org.w3c.dom.Element element)
           
 Intersection getIntersection(Ray ray)
          returns null if there is no intersection
 Vector getNormal()
           
 Plane getPlane()
          Getter for property plane.
 java.util.List getVertices()
          Getter for property vertices.
 boolean isInside(Point point)
           
static void main(java.lang.String[] args)
           
 void setVertices(java.util.List vertices)
          Setter for property vertices.
 
Methods inherited from class org.metasyntactic.graphics.shapes.ReflectiveShape
getShadeModel, setShadeModel
 
Methods inherited from class org.metasyntactic.graphics.shapes.CartesianShape
getIntersections, getPosition, setPosition
 
Methods inherited from class org.metasyntactic.graphics.shapes.Shape
getColor, setColor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConvexPolygon

public ConvexPolygon(java.util.List vertices)
Creates a new instance of ConvexPolygon

Method Detail

getVertices

public java.util.List getVertices()
Getter for property vertices.

Specified by:
getVertices in class Polygon
Returns:
Value of property vertices.

setVertices

public void setVertices(java.util.List vertices)
Setter for property vertices.

Specified by:
setVertices in class Polygon
Parameters:
vertices - New value of property vertices.

getIntersection

public Intersection getIntersection(Ray ray)
Description copied from class: CartesianShape
returns null if there is no intersection

Overrides:
getIntersection in class CartesianShape

getNormal

public Vector getNormal()
Specified by:
getNormal in class Polygon

main

public static void main(java.lang.String[] args)

getPlane

public Plane getPlane()
Getter for property plane.

Returns:
Value of property plane.

isInside

public boolean isInside(Point point)
Specified by:
isInside in class Polygon

fromXML

public static Shape fromXML(org.w3c.dom.Element element)