|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.chart.internal.computations.PolySimple
PolySimple
is a simple polygon - contains only one inner polygon.
WARNING: This type of Poly
cannot be used for an
inner polygon that is a hole.
Constructor Summary | |
PolySimple()
Creates a new instance of PolySimple |
Method Summary | |
void |
add(double x,
double y)
Add a point to the first inner PolySimple. |
void |
add(IPolygon p)
Throws IllegalStateexception if called |
void |
add(Point p)
Add a point to the first inner PolySimple. |
void |
clear()
Remove all of the points. |
boolean |
contains(Point loc)
|
boolean |
equals(java.lang.Object obj)
Return true if the given object is equal to this one. |
double |
getArea()
Returns the area of the PolySimple. |
Rectangle |
getBounds()
Returns the bounding rectangle of this PolySimple. |
IPolygon |
getInnerPoly(int polyIndex)
Returns this if polyIndex = 0 , else it throws
IllegalStateException. |
int |
getNumInnerPoly()
Always returns 1. |
int |
getNumPoints()
Return the number points of the first inner PolySimple |
Point |
getPoint(int index)
Return the point at the index |
java.util.List |
getPoints()
Returns the points |
double |
getX(int index)
Return the X value of the point at the index |
double |
getY(int index)
Return the Y value of the point at the index |
int |
hashCode()
Return the hashCode of the object. |
IPolygon |
intersection(IPolygon p)
Return a Poly that is the intersection of this PolySimple with the given PolySimple. |
boolean |
isContributing(int polyIndex)
Return true if the given inner PolySimple is contributing to the set operation. |
boolean |
isEmpty()
Return true if the PolySimple is empty |
boolean |
isHole()
Always returns false since PolySimples cannot be holes. |
boolean |
isRectangle()
|
void |
setContributing(int polyIndex,
boolean contributes)
Set whether or not this inner PolySimple is constributing to the set operation. |
void |
setIsHole(boolean isHole)
Throws IllegalStateException if called. |
java.lang.String |
toString()
Return a string briefly describing the PolySimple. |
IPolygon |
union(IPolygon p)
Return a Poly that is the union of this PolySimple with the given PolySimple. |
IPolygon |
xor(IPolygon p)
Return a Poly that is the exclusive-or of this PolySimple with the given PolySimple. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PolySimple()
Method Detail |
public boolean equals(java.lang.Object obj)
WARNING: This method failse if the first point appears more than once in the list.
public int hashCode()
WARNING:Hash and Equals break contract.
public java.lang.String toString()
public void clear()
clear
in interface IPolygon
public void add(double x, double y)
add
in interface IPolygon
public void add(Point p)
add
in interface IPolygon
public void add(IPolygon p)
add
in interface IPolygon
public boolean isEmpty()
isEmpty
in interface IPolygon
public Rectangle getBounds()
getBounds
in interface IPolygon
public IPolygon getInnerPoly(int polyIndex)
this
if polyIndex = 0
, else it throws
IllegalStateException.
getInnerPoly
in interface IPolygon
public int getNumInnerPoly()
getNumInnerPoly
in interface IPolygon
public int getNumPoints()
getNumPoints
in interface IPolygon
public double getX(int index)
getX
in interface IPolygon
public double getY(int index)
getY
in interface IPolygon
public Point getPoint(int index)
getPoint
in interface IPolygon
public java.util.List getPoints()
getPoints
in interface IPolygon
public boolean isHole()
isHole
in interface IPolygon
public void setIsHole(boolean isHole)
setIsHole
in interface IPolygon
public boolean isContributing(int polyIndex)
isContributing
in interface IPolygon
java.lang.IllegalStateException
- if polyIndex != 0
public void setContributing(int polyIndex, boolean contributes)
setContributing
in interface IPolygon
java.lang.IllegalStateException
- if polyIndex != 0
public IPolygon intersection(IPolygon p)
intersection
in interface IPolygon
public IPolygon union(IPolygon p)
union
in interface IPolygon
public IPolygon xor(IPolygon p)
xor
in interface IPolygon
public double getArea()
The algorithm for the area of a complex PolySimple was take from code by Joseph O'Rourke author of " Computational Geometry in C".
getArea
in interface IPolygon
public boolean contains(Point loc)
contains
in interface IPolygon
public boolean isRectangle()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |