public class TLcdLonLatBounds extends ALcd2DEditableBounds implements ILcd2DEditableBounds
ILcd2DEditableBounds
in
the geodetic space.
All longitude/latitude coordinates are expressed in degrees.
This class is thread-safe for concurrent read-only access of its contents.
For read-write access, external locking must be used. Such locking is
typically done at the model level.Constructor and Description |
---|
TLcdLonLatBounds()
Constructs a new rectangle, initialized to location (0, 0) and size (0,
0).
|
TLcdLonLatBounds(double aLon,
double aLat,
double aWidth,
double aHeight)
Constructs and initializes a rectangle with the specified parameters.
|
TLcdLonLatBounds(ILcdBounds aBounds)
Constructs a new rectangle, initialized to match the values of the
specified rectangle.
|
TLcdLonLatBounds(ILcdPoint aPoint)
Constructs a rectangle at the given point with width and height zero.
|
TLcdLonLatBounds(ILcdPoint aPoint,
double aWidth,
double aHeight)
Constructs a rectangle and initializes it with the parameters.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates and returns a copy of this object.
|
ILcd2DEditableBounds |
cloneAs2DEditableBounds()
Returns a copy of this
ILcdBounds object that is also an ILcd2DEditableBounds . |
ILcd3DEditableBounds |
cloneAs3DEditableBounds()
Returns a copy of this
ILcdBounds object that is also an ILcd3DEditableBounds . |
boolean |
contains2D(double aLon,
double aLat)
Checks whether this
ALcdBounds object contains the given point in the cartesian
plane. |
boolean |
contains2D(double aLon,
double aLat,
double aWidth,
double aHeight)
Checks whether this
ALcdBounds object contains the given rectangle in
the cartesian plane. |
double |
getHeight()
Returns the height of the bounding box in degrees.
|
ILcdPoint |
getLocation()
Returns the location of the bounding box (smallest x and y coordinates).
|
double |
getMaxX()
Returns the maximum X value (right boundary) of this bounds.
|
double |
getMaxY()
Returns the maximum Y value (upper boundary) of this bounds.
|
double |
getMaxZ()
Returns the maximum Z value (top boundary) of this bounds.
|
double |
getMinX()
Returns the minimum X value (left boundary) of this bounds.
|
double |
getMinY()
Returns the minimum Y value (lower boundary) of this bounds.
|
double |
getMinZ()
Returns the minimum Z value (bottom boundary) of this bounds.
|
double |
getWidth()
Returns the width of the bounding box in degrees.
|
boolean |
interacts2D(double aLon,
double aLat,
double aWidth,
double aHeight)
Checks whether this
ALcdBounds object interacts with the given rectangle in
the cartesian plane. |
void |
move2D(double aLon,
double aLat)
Moves the bounds.
|
void |
setHeight(double aHeight)
Sets the height (in degrees) of this bounds so that it covers a valid area.
|
void |
setTo2DIntersection(double aLon,
double aLat,
double aWidth,
double aHeight)
Calculates the 2D intersection of this
ALcd2DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setTo2DUnion(double aLon,
double aLat,
double aWidth,
double aHeight)
Calculates the 2D union of this
ALcd2DEditableBounds and a given rectangle
in the cartesian plane. |
void |
setWidth(double aWidth)
Sets the width of the bounds (the extent along the x-axis).
|
getDepth, isDefined, move2D, setDefined, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, toString, translate2D
contains2D, contains3D, contains3D, contains3D, equals, fromDomainObject, getBounds, getFocusPoint, hashCode, interacts2D, interacts3D, interacts3D, isDefined, isDefined
contains2D, contains3D
finalize, getClass, notify, notifyAll, wait, wait, wait
move2D, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2D
contains2D, contains3D, contains3D, getCenter, getDepth, interacts2D, interacts3D, interacts3D, isDefined
contains2D, contains3D, contains3D, getFocusPoint
getBounds
public TLcdLonLatBounds(double aLon, double aLat, double aWidth, double aHeight)
aLon
- the longitude coordinate of the most south-western point.aLat
- the latitude coordinate of the most south-western point.aWidth
- the longitude-width of the rectangle, in degrees, must be positive.aHeight
- the latitude-height of the rectangle, in degrees, must be positive.public TLcdLonLatBounds()
The defined
status of the instance is false
.
public TLcdLonLatBounds(ILcdBounds aBounds)
The defined
status of the instance is also copied from the specified bounds.
aBounds
- a rectangle from which to copy initial values.public TLcdLonLatBounds(ILcdPoint aPoint, double aWidth, double aHeight)
aPoint
- the most south-western point of the rectangle.aWidth
- the longitude-width of the rectangle, in degrees, must be positive.aHeight
- the latitude-height of the rectangle, in degrees, must be positive.public TLcdLonLatBounds(ILcdPoint aPoint)
aPoint
- the point at which the rectangle is located.public final ILcdPoint getLocation()
ILcdBounds
getLocation
in interface ILcdBounds
public double getMinX()
ILcdBounds
getLocation.getX()
, but can be overridden for performance.getMinX
in interface ILcdBounds
ILcdBounds.getMaxX()
public double getMinY()
ILcdBounds
getLocation.getY()
, but can be overridden for performance.getMinY
in interface ILcdBounds
ILcdBounds.getMaxY()
public double getMinZ()
ILcdBounds
getLocation.getZ()
, but can be overridden for performance.getMinZ
in interface ILcdBounds
ILcdBounds.getMaxZ()
public double getMaxX()
ILcdBounds
getLocation.getX() + getWidth()
, but can be overridden for performance.
Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.
For geodetic bounds
, the returned value is not necessarily normalized to [-180, 180].getMaxX
in interface ILcdBounds
ILcdBounds.getMinX()
public double getMaxY()
ILcdBounds
getLocation.getY() + getHeight()
, but can be overridden for performance.
Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.getMaxY
in interface ILcdBounds
ILcdBounds.getMinY()
public double getMaxZ()
ILcdBounds
getLocation.getZ() + getDepth()
, but can be overridden for performance.
Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.getMaxZ
in interface ILcdBounds
ILcdBounds.getMinZ()
public final double getWidth()
getWidth
in interface ILcdBounds
public void setWidth(double aWidth)
setWidth
in interface ILcd2DEditableBounds
aWidth
- the new width, in degrees.public final double getHeight()
getHeight
in interface ILcdBounds
public void setHeight(double aHeight)
getHeight()
is not necessarily the same
as the value passed here.setHeight
in interface ILcd2DEditableBounds
aHeight
- the proposed new height, in degrees, for this bounds object. This value
may be clipped to ensure that the bounds covers a valid
latitude interval.public void move2D(double aLon, double aLat)
move2D
in interface ILcd2DEditableBounds
move2D
in interface ILcd2DEditableShape
aLon
- the longitude coordinate of the new most south-western point.aLat
- the latitude coordinate of the new most south-western point.public ILcd2DEditableBounds cloneAs2DEditableBounds()
ILcdBounds
ILcdBounds
object that is also an ILcd2DEditableBounds
.
This makes sure that the first two dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.cloneAs2DEditableBounds
in interface ILcdBounds
ILcdBounds
object that is also an ILcd2DEditableBounds
.
This makes sure that the first two dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.ILcd2DEditableBounds
public ILcd3DEditableBounds cloneAs3DEditableBounds()
ILcdBounds
ILcdBounds
object that is also an ILcd3DEditableBounds
.
This makes sure that all three dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.cloneAs3DEditableBounds
in interface ILcdBounds
ILcdBounds
object that is also an ILcd3DEditableBounds
.
This makes sure that all three dimensions of the copy are writable,
even if the original ILcdBounds
object may be read-only.ILcd3DEditableBounds
public Object clone()
clone
in interface ILcdCloneable
clone
in class ALcdShape
Object.clone()
public boolean contains2D(double aLon, double aLat)
ALcdBounds
ALcdBounds
object contains the given point in the cartesian
plane. Only the first two dimensions of the ILcdBounds
are considered,
that is, the x coordinate and y coordinate of its location, its width, and
its height.contains2D
in interface ILcdShape
contains2D
in class ALcdBounds
aLon
- the x coordinate of the point.aLat
- the y coordinate of the point.public boolean interacts2D(double aLon, double aLat, double aWidth, double aHeight)
ALcdBounds
ALcdBounds
object interacts with the given rectangle in
the cartesian plane. Only the first two dimensions of the ILcdBounds
object
are considered, that is, the x coordinate and y coordinate of its location,
its width, and its height.interacts2D
in interface ILcdBounds
interacts2D
in class ALcdBounds
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.true
if this ALcdBounds
object touches or overlaps to
any extent with the given rectangle, false
otherwise.public boolean contains2D(double aLon, double aLat, double aWidth, double aHeight)
ALcdBounds
ALcdBounds
object contains the given rectangle in
the cartesian plane. Only the first two dimensions of the ILcdBounds
object
are considered, that is, the x coordinate and y coordinate of its location,
its width, and its height.contains2D
in interface ILcdBounds
contains2D
in class ALcdBounds
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public void setTo2DIntersection(double aLon, double aLat, double aWidth, double aHeight)
ALcd2DEditableBounds
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DIntersection
in interface ILcd2DEditableBounds
setTo2DIntersection
in class ALcd2DEditableBounds
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.public void setTo2DUnion(double aLon, double aLat, double aWidth, double aHeight)
ALcd2DEditableBounds
ALcd2DEditableBounds
and a given rectangle
in the cartesian plane.setTo2DUnion
in interface ILcd2DEditableBounds
setTo2DUnion
in class ALcd2DEditableBounds
aLon
- the x coordinate of the rectangle.aLat
- the y coordinate of the rectangle.aWidth
- the width of the rectangle.aHeight
- the height of the rectangle.