public final class Envelope2D extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
double |
xmax |
double |
xmin |
double |
ymax |
double |
ymin |
Constructor and Description |
---|
Envelope2D() |
Envelope2D(double _xmin,
double _ymin,
double _xmax,
double _ymax) |
Envelope2D(Envelope2D other) |
Modifier and Type | Method and Description |
---|---|
void |
centerAt(double x,
double y) |
void |
centerAt(Point c) |
int |
clipLine(Point2D p1,
Point2D p2) |
static Envelope2D |
construct(double _xmin,
double _ymin,
double _xmax,
double _ymax) |
static Envelope2D |
construct(Envelope2D other) |
boolean |
contains(double x,
double y) |
boolean |
contains(Envelope2D other)
Returns True if the envelope contains the other envelope (boundary
inclusive).
|
boolean |
contains(Point p) |
boolean |
contains(Point2D p) |
boolean |
containsExclusive(double x,
double y)
Returns True if the envelope contains the point (boundary exclusive).
|
boolean |
containsExclusive(Point2D pt)
Returns True if the envelope contains the point (boundary exclusive).
|
double |
distance(Envelope2D other)
Calculates minimum distance from this envelope to the other.
|
double |
distance(Point2D pt2D)
Calculates minimum distance from this envelope to the point.
|
boolean |
equals(Object _other) |
int |
estimateMemorySize() |
double |
getArea() |
Point2D |
getCenter()
Gets the center point of the envelope.
|
double |
getCenterX() |
double |
getCenterY() |
double |
getHeight() |
Envelope2D |
getInflated(double dx,
double dy) |
double |
getLength() |
Point2D |
getLowerLeft() |
Point2D |
getLowerRight() |
Point2D |
getUpperLeft() |
Point2D |
getUpperRight() |
double |
getWidth() |
int |
hashCode() |
void |
inflate(double dx,
double dy) |
boolean |
intersect(Envelope2D other)
Intersects this envelope with the other and stores result in this
envelope.
|
boolean |
isDegenerate(double tolerance)
Returns True, envelope is degenerate (Width or Height are less than
tolerance).
|
boolean |
isEmpty() |
boolean |
isIntersecting(double xmin_,
double ymin_,
double xmax_,
double ymax_)
Checks if this envelope intersects the other.
|
boolean |
isIntersecting(Envelope2D other)
Checks if this envelope intersects the other.
|
boolean |
isIntersectingNE(Envelope2D other)
Checks if this envelope intersects the other assuming neither one is empty.
|
boolean |
isPointOnBoundary(Point2D pt,
double tolerance) |
boolean |
isValid()
Returns True if this envelope is valid (empty, or has xmin less or equal
to xmax, or ymin less or equal to ymax).
|
void |
merge(double x,
double y) |
void |
merge(Envelope2D other) |
void |
merge(Point2D pt) |
void |
merge(Point3D pt) |
void |
mergeNE(double x,
double y)
Merges a point with this envelope without checking if the envelope is
empty.
|
void |
move(double dx,
double dy)
Moves the Envelope by given distance.
|
void |
normalize() |
void |
offset(double dx,
double dy) |
void |
queryCenter(Point2D center) |
Point2D |
queryCorner(int index)
Queries a corner of the envelope.
|
void |
queryCorners(Point2D[] corners)
Queries corners into a given array.
|
void |
queryCornersReversed(Point2D[] corners)
Queries corners into a given array in reversed order.
|
void |
queryIntervalX(Envelope1D env1D) |
void |
queryIntervalY(Envelope1D env1D) |
void |
queryLowerLeft(Point2D pt) |
void |
queryLowerRight(Point2D pt) |
void |
queryUpperLeft(Point2D pt) |
void |
queryUpperRight(Point2D pt) |
void |
reaspect(double arWidth,
double arHeight) |
void |
scale(double f) |
void |
setCoords(double _x,
double _y) |
void |
setCoords(double _xmin,
double _ymin,
double _xmax,
double _ymax) |
void |
setCoords(Envelope1D xinterval,
Envelope1D yinterval) |
void |
setCoords(Envelope2D envSrc) |
void |
setCoords(Point2D pt) |
void |
setCoords(Point2D center,
double width,
double height) |
void |
setEmpty() |
void |
setFromPoints(Point2D[] points)
Sets the envelope from the array of points.
|
void |
setFromPoints(Point2D[] points,
int count) |
void |
setInfinite() |
double |
sqrDistance(double xmin_,
double ymin_,
double xmax_,
double ymax_)
Calculates minimum squared distance from this envelope to the other.
|
double |
sqrDistance(Envelope2D other)
Calculates minimum squared distance from this envelope to the other.
|
double |
sqrDistance(Point2D pt2D)
Calculates minimum squared distance from this envelope to the point.
|
double |
sqrMaxDistance(Envelope2D other)
Returns squared max distance between two bounding boxes.
|
void |
zoom(double factorX,
double factorY) |
public double xmin
public double ymin
public double xmax
public double ymax
public Envelope2D()
public Envelope2D(double _xmin, double _ymin, double _xmax, double _ymax)
public Envelope2D(Envelope2D other)
public static Envelope2D construct(double _xmin, double _ymin, double _xmax, double _ymax)
public static Envelope2D construct(Envelope2D other)
public int estimateMemorySize()
public void setCoords(double _x, double _y)
public void setCoords(double _xmin, double _ymin, double _xmax, double _ymax)
public void setCoords(Point2D center, double width, double height)
public void setCoords(Point2D pt)
public void setCoords(Envelope2D envSrc)
public Envelope2D getInflated(double dx, double dy)
public void setFromPoints(Point2D[] points)
points
- The points to set the envelope from. No element in the array can be null.public void setEmpty()
public void setInfinite()
public boolean isEmpty()
public void setCoords(Envelope1D xinterval, Envelope1D yinterval)
public void merge(double x, double y)
public void mergeNE(double x, double y)
x
- The x coord of the pointy
- the y coord in the pointpublic void merge(Point2D pt)
public void merge(Point3D pt)
public void merge(Envelope2D other)
public void inflate(double dx, double dy)
public void scale(double f)
public void zoom(double factorX, double factorY)
public boolean isIntersecting(Envelope2D other)
other
- The other envelope.public boolean isIntersectingNE(Envelope2D other)
other
- The other envelope.public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double ymax_)
xmin_
- ymin_
- xmax_
- ymax_
- public boolean intersect(Envelope2D other)
other
- The other envelope.public Point2D queryCorner(int index)
index
- Indicates a corner of the envelope.
0 means lower left or (xmin, ymin)
1 means upper left or (xmin, ymax)
2 means upper right or (xmax, ymax)
3 means lower right or (xmax, ymin)
public void queryCorners(Point2D[] corners)
corners
- The array of four points.public void queryCornersReversed(Point2D[] corners)
corners
- The array of four points.public double getArea()
public double getLength()
public void setFromPoints(Point2D[] points, int count)
public void reaspect(double arWidth, double arHeight)
public double getCenterX()
public double getCenterY()
public double getWidth()
public double getHeight()
public void move(double dx, double dy)
dx
- dy
- public void centerAt(double x, double y)
public void offset(double dx, double dy)
public void normalize()
public void queryLowerLeft(Point2D pt)
public void queryLowerRight(Point2D pt)
public void queryUpperLeft(Point2D pt)
public void queryUpperRight(Point2D pt)
public boolean isValid()
public Point2D getCenter()
public void queryCenter(Point2D center)
public void centerAt(Point c)
public Point2D getLowerLeft()
public Point2D getUpperLeft()
public Point2D getLowerRight()
public Point2D getUpperRight()
public boolean contains(Point p)
public boolean contains(Point2D p)
public boolean contains(double x, double y)
public boolean contains(Envelope2D other)
other
- The other envelope.public boolean containsExclusive(double x, double y)
x
- y
- public boolean containsExclusive(Point2D pt)
public boolean isDegenerate(double tolerance)
public boolean isPointOnBoundary(Point2D pt, double tolerance)
public double distance(Envelope2D other)
other
- The other envelope.public double distance(Point2D pt2D)
pt2D
- The other point.public double sqrDistance(Envelope2D other)
other
- The other envelope.public double sqrDistance(double xmin_, double ymin_, double xmax_, double ymax_)
xmin_
- ymin_
- xmax_
- ymax_
- public double sqrMaxDistance(Envelope2D other)
other
- The bounding box to calculate the max distance two.public double sqrDistance(Point2D pt2D)
pt2D
- The point.public void queryIntervalX(Envelope1D env1D)
public void queryIntervalY(Envelope1D env1D)
Copyright © 2018. All rights reserved.