|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.geometry.Rectangle
public class Rectangle
Rectangle special case of a general polygon. Useful for it's commonality
Field Summary | |
---|---|
protected double |
height
WRITEME: Document this brpocock@star-hope.org |
protected Coord2D |
origin
WRITEME: Document this brpocock@star-hope.org |
protected Polygon |
polygon
WRITEME: Document this brpocock@star-hope.org |
protected double |
width
WRITEME: Document this brpocock@star-hope.org |
Constructor Summary | |
---|---|
Rectangle(Coord2D oneCorner,
Coord2D otherCorner)
WRITEME brpocock@star-hope.org |
|
Rectangle(Coord2D ul,
double w,
double h)
Creates a rectangle |
Method Summary | |
---|---|
boolean |
contains(Coord2D coord2d)
Determines if the polygon contains that point |
boolean |
contains(double x,
double y)
Determines if the polygon contains that point |
private void |
generateLineSegments()
Generates the line segments for the rectangle on demand so that we delay generating them until later if they're not going to be used |
Coord2D |
getCenter()
|
double |
getHeight()
|
Coord2D |
getOrigin()
|
double |
getWidth()
|
Coord2D[] |
intersection(LineSeg2D lSeg2d)
Finds the intersection points for the polygon with the line segment |
boolean |
intersects(LineSeg2D lSeg2d)
Determines if the polygon intersects the line segment |
boolean |
intersects(PolygonPrimitive<?> otherPolygon)
Determines if this polygon intersects with another one |
boolean |
intersectsCircle(Circle circle)
Determines if the polygon intersects a circle |
boolean |
intersectsPoly(Polygon otherPolygon)
Determines if the polygon intersects a polygon |
boolean |
intersectsRect(Rectangle rectangle)
Determines if the polygon intersects a rectangle |
Rectangle |
scale(double sizeScalar)
WRITEME: Document this method brpocock@star-hope.org |
Rectangle |
translate(Coord2D coord2d)
WRITEME: Document this method brpocock@star-hope.org |
Rectangle |
translate(double x,
double y)
Translates the object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final double height
protected final Coord2D origin
protected Polygon polygon
protected final double width
Constructor Detail |
---|
public Rectangle(Coord2D oneCorner, Coord2D otherCorner)
oneCorner
- WRITEMEotherCorner
- WRITEMEpublic Rectangle(Coord2D ul, double w, double h)
ul
- Upper left hand coordinatew
- Widthh
- HeightMethod Detail |
---|
public boolean contains(Coord2D coord2d)
PolygonPrimitive
contains
in interface PolygonPrimitive<Rectangle>
coord2d
- WRITEME
PolygonPrimitive.contains(org.starhope.appius.geometry.Coord2D)
public boolean contains(double x, double y)
PolygonPrimitive
contains
in interface PolygonPrimitive<Rectangle>
x
- WRITEMEy
- WRITEME
PolygonPrimitive.contains(double,
double)
private void generateLineSegments()
public Coord2D getCenter()
getCenter
in interface PolygonPrimitive<Rectangle>
PolygonPrimitive.getCenter()
public double getHeight()
public Coord2D getOrigin()
public double getWidth()
public Coord2D[] intersection(LineSeg2D lSeg2d)
PolygonPrimitive
intersection
in interface PolygonPrimitive<Rectangle>
lSeg2d
- WRITEME
PolygonPrimitive.intersection(org.starhope.appius.geometry.LineSeg2D)
public boolean intersects(LineSeg2D lSeg2d)
PolygonPrimitive
intersects
in interface PolygonPrimitive<Rectangle>
lSeg2d
- WRITEME
PolygonPrimitive.intersects(org.starhope.appius.geometry.LineSeg2D)
public boolean intersects(PolygonPrimitive<?> otherPolygon)
XXX: There has to be a better way than this
intersects
in interface PolygonPrimitive<Rectangle>
otherPolygon
- WRITEME
public boolean intersectsCircle(Circle circle)
PolygonPrimitive
intersectsCircle
in interface PolygonPrimitive<Rectangle>
circle
- WRITEME
PolygonPrimitive.intersectsCircle(org.starhope.appius.geometry.Circle)
public boolean intersectsPoly(Polygon otherPolygon)
PolygonPrimitive
intersectsPoly
in interface PolygonPrimitive<Rectangle>
otherPolygon
- WRITEME
PolygonPrimitive.intersectsPoly(org.starhope.appius.geometry.Polygon)
public boolean intersectsRect(Rectangle rectangle)
PolygonPrimitive
intersectsRect
in interface PolygonPrimitive<Rectangle>
rectangle
- WRITEME
PolygonPrimitive.intersectsRect(org.starhope.appius.geometry.Rectangle)
public Rectangle scale(double sizeScalar)
PolygonPrimitive
scale
in interface PolygonPrimitive<Rectangle>
sizeScalar
- WRITEME
PolygonPrimitive.scale(double)
public Rectangle translate(Coord2D coord2d)
PolygonPrimitive
translate
in interface PolygonPrimitive<Rectangle>
coord2d
- The amount to move
PolygonPrimitive.translate(org.starhope.appius.geometry.Coord2D)
public Rectangle translate(double x, double y)
PolygonPrimitive
translate
in interface PolygonPrimitive<Rectangle>
x
- The amount to move on the x-axisy
- The amount to move on the y-axis
PolygonPrimitive.translate(double,
double)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |