|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPathPlan.Discretizer
public class Discretizer
Handles 2D coordinate transforms and discretization.
Nested Class Summary | |
---|---|
class |
Discretizer.Point
A point which has corresponding coordinates in the discrete and continuous worlds. |
class |
Discretizer.Rectangle
A rectangle which has corresponding coordinates in the discrete and continuous worlds. |
Constructor Summary | |
---|---|
Discretizer()
|
Method Summary | |
---|---|
int |
discretizeOval(Discretizer.Rectangle rect,
int[][] result)
Find all of the discrete coordinates within an axis-oriented elliptical region. |
double |
getContX(int x)
Translate discrete to continuous X. |
double |
getContY(int y)
Translate discrete to continuous Y. |
int |
getDiscX(double x)
Translate continuous to discrete X. |
double |
getDiscXFraction(double x)
Translate continuous to discrete X without rounding (useful only as an intermediate result). |
int |
getDiscY(double y)
Translate continuous to discrete Y. |
double |
getDiscYFraction(double y)
Translate continuous to discrete Y without rounding (useful only as an intermediate result). |
int |
getHeight()
Get discrete y range. |
int |
getWidth()
Get discrete x range. |
double |
getXmax()
Get continuous largest x. |
double |
getXmin()
Get continuous lowest x. |
double |
getYmax()
Get continuous largest y. |
double |
getYmin()
Get continuous smallest y. |
Discretizer.Point |
Point(double x,
double y)
Make a point from its continuous coordinates. |
Discretizer.Point |
Point(int x,
int y)
Make a point from its discrete coordinates. |
Discretizer.Rectangle |
Rectangle(double xmin,
double ymin,
double xmax,
double ymax)
Make a Rectangle from its continuous coordinates. |
Discretizer.Rectangle |
Rectangle(int xmin,
int ymin,
int xmax,
int ymax)
Make a Rectangle from its discrete coordinates. |
void |
setContinuousRange(double xmin,
double ymin,
double xmax,
double ymax)
Set the range of the continuous coordinates |
void |
setDiscreteRange(int w,
int h)
Set the range of the discrete coordinates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Discretizer()
Method Detail |
---|
public Discretizer.Point Point(int x, int y)
public Discretizer.Point Point(double x, double y)
public Discretizer.Rectangle Rectangle(int xmin, int ymin, int xmax, int ymax)
public Discretizer.Rectangle Rectangle(double xmin, double ymin, double xmax, double ymax)
public int discretizeOval(Discretizer.Rectangle rect, int[][] result)
rect
- The bounding rectangle of the ellipse.result
- An int[2][]. The x coordinates will be returned
in result[0] while the y coordinates will be returned in
result[1]. If result[0] and result[1] are not big enough to
hold all of the coordinates, they will be reallocated.
public void setDiscreteRange(int w, int h)
public void setContinuousRange(double xmin, double ymin, double xmax, double ymax)
public final double getContX(int x)
public final double getContY(int y)
public final int getDiscX(double x)
public final double getDiscXFraction(double x)
public final int getDiscY(double y)
public final double getDiscYFraction(double y)
public final int getWidth()
public final int getHeight()
public final double getXmin()
public final double getXmax()
public final double getYmin()
public final double getYmax()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |