public class Box
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
double |
xmax |
double |
xmin |
double |
ymax |
double |
ymin |
| Constructor and Description |
|---|
Box()
Instantiates a new Box with all values being 0.
|
Box(Box bbox)
Copy constructor.
|
Box(double x,
double y)
Simple box instantiation (for adding extents).
|
Box(double xmin,
double ymin,
double xmax,
double ymax)
Instantiates a new Box.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Box bbox) |
void |
add(double x,
double y) |
boolean |
contains(double x,
double y)
Check if Box contains point defined by coordinates x and y.
|
boolean |
contains(Point p)
Check if Box contains Point.
|
static Box |
createSafe(double x1,
double y1,
double x2,
double y2) |
double |
getHeight() |
double |
getWidth() |
boolean |
inside(Box box)
Check if this Box is inside box.
|
void |
map2mercator()
Convert map coordinates to lat/lon.
|
boolean |
overlap(Box other) |
void |
scale(double d) |
void |
setExtents(float[] points)
Init or overwrite extents of box.
|
void |
setExtents(float[] points,
int length)
Init or overwrite extents of box.
|
java.lang.String |
toString() |
void |
translate(double dx,
double dy) |
public double xmin
public double xmax
public double ymin
public double ymax
public Box()
public Box(double x,
double y)
x - the initial x valuey - the initial y valuepublic Box(double xmin,
double ymin,
double xmax,
double ymax)
xmin - the min xymin - the min yxmax - the max xymax - the max ypublic Box(Box bbox)
public void add(double x,
double y)
public void add(Box bbox)
public boolean contains(double x,
double y)
x - the x ordinatey - the y ordinatepublic boolean contains(Point p)
public static Box createSafe(double x1, double y1, double x2, double y2)
public double getHeight()
public double getWidth()
public boolean inside(Box box)
public void map2mercator()
public boolean overlap(Box other)
public void scale(double d)
public void setExtents(float[] points)
points - the points to extend topublic void setExtents(float[] points,
int length)
points - the points to extend tolength - the number of considered pointspublic java.lang.String toString()
toString in class java.lang.Objectpublic void translate(double dx,
double dy)