jdsl.geomobj.api
Interface GeomTester2D
- All Superinterfaces:
- ThreeArgsGeomTests2D, TwoArgsGeomTests2D
- All Known Implementing Classes:
- GeomTester2DImpl
- public interface GeomTester2D
- extends TwoArgsGeomTests2D, ThreeArgsGeomTests2D
A collection of geometric tests. The parameters of the methods are
interfaces.
Currently all the methods using VoronoiLinearCurve2D are commented
out; they will be reinserted later.
- Version:
- $Id: GeomTester2D.java,v 1.4 2002/03/05 12:28:28 lv Exp $
- Author:
- Luca Vismara (lv)
NEGATIVE
public static final int NEGATIVE
ON
public static final int ON
POSITIVE
public static final int POSITIVE
LEFT
public static final int LEFT
X_ALIGNED
public static final int X_ALIGNED
RIGHT
public static final int RIGHT
BELOW
public static final int BELOW
Y_ALIGNED
public static final int Y_ALIGNED
ABOVE
public static final int ABOVE
INSIDE
public static final int INSIDE
OUTSIDE
public static final int OUTSIDE
LESSER
public static final int LESSER
EQUAL
public static final int EQUAL
GREATER
public static final int GREATER
RIGHT_TURN
public static final int RIGHT_TURN
COLLINEAR
public static final int COLLINEAR
LEFT_TURN
public static final int LEFT_TURN
NO
public static final int NO
SINGLE
public static final int SINGLE
MULTIPLE
public static final int MULTIPLE
areEqual
public boolean areEqual(Point2D q1,
Point2D q2)
- Parameters:
q1
- a pointq2
- a point- Returns:
- whether q1 and q2 are the same point
aboveBelow
public int aboveBelow(Point2D q,
LinearCurve2D lc)
throws InvalidPointException,
InvalidGeomTestException
- Parameters:
q
- a pointlc
- a linear curve- Returns:
- whether q is GeomTester2D.ABOVE, GeomTester2D.ON, or
GeomTester2D.BELOW lc
- Throws:
InvalidPointException
- if q is Point2D.INFINITEInvalidGeomTestException
- if q is not within the horizontal
span of lc
leftRight
public int leftRight(Point2D q,
LinearCurve2D lc)
throws InvalidPointException,
InvalidGeomTestException
- Parameters:
q
- a pointlc
- a line- Returns:
- whether q is to the GeomTester2D.LEFT, GeomTester2D.ON, or
to the GeomTester2D.RIGHT of lc
- Throws:
InvalidPointException
- if q is Point2D.INFINITEInvalidGeomTestException
- if q is not within the vertical
span of lc
withinHorizontalSpan
public boolean withinHorizontalSpan(Point2D q,
LinearCurve2D lc)
throws InvalidPointException
- Parameters:
q
- a pointlc
- a linear curve- Returns:
- whether q is within the horizontal span of lc
- Throws:
InvalidPointException
- if q is Point2D.INFINITE
withinVerticalSpan
public boolean withinVerticalSpan(Point2D q,
LinearCurve2D lc)
throws InvalidPointException
- Parameters:
q
- a pointlc
- a linear curve- Returns:
- whether q is within the vertical span of lc
- Throws:
InvalidPointException
- if q is Point2D.INFINITE
intersection
public int intersection(LinearCurve2D lc1,
LinearCurve2D lc2)
- Tests if two linear curves intersect.
- Parameters:
lc1
- a linear curvelc2
- a linear curve- Returns:
- GeomTester2D.NO if lc1 does not intersect lc2,
GeomTester2D.SINGLE if lc1 intersects lc2 in one point, and
GeomTester2D.MULTIPLE if lc1 and lc2 (partially) overlap
insideOutside
public int insideOutside(Point2D q,
Rectangle2D r)
throws InvalidPointException
- Parameters:
q
- a pointr
- a rectangle- Returns:
- whether q is GeomTester2D.INSIDE, GeomTester2D.ON, or
GeomTester2D.OUTSIDE r
- Throws:
InvalidPointException
- if q is Point2D.INFINITE