Package com.luciad.geometries
Class Bounds
java.lang.Object
com.luciad.geometries.Geometry
com.luciad.geometries.Bounds
- All Implemented Interfaces:
- AutoCloseable
Represents a bounds.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBounds(CoordinateReference reference, Coordinate location, double width, double height, double depth) Creates a new bounds instance based on a point, and the width, height and depth with respect to that point.Bounds(CoordinateReference reference, Coordinate lowerLeft, Coordinate upperRight) Creates a new bounds instance based on lower left and upper right corners.
- 
Method SummaryModifier and TypeMethodDescriptionstatic BoundsboundsUnion(Bounds bounds1, Bounds bounds2) Returns the union of the two bounds objects, provided they are defined in the same coordinate reference.voidclose()static booleancontains2D(Bounds bounds, Coordinate coordinate) Checks if this bounds contains the specified coordinate, considering only the x and y values.static booleancontains2D(Bounds bounds, Coordinate coordinate, double eps) Checks if this bounds contains the specified coordinate, considering only the x and y values.static booleancontains2D(Bounds bounds1, Bounds bounds2) Checks if the first bounds contains the second bounds, only considering x and y values.static booleancontains2D(Bounds bounds1, Bounds bounds2, double eps) Checks if the first bounds contains the second bounds, only considering x and y values.static booleancontains3D(Bounds bounds, Coordinate coordinate) Checks if the first bounds contains the second bounds.static booleancontains3D(Bounds bounds, Coordinate coordinate, double eps) Checks if the first bounds contains the second bounds.booleanprotected voidfinalize()Returns the center of this bounds instance.doublegetDepth()Returns the depth of this bounds instance.doubleReturns the height of this bounds instance.Returns the lower left corner of this bounds instance.Returns the lower left corner of this bounds instance.Returns the lower right corner of this bounds instance.Returns the upper left corner of this bounds instance.Returns the upper right corner of this bounds instance.doublegetWidth()Returns the width of this bounds instance.inthashCode()static booleaninteracts2D(Bounds bounds1, Bounds bounds2) Checks of two given bounds geometries have an interaction, only considering x and y values.static booleaninteracts2D(Bounds bounds1, Bounds bounds2, double eps) Checks of two given bounds geometries have an interaction, only considering x and y values.static Boundsintersection2D(Bounds bounds1, Bounds bounds2) Returns the intersection of the two given bounds geometries.Methods inherited from class com.luciad.geometries.GeometrygetBounds, getReference
- 
Constructor Details- 
Bounds
- 
Boundspublic Bounds(@NotNull CoordinateReference reference, @NotNull Coordinate location, double width, double height, double depth) Creates a new bounds instance based on a point, and the width, height and depth with respect to that point.- Parameters:
- reference- the coordinate reference
- location- the lower left location of the bounds
- width- the width
- height- the height
- depth- the depth
 
- 
Boundspublic Bounds(@NotNull CoordinateReference reference, @NotNull Coordinate lowerLeft, @NotNull Coordinate upperRight) Creates a new bounds instance based on lower left and upper right corners.This method takes wrap-around the 180° meridian into account when the coordinate reference is geodetic. - Parameters:
- reference- the coordinate reference
- lowerLeft- the lower left corner of the bounds
- upperRight- the upper right corner of the bounds
 
 
- 
- 
Method Details- 
finalizeprotected void finalize()
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Overrides:
- closein class- Geometry
 
- 
getLocationReturns the lower left corner of this bounds instance.- Returns:
- the lower left corner of this bounds instance.
 
- 
getWidthpublic double getWidth()Returns the width of this bounds instance.- Returns:
- the width of this bounds instance.
 
- 
getHeightpublic double getHeight()Returns the height of this bounds instance.- Returns:
- the height of this bounds instance.
 
- 
getDepthpublic double getDepth()Returns the depth of this bounds instance.- Returns:
- the depth of this bounds instance.
 
- 
getCenterReturns the center of this bounds instance.When this bounds uses a geodetic reference, this method normalizes the result. - Returns:
- the center of this bounds instance.
 
- 
getLowerLeftCornerReturns the lower left corner of this bounds instance.When this bounds uses a geodetic reference, this method normalizes the result. - Returns:
- the lower left corner of this bounds instance.
 
