|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgizmoball.shape.ShapeGeometry
public class ShapeGeometry
This class contains static methods to perform geometry computations more complex than those in the Geometry class, such as those involving Shape objects. With these methods we can test Shape overlap or containment, as well as line segment intersection and midpoints.
| Constructor Summary | |
|---|---|
ShapeGeometry()
|
|
| Method Summary | |
|---|---|
static boolean |
containsShape(Shape enclosing,
Shape contained)
This method checks whethre one shape is completely contained in another. |
static boolean |
lineSegmentContainsPoint(LineSegment s,
Vect v)
|
static boolean |
lineSegmentsIntersect(LineSegment s1,
LineSegment s2)
This method tests whether the two line segments intersect |
static boolean |
lineSegmentsIntersectProper(LineSegment s1,
LineSegment s2)
|
static Vect |
midPoint(LineSegment s)
|
static boolean |
overlap(Shape s1,
Shape s2)
Tests whether two shapes overlap. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShapeGeometry()
| Method Detail |
|---|
public static Vect midPoint(LineSegment s)
s - line segment
public static boolean lineSegmentContainsPoint(LineSegment s,
Vect v)
s - line segmentv - point
public static boolean lineSegmentsIntersect(LineSegment s1,
LineSegment s2)
s1 - first line segments2 - second line segment
public static boolean lineSegmentsIntersectProper(LineSegment s1,
LineSegment s2)
s1 - line segments2 - lne segment
public static boolean overlap(Shape s1,
Shape s2)
s1 - Shapes2 - Shape
public static boolean containsShape(Shape enclosing,
Shape contained)
enclosing - contained -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||