computational.geometry
Class ConvexPolygon
java.lang.Object
computational.geometry.Polygon
computational.geometry.SimplePolygon
computational.geometry.ConvexPolygon
- All Implemented Interfaces:
- Shape, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- Rectangle, Triangle
public class ConvexPolygon
- extends SimplePolygon
- See Also:
- Serialized Form
Methods inherited from class computational.geometry.Polygon |
area, boundingBox, clear, clone, draw, drawLabels, drawPoints, equals, getBottomVertex, getEdge, getEdges, getFirstVertex, getIndices, getLabel, getLeftVertex, getNext, getPoints, getPrevious, getRightVertex, getTopVertex, getVertex, getVertices, indexOf, isClockwiseOriented, isConvex, isSimple, perimeter, restore, setLabel, size, toString, translate, updateExtremeVertices |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ConvexPolygon
public ConvexPolygon()
- CONSTRUCTORS
ConvexPolygon
public ConvexPolygon(java.util.List vertices)
throws ConvexityViolatedException,
SimplicityViolatedException
- Throws:
ConvexityViolatedException
SimplicityViolatedException
ConvexPolygon
public ConvexPolygon(Polygon p)
throws ConvexityViolatedException,
SimplicityViolatedException
- Throws:
ConvexityViolatedException
SimplicityViolatedException
ConvexPolygon
public ConvexPolygon(java.lang.String label)
ConvexPolygon
public ConvexPolygon(java.lang.String label,
java.util.List points)
throws ConvexityViolatedException,
SimplicityViolatedException
- Throws:
ConvexityViolatedException
SimplicityViolatedException
addVertex
public boolean addVertex(Point p)
throws SimplicityViolatedException,
ConvexityViolatedException
- SET METHODS
- Overrides:
addVertex
in class SimplePolygon
- Throws:
SimplicityViolatedException
ConvexityViolatedException
addVertex
public boolean addVertex(Point p,
Segment s)
throws SimplicityViolatedException,
ConvexityViolatedException
- Overrides:
addVertex
in class SimplePolygon
- Throws:
SimplicityViolatedException
ConvexityViolatedException
contains
public boolean contains(Point p)
- POINT IN POLYGON TEST
- Specified by:
contains
in interface Shape
- Overrides:
contains
in class SimplePolygon
- Parameters:
p
- the point we test for encloseness.
- Returns:
- true iff the point is enclosed in the shape.
deleteVertex
public boolean deleteVertex(java.lang.Integer index)
throws SimplicityViolatedException,
ConvexityViolatedException
- Overrides:
deleteVertex
in class SimplePolygon
- Throws:
SimplicityViolatedException
ConvexityViolatedException
deleteVertex
public boolean deleteVertex(Point p)
throws SimplicityViolatedException,
ConvexityViolatedException
- Overrides:
deleteVertex
in class SimplePolygon
- Throws:
SimplicityViolatedException
ConvexityViolatedException
moveVertex
public boolean moveVertex(java.lang.Integer index,
int dx,
int dy)
throws SimplicityViolatedException,
ConvexityViolatedException
- Overrides:
moveVertex
in class SimplePolygon
- Throws:
SimplicityViolatedException
ConvexityViolatedException
moveVertex
public boolean moveVertex(Point p,
int dx,
int dy)
throws SimplicityViolatedException,
ConvexityViolatedException
- Overrides:
moveVertex
in class SimplePolygon
- Throws:
SimplicityViolatedException
ConvexityViolatedException