- 
getLowerRightCornerReturns the lower right corner of this bounds instance.When this bounds uses a geodetic reference, this method normalizes the result. - Returns:
- the lower right corner of this bounds instance.
 
- 
getUpperLeftCornerReturns the upper left corner of this bounds instance.When this bounds uses a geodetic reference, this method normalizes the result. - Returns:
- the upper left corner of this bounds instance.
 
- 
getUpperRightCornerReturns the upper right corner of this bounds instance.When this bounds uses a geodetic reference, this method normalizes the result. - Returns:
- the upper right corner of this bounds instance.
 
- 
boundsUnion@NotNull public static Bounds boundsUnion(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException Returns the union of the two bounds objects, provided they are defined in the same coordinate reference.- Parameters:
- bounds1- the first bounds.
- bounds2- the second bounds.
- Returns:
- the union of the two bounds objects.
- Throws:
- IllegalArgumentException- if the bounds are not defined in the same coordinate reference.
 
- 
intersection2DReturns the intersection of the two given bounds geometries.- Parameters:
- bounds1- a bounds instance
- bounds2- another bounds instance
- Returns:
- the intersection of the given bounds geometries. If geodetic bounds, the result is normalized.
 
- 
interacts2Dpublic static boolean interacts2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2, double eps) throws IllegalArgumentException Checks of two given bounds geometries have an interaction, only considering x and y values.- Parameters:
- bounds1- the first bounds.
- bounds2- the second bounds.
- eps- a tolerance for the interaction check.
- Returns:
- true if the two bounds interact in 2D.
- Throws:
- IllegalArgumentException- if the bounds are not defined in the same coordinate reference.
 
- 
interacts2Dpublic static boolean interacts2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException Checks of two given bounds geometries have an interaction, only considering x and y values.- Parameters:
- bounds1- the first bounds.
- bounds2- the second bounds.
- Returns:
- true if the two bounds interact in 2D.
- Throws:
- IllegalArgumentException- if the bounds are not defined in the same coordinate reference.
 
- 
contains2Dpublic static boolean contains2D(@NotNull Bounds bounds, @NotNull Coordinate coordinate, double eps) Checks if this bounds contains the specified coordinate, considering only the x and y values.- Parameters:
- bounds- a bounds instance.
- coordinate- a coordinate.
- eps- a tolerance for the contains check.
- Returns:
- true if this bounds contains the specified coordinate, considering only the x and y values.
 
- 
contains2DChecks if this bounds contains the specified coordinate, considering only the x and y values.- Parameters:
- bounds- a bounds instance.
- coordinate- a coordinate.
- Returns:
- true if this bounds contains the specified coordinate, considering only the x and y values.
 
- 
contains2Dpublic static boolean contains2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2, double eps) throws IllegalArgumentException Checks if the first bounds contains the second bounds, only considering x and y values.- Parameters:
- bounds1- a bounds instance.
- bounds2- another bounds instance.
- eps- a tolerance for the contains check.
- Returns:
- if the first bounds contains the second bounds.
- Throws:
- IllegalArgumentException- if the bounds are not defined in the same coordinate reference.
 
- 
contains2Dpublic static boolean contains2D(@NotNull Bounds bounds1, @NotNull Bounds bounds2) throws IllegalArgumentException Checks if the first bounds contains the second bounds, only considering x and y values.- Parameters:
- bounds1- a bounds instance.
- bounds2- another bounds instance.
- Returns:
- if the first bounds contains the second bounds.
- Throws:
- IllegalArgumentException- if the bounds are not defined in the same coordinate reference.
 
- 
contains3Dpublic static boolean contains3D(@NotNull Bounds bounds, @NotNull Coordinate coordinate, double eps) Checks if the first bounds contains the second bounds.- Parameters:
- bounds- a bounds instance.
- coordinate- a coordinate.
- eps- a tolerance for the contains check.
- Returns:
- true if this bounds contains the specified coordinate.
 
- 
contains3DChecks if the first bounds contains the second bounds.- Parameters:
- bounds- a bounds instance.
- coordinate- a coordinate.
- Returns:
- true if this bounds contains the specified coordinate.
 
- 
hashCodepublic int hashCode()
- 
equals
 
-