|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<Point> ProGAL.geom2d.Polygon
public class Polygon
Constructor Summary | |
---|---|
Polygon()
|
|
Polygon(java.util.List<Point> corners)
|
|
Polygon(Point[] points)
|
|
Polygon(Point p0,
Point p1,
Point p2)
|
|
Polygon(PointSet points)
|
Method Summary | |
---|---|
void |
deleteLast()
deletes last corner of the polygon |
void |
draw(J2DScene scene)
|
void |
draw(J2DScene scene,
java.awt.Color clr)
draws the polygon |
Point |
getCenter()
Get the geometric center of the shape. |
ConvexPolygon |
getConvexPolygon()
returns convex hull of a simple polygon in O(n) time |
Point |
getCorner(int i)
|
void |
insertAfter(Point p,
int index)
inserts point p into the polygon after the corner with specified index |
boolean |
isConvex()
|
int |
leftExtremePointIndx()
returns the index of the leftmost point (in case of ties, index of the bottommost one is returned) |
static void |
main(java.lang.String[] args)
|
int |
rightExtremePointIndx()
returns the index of the rightmost point (in case of ties, index of the topmost one is returned) |
void |
setCorner(Point p,
int i)
|
void |
shift(int shiftStep)
first corner of the polygon is moved by shiftStep positions |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public Polygon()
public Polygon(java.util.List<Point> corners)
public Polygon(Point p0, Point p1, Point p2)
public Polygon(PointSet points)
public Polygon(Point[] points)
Method Detail |
---|
public Point getCorner(int i)
public void setCorner(Point p, int i)
public void insertAfter(Point p, int index)
public void deleteLast()
public int leftExtremePointIndx()
public int rightExtremePointIndx()
public void shift(int shiftStep)
public boolean isConvex()
public Point getCenter()
Shape
getCenter
in interface Shape
public void draw(J2DScene scene, java.awt.Color clr)
public void draw(J2DScene scene)
public ConvexPolygon getConvexPolygon()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |