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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ConvexPolygon
public ConvexPolygon(java.util.List vertices)
- Creates a new instance of ConvexPolygon
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)