Class Envelope2D
java.lang.Object
com.esri.core.geometry.Envelope2D
- All Implemented Interfaces:
Serializable
An axis parallel 2-dimensional rectangle.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnvelope2D(double _xmin, double _ymin, double _xmax, double _ymax) Envelope2D(Envelope2D other) -
Method Summary
Modifier and TypeMethodDescription(package private) double(package private) double(package private) int(package private) int_envelopeSide(Point2D pt) (package private) Point2D(package private) Point2DvoidcenterAt(double x, double y) void(package private) voidint(package private) int(package private) booleanclipLineAuxiliary(double denominator, double numerator, double[] segParams) static Envelope2Dconstruct(double _xmin, double _ymin, double _xmax, double _ymax) static Envelope2Dconstruct(Envelope2D other) booleancontains(double x, double y) booleancontains(Envelope2D other) Returns True if the envelope contains the other envelope (boundary inclusive).booleanbooleanbooleancontainsExclusive(double x, double y) Returns True if the envelope contains the point (boundary exclusive).(package private) booleancontainsExclusive(Envelope2D other) Returns True if the envelope contains the other envelope (boundary exclusive).booleanReturns True if the envelope contains the point (boundary exclusive).doubledistance(Envelope2D other) Calculates minimum distance from this envelope to the other.doubleCalculates minimum distance from this envelope to the point.booleanintdoublegetArea()Gets the center point of the envelope.doubledoubledoublegetInflated(double dx, double dy) doubledoublegetWidth()inthashCode()voidinflate(double dx, double dy) booleanintersect(Envelope2D other) Intersects this envelope with the other and stores result in this envelope.booleanisDegenerate(double tolerance) Returns True, envelope is degenerate (Width or Height are less than tolerance).booleanisEmpty()booleanisIntersecting(double xmin_, double ymin_, double xmax_, double ymax_) Checks if this envelope intersects the other.booleanisIntersecting(Envelope2D other) Checks if this envelope intersects the other.booleanisIntersectingNE(Envelope2D other) Checks if this envelope intersects the other assuming neither one is empty.booleanisPointOnBoundary(Point2D pt, double tolerance) booleanisValid()Returns True if this envelope is valid (empty, or has xmin less or equal to xmax, or ymin less or equal to ymax).voidmerge(double x, double y) voidmerge(Envelope2D other) voidvoidvoidmergeNE(double x, double y) Merges a point with this envelope without checking if the envelope is empty.voidmove(double dx, double dy) Moves the Envelope by given distance.voidvoidoffset(double dx, double dy) voidqueryCenter(Point2D center) queryCorner(int index) Queries a corner of the envelope.voidqueryCorners(Point2D[] corners) Queries corners into a given array.voidqueryCornersReversed(Point2D[] corners) Queries corners into a given array in reversed order.voidqueryIntervalX(Envelope1D env1D) voidqueryIntervalY(Envelope1D env1D) voidvoidvoidvoidprivate voidprivate voidvoidreaspect(double arWidth, double arHeight) voidscale(double f) voidsetCoords(double _x, double _y) voidsetCoords(double _xmin, double _ymin, double _xmax, double _ymax) voidsetCoords(Envelope1D xinterval, Envelope1D yinterval) voidsetCoords(Envelope2D envSrc) voidvoidvoidsetEmpty()voidsetFromPoints(Point2D[] points) Sets the envelope from the array of points.voidsetFromPoints(Point2D[] points, int count) voiddoublesqrDistance(double xmin_, double ymin_, double xmax_, double ymax_) Calculates minimum squared distance from this envelope to the other.doublesqrDistance(Envelope2D other) Calculates minimum squared distance from this envelope to the other.doublesqrDistance(Point2D pt2D) Calculates minimum squared distance from this envelope to the point.doublesqrMaxDistance(Envelope2D other) Returns squared max distance between two bounding boxes.private voidvoidzoom(double factorX, double factorY)
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
XLESSXMIN
private static final int XLESSXMIN- See Also:
-
YLESSYMIN
private static final int YLESSYMIN- See Also:
-
XMASK
private static final int XMASK- See Also:
-
YMASK
private static final int YMASK- See Also:
-
xmin
public double xmin -
ymin
public double ymin -
xmax
public double xmax -
ymax
public double ymax
-
-
Constructor Details
-
Envelope2D
public Envelope2D() -
Envelope2D
public Envelope2D(double _xmin, double _ymin, double _xmax, double _ymax) -
Envelope2D
-
-
Method Details
-
construct
-
construct
-
estimateMemorySize
public int estimateMemorySize() -
setCoords
public void setCoords(double _x, double _y) -
setCoords
public void setCoords(double _xmin, double _ymin, double _xmax, double _ymax) -
setCoords
-
setCoords
-
setCoords
-
getInflated
-
setFromPoints
Sets the envelope from the array of points. The envelope will be set to empty if the array is null.- Parameters:
points- The points to set the envelope from. No element in the array can be null.
-
setEmpty
public void setEmpty() -
setInfinite
public void setInfinite() -
isEmpty
public boolean isEmpty() -
setCoords
-
merge
public void merge(double x, double y) -
mergeNE
public void mergeNE(double x, double y) Merges a point with this envelope without checking if the envelope is empty. Use with care.- Parameters:
x- The x coord of the pointy- the y coord in the point
-
merge
-
merge
-
merge
-
inflate
public void inflate(double dx, double dy) -
scale
public void scale(double f) -
zoom
public void zoom(double factorX, double factorY) -
isIntersecting
Checks if this envelope intersects the other.- Parameters:
other- The other envelope.- Returns:
- True if this envelope intersects the other.
-
isIntersectingNE
Checks if this envelope intersects the other assuming neither one is empty.- Parameters:
other- The other envelope.- Returns:
- True if this envelope intersects the other. Assumes this and other envelopes are not empty.
-
isIntersecting
public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double ymax_) Checks if this envelope intersects the other.- Parameters:
xmin_-ymin_-xmax_-ymax_-- Returns:
- True if this envelope intersects the other.
-
intersect
Intersects this envelope with the other and stores result in this envelope.- Parameters:
other- The other envelope.- Returns:
- True if this envelope intersects the other, otherwise sets this envelope to empty state and returns False.
-
queryCorner
Queries a corner of the envelope.- Parameters:
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)
- Returns:
- Point at a corner of the envelope.
-
queryCorners
Queries corners into a given array. The array length must be at least 4. Starts from the lower left corner and goes clockwise.- Parameters:
corners- The array of four points.
-
queryCornersReversed
Queries corners into a given array in reversed order. The array length must be at least 4. Starts from the lower left corner and goes counterclockwise.- Parameters:
corners- The array of four points.
-
getArea
public double getArea() -
getLength
public double getLength() -
setFromPoints
-
reaspect
public void reaspect(double arWidth, double arHeight) -
getCenterX
public double getCenterX() -
getCenterY
public double getCenterY() -
getWidth
public double getWidth() -
getHeight
public double getHeight() -
move
public void move(double dx, double dy) Moves the Envelope by given distance.- Parameters:
dx-dy-
-
centerAt
public void centerAt(double x, double y) -
centerAt
-
offset
public void offset(double dx, double dy) -
normalize
public void normalize() -
queryLowerLeft
-
queryLowerRight
-
queryUpperLeft
-
queryUpperRight
-
isValid
public 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).- Returns:
- True if the envelope is valid.
-
getCenter
Gets the center point of the envelope. The Center Point occurs at: ((XMin + XMax) / 2, (YMin + YMax) / 2).- Returns:
- the center point
-
queryCenter
-
centerAt
-
getLowerLeft
-
getUpperLeft
-
getLowerRight
-
getUpperRight
-
contains
-
contains
-
contains
public boolean contains(double x, double y) -
contains
Returns True if the envelope contains the other envelope (boundary inclusive).- Parameters:
other- The other envelope.- Returns:
- True if this contains the other.
-
containsExclusive
public boolean containsExclusive(double x, double y) Returns True if the envelope contains the point (boundary exclusive).- Parameters:
x-y-- Returns:
- True if this contains the point.
-
containsExclusive
Returns True if the envelope contains the point (boundary exclusive). -
containsExclusive
Returns True if the envelope contains the other envelope (boundary exclusive).- Parameters:
other- The other envelope- Returns:
- True if this contains the other, boundary exclusive.
-
equals
-
hashCode
-
_snapToBoundary
-
_boundaryDistance
-
_envelopeSide
-
_calculateToleranceFromEnvelope
double _calculateToleranceFromEnvelope() -
clipLine
-
_clipCode
-
clipLine
-
clipLineAuxiliary
boolean clipLineAuxiliary(double denominator, double numerator, double[] segParams) -
isDegenerate
public boolean isDegenerate(double tolerance) Returns True, envelope is degenerate (Width or Height are less than tolerance). Note: this returns False for Empty envelope. -
_snapClip
-
isPointOnBoundary
-
distance
Calculates minimum distance from this envelope to the other. Returns 0 for empty envelopes.- Parameters:
other- The other envelope.- Returns:
- Returns the distance
-
distance
Calculates minimum distance from this envelope to the point. Returns 0 for empty envelopes.- Parameters:
pt2D- The other point.- Returns:
- Returns the distance
-
sqrDistance
Calculates minimum squared distance from this envelope to the other. Returns 0 for empty envelopes.- Parameters:
other- The other envelope.- Returns:
- Returns the squared distance
-
sqrDistance
public double sqrDistance(double xmin_, double ymin_, double xmax_, double ymax_) Calculates minimum squared distance from this envelope to the other. Returns 0 for empty envelopes.- Parameters:
xmin_-ymin_-xmax_-ymax_-- Returns:
- Returns the squared distance.
-
sqrMaxDistance
Returns squared max distance between two bounding boxes. This is furthest distance between points on the two envelopes.- Parameters:
other- The bounding box to calculate the max distance two.- Returns:
- Squared distance value.
-
sqrDistance
Calculates minimum squared distance from this envelope to the point. Returns 0 for empty envelopes.- Parameters:
pt2D- The point.- Returns:
- Returns the squared distance
-
queryIntervalX
-
queryIntervalY
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
readObjectNoData
- Throws:
ObjectStreamException
-